Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 How to Convert Rows To Column

Author  Topic 

lkiran086
Starting Member

21 Posts

Posted - 2014-06-16 : 02:54:39
I have a table Contain one like "CNAME" It has some values how to Convert them in to Columns

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2014-06-16 : 08:40:26
quote:
Originally posted by lkiran086

I have a table Contain one like "CNAME" It has some values how to Convert them in to Columns


You probably need to PIVOT. If the names of the columns are known in advance, you can use the PIVOT Operator - see here: http://technet.microsoft.com/en-us/library/ms177410(v=sql.105).aspx

If that is not the case, you may need to use dynamic pivoting. see here: http://sqlblogcasts.com/blogs/madhivanan/archive/2008/08/27/dynamic-pivot-in-sql-server-2005.aspx
Go to Top of Page

lkiran086
Starting Member

21 Posts

Posted - 2014-06-18 : 03:13:53
Thanks
Go to Top of Page
   

- Advertisement -