Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Create Function to Group Column and display as single column Expand / Collapse
Posted Wednesday, July 28, 2010 11:12 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, January 28, 2011 12:09 AM
Points: 6, Visits: 31
Consider table Exhibitor

Exhibitor Table name
ID Column name
Name Column name
StallNo1 Column name
StallNo2 Column name
StallNo3 Column name
StallNo4 Column name
StallNo5 Column name

i want a generic function it accept ('tablename','Column order min ','Column order max') it return group of Column as single column.

when i used this function in select query it gave me group of value for Group Column.

Waiting For Replay........................
Post #960485
Posted Thursday, July 29, 2010 2:21 AM



Group: General Forum Members
Last Login: Yesterday @ 12:52 AM
Points: 5,364, Visits: 7,073
Please provide us with an example of what you have already tried.

also, are you in a position to normalise the table?
Create table dbo.Exhibitor (
ID DataType
Name DataType
Create Table dbo.Stall
StallNo DataType
Exibitor DataType CONSTRAINT FK_Exibitor FOREIGN KEY REFERENCES dbo.Exibitor(ID)

Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #960542
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse