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 !