How can I copy a table from a SQL Server to another?

212 Views Asked by At

I've set up 2 local SQL server databases, one on a laptop and the other on my desktop, I simply want to transfer the data my laptop gathers onto my desktop PC.

I've already managed to connect the 2 machines, from my desktop's SSMS I can see and query the laptop database. Now I only need to transfer the data from the laptpop Server to my desktop, I tried with a simple

SELECT * 
INTO [DesktopDB].[dbo].[TargetTable] 
FROM [LaptopIP].[LaptopDB].[dbo].[SourceTable]

But I get this error:

OLE DB provider "MSOLEDBSQL" for linked server "LaptopIP" returned message "Cannot generate SSPI context".
Msg -2146893042, Level 16, State 1, Line 0
SQL Server Network Interfaces: No credentials are available in the security package

Can you please help me address this issue? Thank you very much!

2

There are 2 best solutions below

0
David Browne - Microsoft On

For Windows auth to work between servers without a domain, your username and password must be the same on both servers.

0
Ekha On

You can connect remote sql server as Linked server, than insert data into local database table from linked server