Hello!

I want to use the following code

SELECT *
INTO Persons_Backup IN 'Backup.mdb'
FROM Persons

But all I ever get is the error message: "Incorrect syntax near IN"
How could I solve this?

But when I miss the IN clause, it works perfectly.
I think the problem is that I'm not connected to the second database, which I need to copy the data into. But how is it possible to be connected to two databases via one connection string?

Thank you very much!

try this

USE Persons;
GO
BACKUP DATABASE Persons
TO DISK = 'Z:\SQLServerBackups\Persons.Bak'
   WITH FORMAT,
      MEDIANAME = 'Z_SQLServerBackups',
      NAME = 'Full Backup of Persons';
GO
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.