0

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!

Dale K
  • 25,246
  • 15
  • 42
  • 71
9879ypxkj
  • 387
  • 5
  • 15
  • 5
    It seems you're trying to pass your Windows Credentials to the other SQL Server; do you have a domain at home? If not, you'll want to configure the linked servers to use SQL Authentication. – Thom A Dec 07 '21 at 21:59
  • 2
    You can transfer data two ways: 1. take a backup of your database on the laptop, copy the backup file and restore it on your desktop. This will copy the entire database as it was at the time of backup. 2. What you are doing: establish a linked server. I suggest you use SQL Server server credentials (instead of Windows authentication) for this as it is easier to set-up in the absence of a Windows domain. – Alex Dec 07 '21 at 23:03
  • Thank you very much, your solution worked fine. You were right. – 9879ypxkj Dec 08 '21 at 14:57

2 Answers2

2

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

David Browne - Microsoft
  • 80,331
  • 6
  • 39
  • 67
0

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

Ekha
  • 24
  • 3