I have two databases on the same SQL Server, and they have the same table structure. Database2010
is populated with data and Database2007
is empty.
I need to write a SQL statement that will copy the data from a table in Database2010
and insert it into the same table in Database2007
.
I'm thinking something like this:
insert into Database2007.dbo.tablename
([all the fieldnames])
select
[all the fieldnames]
FROM Database2010.dbo.tablename
How do I set permissions in SQL Server to let me access both databases like this?
I've read the other questions about multiple database queries but they were all syntax related, and each had something like "Of course you need to have your appropriate permissions in place for each database," or something like that. Where are those appropriate permissions?