Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Script to generate columns for triggers Expand / Collapse
Author
Message
Posted Saturday, December 25, 2010 12:30 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, July 24, 2014 10:01 AM
Points: 91, Visits: 241
Comments posted to this topic are about the item SQL Script to generate columns for triggers


Post #1039213
Posted Monday, December 27, 2010 3:46 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, July 23, 2014 8:54 AM
Points: 106, Visits: 363
SELECT CASE WHEN column_id = MIN(column_id) OVER(PARTITION BY 1)  THEN 'INSERT INTO ' + OBJECT_NAME(object_id) + ' (' ELSE '	' END + name + CASE WHEN column_id = MAX(column_id) OVER(PARTITION BY 1)  THEN ')' ELSE ', ' END FROM sys.columns WHERE object_id = OBJECT_ID('TableName') ORDER BY column_id

Post #1039598
Posted Tuesday, January 4, 2011 5:25 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 11:08 AM
Points: 120, Visits: 2,442
Or, Just drag the Columns node from the object browser into the Query editor.

Mark
Just a cog in the wheel.
Post #1042767
Posted Friday, January 14, 2011 5:01 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, January 14, 2011 4:59 PM
Points: 1, Visits: 0
read many time still don't understand what are you talking about. Which is your resutls ? copy paste what???
Post #1048271
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse