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.
| Author |
Topic |
|
shanmugaraj
Posting Yak Master
219 Posts |
Posted - 2010-10-28 : 02:52:05
|
| Hi EnviromentServerName - ServerA ServerName - ServerBDatabaseInsuranceInsuranceExisting Table in both servers and row countdbo.Policy Rows Count 10000dbo.Policy Rows Count 0I Need to copy data from ServerA to ServerB using SQL QueryI tryed the below QuerySelect * into ServerB.Insurance.dbo.Policy from ServerA.Insurance.dbo.Policy does not works :(Please helpThanks in AdvanceTHANKSSHANMUGARAJnshanmugaraj@gmail.com |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-10-28 : 02:55:15
|
| What did you mean by "dosn't work"? Have you setup a linked server?MadhivananFailing to plan is Planning to fail |
 |
|
|
shanmugaraj
Posting Yak Master
219 Posts |
Posted - 2010-10-28 : 03:32:34
|
| i have not set linked server.THANKSSHANMUGARAJnshanmugaraj@gmail.com |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-10-28 : 03:36:23
|
| Your "Existing Table in both servers and row count" implies that the Policy table already exists on ServerB, but is empty?If so you cannot use SELECT * INTO ... as that requires that the target table does NOT exist.If that is the case you can useINSERT INTO ServerB.Insurance.dbo.Policy Select * from ServerA.Insurance.dbo.Policy instead |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-10-28 : 03:37:19
|
"i have not set linked server."Well that will be the problem then! Read the DOCs on Linked Server, create one, then try again |
 |
|
|
|
|
|