Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored procedure for cloning records
Message
From
03/11/2003 16:27:32
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Stored procedure for cloning records
Miscellaneous
Thread ID:
00845792
Message ID:
00845792
Views:
81
Hi,

I'm using tables in my database that all have an integer field iid as a primary key field. For several reasons, I also use a stored procedure sp_getNewId('TableName') to get a new primary keyvalue. This procedure gets it's value (incrementation) of the corresponding entry in the table 'id'.

Now I want to write a stored procedure sp_Clone(@TableName Char(40),@KeyValue integer) that creates a copy of the record with keyvalue (iid) @KeyValue

For one particular table, I guess this could be done by using a cursor but since this has to work with all tables in the database, I'dont know exactly how to tackle this problem.

Can anyone help me?

Thanks in advance,

Mark
If everything seems to be going well, you obviously don't know what the hell is going on !
Next
Reply
Map
View

Click here to load this message in the networking platform