Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stored procedure for cloning records
Message
De
03/11/2003 16:27:32
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Stored procedure for cloning records
Divers
Thread ID:
00845792
Message ID:
00845792
Vues:
82
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 !
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform