vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Matt Rellick (tics@yahoo.com) writes: > I'm working for a client who uses their own algorithm to generate > primary keys for their tables (don't even ask why they are doing this). > For each table in their database they have a supporting "Key" table with > 1 row. They use a couple of values from this row to generate a "key" > and then update the row so that the next key can be generated. > > My problem is that I want to be able insert more than one row at a time > into a table (in other words, I want to be able to do a SELECT INSERT). > I tried creating a user defined function to do this, but SQL SERVER > won't let you perform an insert from a UDF (learn something new > everyday). > > Has anyone else ever had to do something like this? Any ideas on how I > could do this. I hate cursors and really don't want to be forced into > using one. This may or may not be possible. If you show us how they generate a key from a single value, we might be able to find a way to use this for multi-row inserts. -- Erland Sommarskog, SQL Server MVP, sommar@algonet.se Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp |