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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL-DMO problems

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-09-29 : 08:04:28
Luciano writes "How can obtain a dbName from a previous detached DB?.
I want to make an Attach program like Enterprise Manager does. (Enterprise Manager puts ATTACH AS: "previous dbName used" ; you can also put another name but I want to make it easier to the user )
Thanks,
Luciano"

nr
SQLTeam MVY

12543 Posts

Posted - 2003-09-29 : 15:24:56
It runs

dbcc checkprimaryfile (N'<FilePath>', 2)

which returns the databasename

If you use profiler you can see the commands that the attach database function in enterprise manager uses.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -