On May 15, 12:40 pm, "Plamen Ratchev" <Pla...@[EMAIL PROTECTED]
> wrote:
> If you can set up a linked server the other way around (from your remote
> server to the local server), then executing the query on the remote
server
> will have no problems setting IDENTITY_INSERT ON. The option cannot be
set
> permanently and it has to be set in the same session as the INSERT
> statement.
>
> Alternative is to use BCP or Bulk Insert to insert the data which have
> option to keep identity.
>
> HTH,
>
> Plamen Ratchevhttp://www.SQLStudio.com
Dear Mr Plamen,
I can not set up a linked server the other way around (from your
remote
server to the local server).
Now, i want try using Bulk Insert the data which have option to keep
identity, but
my problem is, i can't access data from local server cause i have
ready come in to
remote server.
before, i just want execute :
INSERT INTO mylink.serverB.dbo.Tr_Stock (Stock_Id) SELECT Stock_Id
FROM Stock
coz i just 1 option to execute identity_insert using :
EXECUTE [mylink].[serverB].[dbo].[sp_executesql] N'SET IDENTITY_INSERT
dbo.Stock ON
, so now i cant using this again : INSERT INTO
mylink.serverB.dbo.Tr_Stock (Stock_Id) SELECT Stock_Id FROM Stock
Regards,
Thanks


|