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
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 How to Convert Rows To Column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

lkiran086
Starting Member

21 Posts

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

James K
Flowing Fount of Yak Knowledge

3712 Posts

Posted - 06/16/2014 :  08:40:26  Show Profile  Reply with Quote
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 - 06/18/2014 :  03:13:53  Show Profile  Reply with Quote
Thanks
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.19 seconds. Powered By: Snitz Forums 2000