Viewing 15 posts - 61 through 75 (of 216 total)
Hi ,
you can pass variable using dynamic SQL.
declare
@Column_list varchar(max)
set @Column_list = '(MM_Title, MM_Author, MM_Theme, MM_Description, MM_Publisher, MM_Source, MM_Copyright, MM_Language, MM_Location)'
declare @search varchar(20);
set @search='test'
declare @sql varchar(max);
set @sql='SELECT *
FROM GEN_L_MM
WHERE...
Malleswarareddy
I.T.Analyst
MCITP(70-451)
April 6, 2012 at 2:50 am
Nice Question .Thanks
Malleswarareddy
I.T.Analyst
MCITP(70-451)
March 19, 2012 at 2:35 am
Nice question on set options
Malleswarareddy
I.T.Analyst
MCITP(70-451)
February 1, 2012 at 3:19 am
Thanks for new question.First time am hearing about this.
Malleswarareddy
I.T.Analyst
MCITP(70-451)
January 29, 2012 at 9:44 pm
using Common table expressions (CTE).
Malleswarareddy
I.T.Analyst
MCITP(70-451)
December 30, 2011 at 2:29 am
Cannot able to understand properly may be
this query will work
declare @username varchar(10),@fromdate datetime ,@todate datetime;
select username,ACTION,COUNT(action) from table1
where username=@username and datetime between @fromdate and datetime
group by username,ACTION
...
Malleswarareddy
I.T.Analyst
MCITP(70-451)
December 30, 2011 at 2:16 am
Hi,
with cte this code will work fine.
with cte as
(select 1 as i
union all
select i+1 from cte where i<5
)
select 'ABC'+CAST(i as varchar) from cte
Malleswarareddy
I.T.Analyst
MCITP(70-451)
December 30, 2011 at 12:32 am
Happy new year to all
Malleswarareddy
I.T.Analyst
MCITP(70-451)
December 29, 2011 at 11:56 pm
I got it from this link.
Malleswarareddy
I.T.Analyst
MCITP(70-451)
December 25, 2011 at 11:43 pm
Hi,
This sample may be helpfull.
declare @Rel char(100);
SET @Rel='surname'
declare @sql nvarchar(2000);
set @sql='Select Top 10 ';
SET @sql=@sql+' CASE WHEN @Rel=''surname'' then surname ELSE given_names end'
set @sql=@sql+' AS '+@Rel
set @sql=@Sql+' from person
group...
Malleswarareddy
I.T.Analyst
MCITP(70-451)
December 25, 2011 at 11:16 pm
Happy and merry X-mass
Malleswarareddy
I.T.Analyst
MCITP(70-451)
December 25, 2011 at 9:51 pm
Hugo Kornelis (12/22/2011)
malleswarareddy_m (12/22/2011)
I think the above result depends on the insert statement.which ever first inserted it is showing that only.Please clarifyme if am wrong.
You are somewhat right and somewhat...
Malleswarareddy
I.T.Analyst
MCITP(70-451)
December 22, 2011 at 5:35 am
Hi,
Before answering the question. i tested with test data like
declare @test-2 table(mm varchar(10))
INSERT INTO @test-2 VALUES ('TEST')
INSERT INTO @test-2 VALUES ('abc')
INSERT INTO @test-2 VALUES ('145.87')
INSERT INTO @test-2 VALUES ('1059.31')
INSERT...
Malleswarareddy
I.T.Analyst
MCITP(70-451)
December 22, 2011 at 12:52 am
Choosed third option.got it wrong. did not think about data.
in question they did not given any sample data.
Malleswarareddy
I.T.Analyst
MCITP(70-451)
December 13, 2011 at 11:40 pm
I got it wrong.till now id id not worked on nested joins.thanks i leanred one new point today
Malleswarareddy
I.T.Analyst
MCITP(70-451)
December 7, 2011 at 10:38 pm
Viewing 15 posts - 61 through 75 (of 216 total)