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)
 Prompting for user input when running a sql script

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-05-21 : 07:41:52
Angela writes "I have written a MS SQL Server 2000 script that creates a database and all database objects. When creating the database, a location for the data and log files needs to be specified. Right now I have the location hard coded but I have been asked to change that so the user will be prompted for the desired file location when running the script. Thanks in advance for your help."

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2003-05-21 : 08:04:53
SQL is not a procedural language. You'll have to wrap your script with some sort of 3GL-type language that is capable of prompting a user for input.

Jay White
{0}
Go to Top of Page

dsdeming

479 Posts

Posted - 2003-05-21 : 08:34:46
One possibility is to make your script into a stored procedure which takes the desired user input as parameters. The user won't be prompted for them, but you will be able to accept and validate input.

HTH

Go to Top of Page

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2003-05-21 : 11:33:22
What are the users using for a front end?

Jim
Users <> Logic
Go to Top of Page
   

- Advertisement -