How do I make a copy of an SQL Server database and connect to it?
问题 I'm working on vb.NET 2013 and SQL server 2008R2. I have this situation to resolve: I have a database "DB1". I want to create a copy of this database on the same SQL server with another name "DB2", and after make this database ready to connect. How can I do this through code from Vb.NET? 回答1: Check out this tech net link for restore with new file names. http://technet.microsoft.com/en-us/library/ms190447(v=sql.105).aspx. Take a backup of database one (DB1). Verify backup is valid. Get correct