Hi all, i'm trying to create a stored procedure where I push all data from one table to another in the same dB.
This is what I have done so far:
The above code should push ALL info from the Department_Info table from TEST1 dB to TEST2 dB. I am getting the following error:
I think that means I need to do something like:
SELECT @Department_Info_ID=@@identity
SELECT @Department_Info_ID AS Department_Info_ID
Is that right? If not, then any help would be great.
Thanks.
____________________________________
Just Imagine.
This is what I have done so far:
Code:
CREATE PROCEDURE test1.sendtolive AS (
insert into test2.dbo.Department_Info
select * from Department_Info where Is_Live = 1
)
The above code should push ALL info from the Department_Info table from TEST1 dB to TEST2 dB. I am getting the following error:
Code:
Error 8101: An explicit value for the identity column in table 'test2.dbo.Department_info' can only be specified when a column list is used on IDENTITY_INSERT is ON.
I think that means I need to do something like:
SELECT @Department_Info_ID=@@identity
SELECT @Department_Info_ID AS Department_Info_ID
Is that right? If not, then any help would be great.
Thanks.
____________________________________
Just Imagine.