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 2005 Forums
 Transact-SQL (2005)
 Horizontal display

Author  Topic 

omega1983
Starting Member

40 Posts

Posted - 2009-09-11 : 23:32:03
I have the following data
name ID code
John Smith 3 s
John Smith 3 sm


I want this to read as follows

name ID code1 code2
John Smith 3 s sm

Someone mentioned Pivot. Is there another way, whether in a VIEW or stored procedure? Essentially I want to expand the code section and display it horizontally

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-09-13 : 09:23:06
you can use PIVOT in a VIEW or Stored Procedure.



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-13 : 12:57:54
will the no of codes be static (always 2)?
Go to Top of Page
   

- Advertisement -