SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 query help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pnpsql
Posting Yak Master

India
246 Posts

Posted - 04/03/2013 :  02:58:04  Show Profile  Reply with Quote

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 col4
jack tom amar vijay

kindly help

challenge everything

waterduck
Aged Yak Warrior

Malaysia
964 Posts

Posted - 04/03/2013 :  03:16:20  Show Profile  Reply with Quote
http://msdn.microsoft.com/en-us/library/ms177410(v=sql.105).aspx
Go to Top of Page

pnpsql
Posting Yak Master

India
246 Posts

Posted - 04/03/2013 :  03:22:37  Show Profile  Reply with Quote
This Topic Is No Longer Available

challenge everything
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 04/03/2013 :  04:22:17  Show Profile  Reply with Quote
quote:
Originally posted by pnpsql

This Topic Is No Longer Available

challenge everything


does that mean your problem got sorted?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

pnpsql
Posting Yak Master

India
246 Posts

Posted - 04/03/2013 :  06:12:43  Show Profile  Reply with Quote
no sir problem is still exists

challenge everything
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 04/03/2013 :  07:06:14  Show Profile  Reply with Quote
whats the problem? are you trying to pivot dynamically?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

pnpsql
Posting Yak Master

India
246 Posts

Posted - 04/03/2013 :  07:41:26  Show Profile  Reply with Quote
no i don't wanna use pivot

challenge everything
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 04/03/2013 :  13:49:19  Show Profile  Reply with Quote
then tell what you're trying to get as output

just a single line of data doesnt explain anything for us

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

pnpsql
Posting Yak Master

India
246 Posts

Posted - 04/06/2013 :  07:04:41  Show Profile  Reply with Quote

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
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 04/09/2013 :  00:14:58  Show Profile  Reply with Quote

SELECT STUFF((SELECT ',' + NAME FROM @VTBL FOR XML PATH('')),1,1,'')



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000