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 Queries

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-07-08 : 07:24:03
David writes "I am converting a Microsoft Access 2000 Database to Microsoft SQL 2000. However, I cannot get the queries to convert. The program is converting them to tables.

How do I create a query in SQL that will ask the user for the search parameters at run time. I can do this in Access without any trouble. (e.g. the criteria in Access would be [Enter the staff number to search for])

Thanking you in advance"

Stoad
Freaky Yak Linguist

1983 Posts

Posted - 2003-07-08 : 07:51:23
It's impossible. This trick is up to your front end
application, not SQL Server.

- Vit
Go to Top of Page

mr_mist
Grunnio

1870 Posts

Posted - 2003-07-08 : 08:16:15
You can set up a stored procedure such as

CREATE PROCEDURE dbo.test
@staffnumber int
AS
SELECT * from staff where staffnumber = @staffnumber

And you can then call that procedure passing a parameter to it that determines the staff number

dbo.test 123

for example

but you cannot get the query analyzer to ask for the number in a pop-up box. As the other poster said you would have to design a front end to do that bit.

-------
Moo.
Go to Top of Page
   

- Advertisement -