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

Generating surrogate keys Expand / Collapse
Author
Message
Posted Thursday, July 30, 2009 7:12 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, April 14, 2014 9:09 AM
Points: 1, Visits: 11
hi,
I am new to sql server and i need a solution for generating surrogate keys. i want to generate a surrogate key and need to insert into a table and this key must be the primary key for that table.

if there is any update to this table for which there is aafter generating surrogate key, the records should be updated based on this surrogate key(no insertion of new record should not happen).

till now, i have :
1.created execute sql task with the query: select coalesce (max(Surr_key),0) and assiging it to a variable of type object.
2. then a For each loop container to accept the object type as variable.
3.A data flow task inside this container, which holds Script component to generate the surr. key.
now am having problm in for each loop container.
it doesn't accepts the object type variable



pl;s help me
Post #762864
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse