Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
next78
Starting Member
9 Posts |
Posted - 2008-06-27 : 16:12:43
|
| Hi,I need to copy a database and its tables using SMO (SQL Server Management Objects).How I can copy a database using Vb.net? I tried some examples but it only copies DB but not the tables...code examples:http://msdn.microsoft.com/en-us/library/ms162138.aspxhttp://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=862223&SiteID=17thanks in advance |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
next78
Starting Member
9 Posts |
Posted - 2008-06-28 : 06:19:54
|
| Yes, yesterday I tried to backup DB and restore with other name...but then I should create the .MDF and .LDF for this new DB. But to do these I should share this directory of the Server and I do not want.There has to be a way without having to share directories of the server |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-06-28 : 17:57:09
|
| You do not need to create the MDF or the LDF, and you do not need to create a share. The restore takes care of everything.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
|
next78
Starting Member
9 Posts |
Posted - 2008-06-29 : 06:41:18
|
| Nop, it displays an error if I restore the backup with other name.The file MYDB_Copy.LDF can not overwritten because is used by MYDBThe file MYDB_Copy.MDF can not overwritten because is used by MYDB |
 |
|
|
next78
Starting Member
9 Posts |
Posted - 2008-06-29 : 07:17:09
|
| If I create a backup backupDB.bak of the MyDB, and after I restore it, it runs ok. But If I try to restore a backup with a name different of the original, it displays error. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|