Viewing 15 posts - 421 through 435 (of 1,048 total)
Cadavre (6/29/2013)
kapil_kk (6/29/2013)
I need help in getting this type of output, I tired with MIN and MAX function but didnt get required output:
Create table T1
(Id int identity primary key,
VoucherNo varchar(10),
TransNo...
June 29, 2013 at 7:09 am
I think this will work for you....
declare @N int=2
If ISNULL(@N,0) = 0
select * from
(
select 10 'Top 2'
Union
Select 20
Union
Select 30
union
select 40
union
select 50
)T1
ELSE
select top(@N) * from
(
select 10 'Top 2'
Union
Select 20
Union
Select 30
union
select...
June 28, 2013 at 7:19 am
Nilandri, can you please post what changes you made in your query so that other s can also learn from that thing...
June 28, 2013 at 7:17 am
Use Go batch separator as Luis suggested...
June 28, 2013 at 7:11 am
Danny Ocean (6/26/2013)
I never used between for string operation. I also never seen this kind of condition in working scenario.:doze:
Same here...
I dont think there is any need of using BETWEEN...
June 27, 2013 at 12:02 am
Sean Lange (6/26/2013)
kapil_kk (6/26/2013)
SELECT id,
SUBSTRING((SELECT ', ' + Term
FROM Something s2
WHERE s1.id = s2.id
and s2.Type = 'Subject'
ORDER BY s2.Term...
June 26, 2013 at 11:25 pm
Lowell (6/26/2013)
June 26, 2013 at 7:49 am
you can do the same thing as Sean did using SUBSTRING also:
SELECT id,
SUBSTRING((SELECT ', ' + Term
FROM Something s2
WHERE s1.id = s2.id
and s2.Type = 'Subject'
ORDER BY s2.Term
FOR XML PATH('')),...
June 26, 2013 at 1:26 am
Hi Sean,
I know to print comma seperated values using FOR XML.
But I was trying the same solution using COALESCE like this:
DECLARE @var varchar(max)
SELECT @var = coalesce(@var +',','') + term from...
June 26, 2013 at 1:24 am
KWymore (6/25/2013)
Nice question. I have never used this option. Good to know!
+1 🙂
June 26, 2013 at 1:02 am
Andrew G (6/25/2013)
SELECT sm.object_id, OBJECT_NAME(sm.object_id) AS object_name, o.type, o.type_desc, sm.definition
FROM sys.sql_modules AS sm
JOIN sys.objects AS o ON sm.object_id = o.object_id
WHERE...
June 26, 2013 at 1:02 am
Danny Ocean (6/24/2013)
Easy and good basic question. 🙂Sometimes its good to play around basic. Its refresh us. 🙂
Thanks
+1 :-):-P
June 25, 2013 at 12:30 am
WHen you are enabling CDC on table, you are executing a sp in this manner:
EXEC sys.sp_cdc_enable_table
@Source_schema = N'dbo',
@source_name = N'tblEmployee',
@filegroup_name = N'PRIMARY',
@supports_net_changes = 1
GO
It will ...
June 24, 2013 at 6:37 am
Viewing 15 posts - 421 through 435 (of 1,048 total)