February 16, 2011 at 6:52 am
I have Generated Script to Create DATABASE .
The problem I have got now is , instead of creating the DATA File & Log File to the Default Directory (C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA) i need a prompt to appear so that i can specify the directory for creating the database.
I also need a prompt to appear wherein i can specify the user name & password.
Please help!!
February 16, 2011 at 7:27 am
the default directory can be different on every machine.
take a look at the filepaths from this view:
select * from master.sys.sysaltfiles
TSQL does not have any ability to raise a prompt. technically,
neither does Oracle for example, but all the tools (SQLPLus,Toad) interpret certain commands to be prompts. None of the SQL tools natively do that.
You'll want to either create an executable which prompts for connection information, variables, and provides them to the script, or provide the values from an ini or config file, or read the values for the path from the existing data in the database.
Lowell
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply