Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft SQL Server > Re: copying dat...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 10 Topic 10986 of 11517
Post > Topic >>

Re: copying data from one server to another

by imorxr@[EMAIL PROTECTED] May 14, 2008 at 11:25 PM

On May 15, 1:18 pm, imo...@[EMAIL PROTECTED]
 wrote:
> i have 2 server Server A and Server B.
> On Server A, I have table Stock :
>
> CREATE TABLE [dbo].[Stock] (
>         [Stock_Id] [int] IDENTITY (1, 1) NOT NULL
> ) ON [PRIMARY]
>
> On Server B, I have table Stock too:
> CREATE TABLE [dbo].[Stock] (
>         [Stock_Id] [int] IDENTITY (1, 1) NOT NULL
> ) ON [PRIMARY]
>
> i want copy from server A to Server B, using this :
>
> sp_dropserver 'mylink'
> go
>
> sp_addlinkedserver 'mylink', '', 'SQLOLEDB', NULL, NULL, 'DRIVER={SQL
> Server};SERVER=B02;UID=sa;PWD=QWERTY;'
> go
>
> exec sp_serveroption @[EMAIL PROTECTED]
'mylink', @[EMAIL PROTECTED]
'rpc out',
> @[EMAIL PROTECTED]
'true'
> go
>
> EXECUTE [mylink].[serverB].[dbo].[sp_executesql] N'SET IDENTITY_INSERT
> dbo.Stock ON
> INSERT INTO Tr_Stock (Stock_Id) SELECT Stock_Id FROM ( ???? i have
> active in remote server now ??? )Stock
> SET IDENTITY_INSERT dbo.Stock OFF'
>
> but i Still get error.
>
> I think, the problem is when using : EXECUTE [mylink].[serverB].[dbo].
> [sp_executesql] . How to execute insert ?

Sory, i have to remote from local server to remote
server, so i must using set identity on, before execute insert
command.

regards
 




 10 Posts in Topic:
copying data from one server to another
Guineapig1980@[EMAIL PROT  2008-04-22 06:11:12 
Re: copying data from one server to another
"Plamen Ratchev"  2008-04-22 09:49:52 
Re: copying data from one server to another
imorxr@[EMAIL PROTECTED]   2008-05-14 21:52:28 
Re: copying data from one server to another
"Plamen Ratchev"  2008-05-15 01:40:33 
Re: copying data from one server to another
Erland Sommarskog <esq  2008-05-16 20:04:24 
Re: copying data from one server to another
imorxr@[EMAIL PROTECTED]   2008-05-14 23:18:58 
Re: copying data from one server to another
imorxr@[EMAIL PROTECTED]   2008-05-14 23:25:58 
Re: copying data from one server to another
imorxr@[EMAIL PROTECTED]   2008-05-15 01:35:39 
Re: copying data from one server to another
"Plamen Ratchev"  2008-05-15 09:01:18 
Re: copying data from one server to another
imorxr@[EMAIL PROTECTED]   2008-05-15 20:06:59 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 22:08:41 CST 2008.