Author |
Topic |
pnpsql
Posting Yak Master
246 Posts |
Posted - 2013-04-03 : 02:58:04
|
hi team,DECLARE @VTBL TABLE (NAME VARCHAR(100))INSERT INTO @VTBL (NAME)VALUES('JACK'),('TOM') ,('AMAR') ,('VIJA') i want TO see ALL NAMES IN COLUMN wise.LIKE col1 col2 col3 col4jack tom amar vijaykindly helpchallenge everything |
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2013-04-03 : 03:16:20
|
http://msdn.microsoft.com/en-us/library/ms177410(v=sql.105).aspx |
|
|
pnpsql
Posting Yak Master
246 Posts |
Posted - 2013-04-03 : 03:22:37
|
This Topic Is No Longer Availablechallenge everything |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-04-03 : 04:22:17
|
quote: Originally posted by pnpsql This Topic Is No Longer Availablechallenge everything
does that mean your problem got sorted?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
pnpsql
Posting Yak Master
246 Posts |
Posted - 2013-04-03 : 06:12:43
|
no sir problem is still existschallenge everything |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-04-03 : 07:06:14
|
whats the problem? are you trying to pivot dynamically?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
pnpsql
Posting Yak Master
246 Posts |
Posted - 2013-04-03 : 07:41:26
|
no i don't wanna use pivotchallenge everything |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-04-03 : 13:49:19
|
then tell what you're trying to get as outputjust a single line of data doesnt explain anything for us------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
pnpsql
Posting Yak Master
246 Posts |
Posted - 2013-04-06 : 07:04:41
|
DECLARE @VTBL TABLE (NAME VARCHAR(100))INSERT INTO @VTBL (NAME)VALUES('JACK'),('TOM') ,('AMAR') ,('VIJA') I WANT TO WRITE A QUERY THAT HAD SAME EFFECT AS BELW QUERY BUT PICKING DATA FROM @VTBL SELECT 'JACK' , 'TOM' , 'AMAR', 'VIJA' challenge everything |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-04-09 : 00:14:58
|
[code]SELECT STUFF((SELECT ',' + NAME FROM @VTBL FOR XML PATH('')),1,1,'')[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|