Get command line to return name of database it installed

Packages and compresses schema and contents of SQL Server databases

Moderators: JonathanWatts, Chris Auckland, David Atkinson, david connell, Anu Deshpande, Michelle Taylor, james.billings, Marianne

Get command line to return name of database it installed

Postby jquevedo » Fri Sep 21, 2012 7:15 pm

I have an installer that I'm making that I'm allowing the user to rename the database when they run the packager exe file to create the database. However I later on need to know the name of the database they entered in the packager. Is there anyway to get it to return the name of the database it just installed?
jquevedo
 
Posts: 1
Joined: Fri Sep 21, 2012 7:12 pm

Postby Brian Donahue » Mon Sep 24, 2012 2:59 pm

I'm not sure what type of installer you are creating, but if it's a Windows Installer, there's probably an unsecured property inside your own MSI that you could re-use containing the database name.

SQL Packager packages do echo back the database name like this:
Creating Database: {0}
so if you can parse the output from the package, you could look for the text "Creating database:" and then parse for the next word - that should be the name of the new database you created with the /makedatabase switch.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am


Return to SQL Packager 6

Who is online

Users browsing this forum: No registered users and 0 guests