Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Concatenate All Fields In One ?
Message
 
 
To
08/09/2006 09:59:50
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01152260
Message ID:
01152268
Views:
26
>After an INSERT/UPDATE (in a trigger), I need to take all fields in INSERTED cursor and concatenate them in one variable to place the result into a text field name DETAIL in a table named JOURNAL. How to do that?
>
>P.S.: The difficulty here is that I need all the columns but I don't know their names (it will ne a general stored proc - it can be called from any updated table). Then I must to use sysobjects and syscolums tables.

http://www.nigelrivett.net/SQLTriggers/AuditTrailTrigger.html should get you started. Keep in mind that DELETED and INSERTED table could have more than one record because trigger fires once per SQL statement not once per row.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform