Why m i getting error incorrect syntax near the keyword IN in the following query?
select * into persons_backup IN 'HRMS.mdb' from persons
Thank you
Assuming SQL Server (based on your previous question) you would need
select *
into persons_backup
from HRMS.mdb.persons
or
select *
into HRMS.mdb.persons_backup
from persons
dependant upon what you are trying to do exactly. See SELECT ... INTO syntax here
HRMS.mdb.persons is ih the format databasename.schemaname.tablename If you don't have a schema called mdb then what are you trying to do exactly? To SELECT ... INTO a table in your default schema just use select * into persons_backup from persons.mdb If there is no such schema? You need to create this schema or use a different existing one. e.g. select * into HRMS.dbo.persons_backup from personsAssuming you want to add all rows from persons into another table persons_backup:
Insert into persons_backup select * from persons;
Depending on the RDBMS you use, you might have to put () around the select.