Showing posts with label enter. Show all posts
Showing posts with label enter. Show all posts

Friday, March 23, 2012

Prompting for input from user using SQL Server 2000...

I know how to do it in Oracle.
ACCEPT <<variable>> PROMPT 'ENTER VARIABLE: '
How do you do it in SQL Server 2000?SQL Server cannot do this, as SQL Server executes entirely at the server
side. (I take it that you don't want to prompt to pop up on the server
machine?)
So, this has to be done my the client application. None of the tools that
comes with SQL Server has that feature, as they aren't designed to be
end-user tools not development packages.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Jonathan McKinney" <jonmckin@.nycap.rr.com> wrote in message
news:TEL2c.137059$%72.48338@.twister.nyroc.rr.com...
> I know how to do it in Oracle.
> ACCEPT <<variable>> PROMPT 'ENTER VARIABLE: '
> How do you do it in SQL Server 2000?
>|||Hi,
You do not have that kind of facility in SQL Server.
Thanks
Hari
MCDBA
"Jonathan McKinney" <jonmckin@.nycap.rr.com> wrote in message
news:TEL2c.137059$%72.48338@.twister.nyroc.rr.com...
> I know how to do it in Oracle.
> ACCEPT <<variable>> PROMPT 'ENTER VARIABLE: '
> How do you do it in SQL Server 2000?
>|||I want to create a procedure the I can run from Query Analyzer that prompts
the user for input and supplies it to the procedure.
Not a big deal, but the client can do it in Oracle and wonders why SQL
can't.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OOR%23rXIBEHA.2628@.TK2MSFTNGP11.phx.gbl...
> SQL Server cannot do this, as SQL Server executes entirely at the server
> side. (I take it that you don't want to prompt to pop up on the server
> machine?)
> So, this has to be done my the client application. None of the tools that
> comes with SQL Server has that feature, as they aren't designed to be
> end-user tools not development packages.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
>
> "Jonathan McKinney" <jonmckin@.nycap.rr.com> wrote in message
> news:TEL2c.137059$%72.48338@.twister.nyroc.rr.com...
>|||Hi,
In Query analyzer, Object browser window , right click above the procedure
name and select the debug option. This will ask you to enter the
input parameters of the procedure.
(It may not be same as you required, but allows you to take parameter
values.)
Thanks
Hari
MCDBA
"Jonathan McKinney" <jonmckin@.nycap.rr.com> wrote in message
news:GaM2c.137196$%72.44266@.twister.nyroc.rr.com...
> I want to create a procedure the I can run from Query Analyzer that
prompts
> the user for input and supplies it to the procedure.
> Not a big deal, but the client can do it in Oracle and wonders why SQL
> can't.
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> message news:OOR%23rXIBEHA.2628@.TK2MSFTNGP11.phx.gbl...
that
>

Prompting for input from user using SQL Server 2000...

I know how to do it in Oracle.
ACCEPT <<variable>> PROMPT 'ENTER VARIABLE: '
How do you do it in SQL Server 2000?SQL Server cannot do this, as SQL Server executes entirely at the server
side. (I take it that you don't want to prompt to pop up on the server
machine?)
So, this has to be done my the client application. None of the tools that
comes with SQL Server has that feature, as they aren't designed to be
end-user tools not development packages.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Jonathan McKinney" <jonmckin@.nycap.rr.com> wrote in message
news:TEL2c.137059$%72.48338@.twister.nyroc.rr.com...
> I know how to do it in Oracle.
> ACCEPT <<variable>> PROMPT 'ENTER VARIABLE: '
> How do you do it in SQL Server 2000?
>|||Hi,
You do not have that kind of facility in SQL Server.
Thanks
Hari
MCDBA
"Jonathan McKinney" <jonmckin@.nycap.rr.com> wrote in message
news:TEL2c.137059$%72.48338@.twister.nyroc.rr.com...
> I know how to do it in Oracle.
> ACCEPT <<variable>> PROMPT 'ENTER VARIABLE: '
> How do you do it in SQL Server 2000?
>|||I want to create a procedure the I can run from Query Analyzer that prompts
the user for input and supplies it to the procedure.
Not a big deal, but the client can do it in Oracle and wonders why SQL
can't.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OOR%23rXIBEHA.2628@.TK2MSFTNGP11.phx.gbl...
> SQL Server cannot do this, as SQL Server executes entirely at the server
> side. (I take it that you don't want to prompt to pop up on the server
> machine?)
> So, this has to be done my the client application. None of the tools that
> comes with SQL Server has that feature, as they aren't designed to be
> end-user tools not development packages.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
>
> "Jonathan McKinney" <jonmckin@.nycap.rr.com> wrote in message
> news:TEL2c.137059$%72.48338@.twister.nyroc.rr.com...
> > I know how to do it in Oracle.
> >
> > ACCEPT <<variable>> PROMPT 'ENTER VARIABLE: '
> >
> > How do you do it in SQL Server 2000?
> >
> >
>|||Hi,
In Query analyzer, Object browser window , right click above the procedure
name and select the debug option. This will ask you to enter the
input parameters of the procedure.
(It may not be same as you required, but allows you to take parameter
values.)
Thanks
Hari
MCDBA
"Jonathan McKinney" <jonmckin@.nycap.rr.com> wrote in message
news:GaM2c.137196$%72.44266@.twister.nyroc.rr.com...
> I want to create a procedure the I can run from Query Analyzer that
prompts
> the user for input and supplies it to the procedure.
> Not a big deal, but the client can do it in Oracle and wonders why SQL
> can't.
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> message news:OOR%23rXIBEHA.2628@.TK2MSFTNGP11.phx.gbl...
> > SQL Server cannot do this, as SQL Server executes entirely at the server
> > side. (I take it that you don't want to prompt to pop up on the server
> > machine?)
> > So, this has to be done my the client application. None of the tools
that
> > comes with SQL Server has that feature, as they aren't designed to be
> > end-user tools not development packages.
> >
> > --
> > Tibor Karaszi, SQL Server MVP
> > http://www.karaszi.com/sqlserver/default.asp
> >
> >
> > "Jonathan McKinney" <jonmckin@.nycap.rr.com> wrote in message
> > news:TEL2c.137059$%72.48338@.twister.nyroc.rr.com...
> > > I know how to do it in Oracle.
> > >
> > > ACCEPT <<variable>> PROMPT 'ENTER VARIABLE: '
> > >
> > > How do you do it in SQL Server 2000?
> > >
> > >
> >
> >
>

prompt for value

How do I prompt for a value in my SQL query for MS SQL Server 2000. Eventually I would like to enter the value in excel that passes it to a pivot table and then to the sql query.You need to have Excel prompt for the value. SQL Server doesn't permit interactive things within Transact-SQL.

-PatP

Prompt for user input in criteria field of view

In Access, I use [Enter Date] in the Criteria field of the Query. I tried the same thing in SQL Server in the Criteria field of the View and it does not recognize this. Is there a comparable command in SQL to get user input into the Criteria field of a view?

Hi,

you either have to use a procedure with an input parameter or have to put a condition on the query with querying the view with:

Select * from SomeView Where SomeColumn = 'SomeValue'

But there is no GUI on SQL Server.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||MSSQL as service prompts you nothing. You have to write client application to be prompted.|||

Hi Jens,

I was able to find out how to do what I needed using the @. sign (i.e. @.Date Required?). In the criteria field of the SQL view, this generates a 'Date Required?' prompt box when running the view.

Thanks anyway!

Ernie

sql

Wednesday, March 21, 2012

Prompt for a database name

Hi,
Is there a way to prompt someone to enter a database name in a script? For
example, I have a script where I need to update a table to set a column with
a value found in another table in another database. We don't know exactly
what the actual db name is of where to find the table and we would like, in
the script, to be able to allow the user enter the db name so that we can do
the update correctly. We don't want to have the user to manually update
script to specify the db name in the update statement, but rather prompt them
for the name so that we can do the update for them.
Thanks in advance,
DeeSQL Server cannot prompt, it is a service running on a server machine. The client app can. What
app/tool are you using? SQLCMD, OSQL, SSMS, QA, something else?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"bpdee" <bpdee@.discussions.microsoft.com> wrote in message
news:130AABB7-8F8B-4F47-8A27-119F022F49F3@.microsoft.com...
> Hi,
> Is there a way to prompt someone to enter a database name in a script? For
> example, I have a script where I need to update a table to set a column with
> a value found in another table in another database. We don't know exactly
> what the actual db name is of where to find the table and we would like, in
> the script, to be able to allow the user enter the db name so that we can do
> the update correctly. We don't want to have the user to manually update
> script to specify the db name in the update statement, but rather prompt them
> for the name so that we can do the update for them.
> Thanks in advance,
> Dee|||Hi Tibor,
We're using Query Analyzer. When we upgrade a customer's database for db
changes, we actually create a script where we have them run it manually via
Query Analyzer.
Thanks!
Dee
"Tibor Karaszi" wrote:
> SQL Server cannot prompt, it is a service running on a server machine. The client app can. What
> app/tool are you using? SQLCMD, OSQL, SSMS, QA, something else?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "bpdee" <bpdee@.discussions.microsoft.com> wrote in message
> news:130AABB7-8F8B-4F47-8A27-119F022F49F3@.microsoft.com...
> > Hi,
> >
> > Is there a way to prompt someone to enter a database name in a script? For
> > example, I have a script where I need to update a table to set a column with
> > a value found in another table in another database. We don't know exactly
> > what the actual db name is of where to find the table and we would like, in
> > the script, to be able to allow the user enter the db name so that we can do
> > the update correctly. We don't want to have the user to manually update
> > script to specify the db name in the update statement, but rather prompt them
> > for the name so that we can do the update for them.
> >
> > Thanks in advance,
> > Dee
>|||I see. QA has no prompting abilities. In fact, none of the tools that comes with SQL Server has
such. SQLCMD (comes with 2005, you can also download it), has a command-line option for specifying
values for variables (defined inside the script file). Check out -v and $(varname). If you need true
prompting, you have to write some app that pops up the prompt and runs what you have in the script
file.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"bpdee" <bpdee@.discussions.microsoft.com> wrote in message
news:E6CD55B3-3550-4B9E-B45B-3BE7A81132BD@.microsoft.com...
> Hi Tibor,
> We're using Query Analyzer. When we upgrade a customer's database for db
> changes, we actually create a script where we have them run it manually via
> Query Analyzer.
> Thanks!
> Dee
> "Tibor Karaszi" wrote:
>> SQL Server cannot prompt, it is a service running on a server machine. The client app can. What
>> app/tool are you using? SQLCMD, OSQL, SSMS, QA, something else?
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "bpdee" <bpdee@.discussions.microsoft.com> wrote in message
>> news:130AABB7-8F8B-4F47-8A27-119F022F49F3@.microsoft.com...
>> > Hi,
>> >
>> > Is there a way to prompt someone to enter a database name in a script? For
>> > example, I have a script where I need to update a table to set a column with
>> > a value found in another table in another database. We don't know exactly
>> > what the actual db name is of where to find the table and we would like, in
>> > the script, to be able to allow the user enter the db name so that we can do
>> > the update correctly. We don't want to have the user to manually update
>> > script to specify the db name in the update statement, but rather prompt them
>> > for the name so that we can do the update for them.
>> >
>> > Thanks in advance,
>> > Dee
>>

Prompt for a database name

Hi,
Is there a way to prompt someone to enter a database name in a script? For
example, I have a script where I need to update a table to set a column with
a value found in another table in another database. We don't know exactly
what the actual db name is of where to find the table and we would like, in
the script, to be able to allow the user enter the db name so that we can do
the update correctly. We don't want to have the user to manually update
script to specify the db name in the update statement, but rather prompt the
m
for the name so that we can do the update for them.
Thanks in advance,
DeeSQL Server cannot prompt, it is a service running on a server machine. The c
lient app can. What
app/tool are you using? SQLCMD, OSQL, SSMS, QA, something else?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"bpdee" <bpdee@.discussions.microsoft.com> wrote in message
news:130AABB7-8F8B-4F47-8A27-119F022F49F3@.microsoft.com...
> Hi,
> Is there a way to prompt someone to enter a database name in a script? Fo
r
> example, I have a script where I need to update a table to set a column wi
th
> a value found in another table in another database. We don't know exactly
> what the actual db name is of where to find the table and we would like, i
n
> the script, to be able to allow the user enter the db name so that we can
do
> the update correctly. We don't want to have the user to manually update
> script to specify the db name in the update statement, but rather prompt t
hem
> for the name so that we can do the update for them.
> Thanks in advance,
> Dee|||Hi Tibor,
We're using Query Analyzer. When we upgrade a customer's database for db
changes, we actually create a script where we have them run it manually via
Query Analyzer.
Thanks!
Dee
"Tibor Karaszi" wrote:

> SQL Server cannot prompt, it is a service running on a server machine. The
client app can. What
> app/tool are you using? SQLCMD, OSQL, SSMS, QA, something else?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "bpdee" <bpdee@.discussions.microsoft.com> wrote in message
> news:130AABB7-8F8B-4F47-8A27-119F022F49F3@.microsoft.com...
>|||I see. QA has no prompting abilities. In fact, none of the tools that comes
with SQL Server has
such. SQLCMD (comes with 2005, you can also download it), has a command-line
option for specifying
values for variables (defined inside the script file). Check out -v and $(va
rname). If you need true
prompting, you have to write some app that pops up the prompt and runs what
you have in the script
file.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"bpdee" <bpdee@.discussions.microsoft.com> wrote in message
news:E6CD55B3-3550-4B9E-B45B-3BE7A81132BD@.microsoft.com...[vbcol=seagreen]
> Hi Tibor,
> We're using Query Analyzer. When we upgrade a customer's database for db
> changes, we actually create a script where we have them run it manually vi
a
> Query Analyzer.
> Thanks!
> Dee
> "Tibor Karaszi" wrote:
>|||555

Prompt for a database name

Hi,
Is there a way to prompt someone to enter a database name in a script? For
example, I have a script where I need to update a table to set a column with
a value found in another table in another database. We don't know exactly
what the actual db name is of where to find the table and we would like, in
the script, to be able to allow the user enter the db name so that we can do
the update correctly. We don't want to have the user to manually update
script to specify the db name in the update statement, but rather prompt them
for the name so that we can do the update for them.
Thanks in advance,
Dee
Hi Tibor,
We're using Query Analyzer. When we upgrade a customer's database for db
changes, we actually create a script where we have them run it manually via
Query Analyzer.
Thanks!
Dee
"Tibor Karaszi" wrote:

> SQL Server cannot prompt, it is a service running on a server machine. The client app can. What
> app/tool are you using? SQLCMD, OSQL, SSMS, QA, something else?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "bpdee" <bpdee@.discussions.microsoft.com> wrote in message
> news:130AABB7-8F8B-4F47-8A27-119F022F49F3@.microsoft.com...
>