Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 link server insert

Author  Topic 

hai
Yak Posting Veteran

84 Posts

Posted - 2011-01-21 : 23:11:08
I'm working with linkedserver, and insert record. This work:

INSERT INTO MY_inkedserver.database_name.schema_name.remote_table (name, num, email, ssn)
SELECT name, num, email, ssn
FROM local_table

However, I have hard time with this: - insert into new table:

SELECT name, num, email, ssn into MY_inkedserver.database_name.schema_name.new_remote_table
FROM local_table

Am I doing this the right way?

thanks

namman
Constraint Violating Yak Guru

285 Posts

Posted - 2011-01-21 : 23:49:39
quote:
However, I have hard time with this: - insert into new table:

SELECT name, num, email, ssn into MY_inkedserver.database_name.schema_name.new_remote_table
FROM local_table

Am I doing this the right way?


We can not run a DDL with linked server. Your sql is to create a new table on the remote server, then load data into it from local server.
Go to Top of Page
   

- Advertisement -