Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Respected sir,
i m using vb.net as front end and sqlserver 2008 as backend for my windows application.
in which for every year i want to create new database with same name with year
for example 'dbname2013' now next year i want to copy whole database with data and rename this database to 'dbname2014'
Is it possible ?
how to do ?
Please help me..
Thank you..
Posted

1 solution

Hi,

You can achieve this by many ways giving one simple option

1. From Your .NET code or any code run Backup command for your current DB 2013 then SQL command will take backup of the database.
2. Once the backup is done run Restore command with new name DB2014.

Other than this you can use SMO object and play with the database http://technet.microsoft.com/en-us/library/ms162149.aspx[^]

I hope both the solution may help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900