ok let try to do a better job of explaining what i was tasked to do and let all know that im still fairly green when it comes to sql. everything i have learned was reading, google, youtube and trial and error.
So the company i work for acquired a used access control system. it creates its own tables, views and stored proceedures. i was able get some info like what table contains the employee information.
now i was also given the payroll database table.
i want to create a stored proceedure that will run and in the event of any changes will update the access control from the payroll data base.
the problem is in the access control the one column is not set to auto increment so i cant just insert updated changes and im not changing their tables without knowing more about their layout.
Now in the event of changes, my query would pick out the changes, then starting at the next number would auto number the entries and insert them into the access control table.
the part i am stuck at is the numbering. that is why i asked if i can use a variable for identity.
but then you say in 2012 and later identity does not work well without other proceedured done. of course dont think i will need to worry about that being we are only on 2005 and i dont think they are going to pay to upgrade.
Most of the stored proceedure i have done im just having issues with this incrementing number