I need help on writing a trigger in SQL Server to be used in Siebel:
- The system field ROW_ID has to be unique (key)
- When the field INSERT_CD and CAMP_WAVE_ID is null then ROW_ID must be generated (see below).
- If not, leave ROW_ID as is.
- ROW_ID is a key field of varchar(15).
The following statement generates the perfect key/row id:
select substring(replace (CAST (newid() as varchar(36)),'-',''),1,15)
I need help on writing a SQL Server 2005 trigger to generate this key.