Microsoft
Software
Hardware
Network
Question : Creating unique values for every row in a result set query
I am writing a stored procedure which is inserting data into a SQL table in a 3rd party application. There is a unique field in this table, PRECID, which is a alphanumeric number generated by a sp, sp_getprecid. When I insert multiple rows into the table, I need each PRECID field to generate a new PRECID with the execution of this SP. If I create a variable EXEC sp_getprecid, and use that variable as the insert value, the same value will be inserted for all rows. How can I loop to get a unique value for each row?
Answer : Creating unique values for every row in a result set query
Yes. You can't alter your database from within a function. Looks like you will have to call it in a loop.
Random Solutions
Generate an autonumber that I can then overwrite
Query with value determined by value on previous row
exchange 2007 on sbs 2008 divert email to another external server if not resolved
Windows folder size is
after setting up a 2008 member server in a 2003 domain I cannot log in as domain admin on member server
Need to insert Custom Advanced Properties in Word 2007
1x1 pixel tracking
Oracle 9i Reports question : Dynamic Reports
Circular referential integrity problems
How to move SQL 2005 data and log files