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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IDKey changes in SQL 2000?

Status
Not open for further replies.

ncscott

MIS
Jan 10, 2003
36
US
My company has recently updated out ERP and databases from SQL 7.0 to SQL 2000. I am having trouble with a stored procedure which worked under the old platform. The proc populated a table which is used for reporting. It involves an INSERT <table>
SELECT ()

The select statement is valid on its own, but the full insert fails due to an invalid column name or wrong number of values. The destination table has an IDKey field which is just sequential, this is the only field which is not included in the insert statement. SQL 7.0 always added the IDKey on its own, is SQL 2000 different in this respect? Am I going to have to modify the procedure to sequentially assign and write the IDKey, or is there a trigger or setting somewhere that needs to be changed to have the IDKey assigned for each row?

Thanks.
 
No, SQL 2000 will increment your Identity field. Make sure that in the new table that your field is in fact marked as an identity field.
 
Thanks for the reply, I actually figured that out a couple hours ago, you hit the nail on the head, when the table migrated over the identity property didn't. Problem solved. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top