Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Please follow the scenario:
using C#
1) current database file name is DB20122013.
when user click on new year button
2)Create backup copy of current database
3)New database should create with all table(excluding table "Dailytemp" and "DailyMain") with data and database name as DB20132014.
Posted

First of all, i have no idea why to create another instance of database. Isn't enough space[^] to store all data together? In my opinion, it is bad practice.

If you still want to create database based on existing one, please, read this artcile: SQL Server Management Objects (SMO) Programming Guide[^] and all related articles.
 
Share this answer
 
Backup Stored Procedures in SQL Server[^]
SQL DB Backup[^]

Execute this procedure as per the scenario of the application.
 
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