I'm playing around today with backup and restore for an SSIS package. My goal is to backup from my DEVELOPMENT instance from database 197 and restore that to my PRODUCTION instance OVERTOP of my PROD database.
On line I find several T-SQL scripts that kind of make sense, but I trust you guys (and gals) over Google any day (hehe)
Here's what I found...
RESTORE DATABASE Business_Data_TSQL
MOVE 'Business_Data' TO 'D:\TSQL\Business_Data.mdf',
MOVE 'Business_Data_log' TO 'D:\TSQL\Business_Data_log.ldf', STATS=5
This makes sense up to the MOVE section. I understand what the MOVE is doing, I'm just concerned about the DEVELOPMENT database being called 197 and PRODUCTION database being called PROD. Is it as simple as saying:
MOVE '197' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\PROD.mdf',
MOVE '197_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\PROD_Log.ldf'
Will that OVERWRITE the existing PROD.mdf and PROD_Log.ldf already in 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data'?
Thank you as always!