Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using SP within DTS for integer field

Status
Not open for further replies.

rq

Programmer
Jun 13, 2002
56
0
0
US

I created an SQL table that contains an integer field, which needs to be populated via usage of a stored procedure. The store procedure generates a unique number that will be used as a link id in another table. That said, how is this stored procedure defined within a DTS package?
 
Is this number a Unique Integer ID or are we spaeking of a GUID?

Thanks

J. Kusch
 

The number is a unique integer ID.
 
Why not set the table up w/ an Identity field on that column and let SQL server do the incrementing. Once you add the record to the table, you can use @@Identity to pull the newly insert unique ID from the table to be used else where in your code. May also want to take a look in Books OnLine about @@Indentity as well as scope_identity().

Thanks

J. Kusch
 

Normally, I would take that route. But the stored procedure that will be called keeps track of the integer numbers issued. What I didn't mention earlier is that I'm converting data from one application to another wherein the latter application uses this stored procedure to generate unique identifiers. As a matter of consistency, I'm required to call this stored procedure.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top