Showing posts with label accept. Show all posts
Showing posts with label accept. Show all posts

Sunday, March 11, 2012

accept user from user to enter a field value for a sql

Hi-

I am trying to achieve a similar query in ORACLE but donno how to do it in Ms SQL Server and MS Access (I have to do it for both these databases)

SELECT * FROM someTable
WHERE someField = &EnterValue

When this query is executed in ORACLE, it will ask user to enter value for &EnterValue and then execute the query using the user entered value.

Can this be done in MS SQL Server and MS ACCESS?

Please help...

ThanksHi-

Found the answer for MsAccess, I need to enter =[EnterValue] in Criteria for a given column.

Still looking for answer for MS SQL Server. Is Stored Proc the only answer?

Please help...

Best Wishes,|||SQL Server will not prompt the user for a parameter value. It needs to be supplied.

It is normally done like this:


SELECT * FROM someTable
WHERE someField = @.someValue

and Parameters are used to provide the query with the parameter value that the user has input from a data entry screen. You do not necessarily need a stored procedure to accomplish this (although I believe that is the best way).

Check out the ASP.NET tutorialServer-Side Data Access, especially the "Performing a Parameterized Select" section, to see how to use Parameters with ADO.NET.

Terri

Accept Multiple Values

Hi ,
Is it possible to declare a variable to accept mutiple values at a time ?
for example :
Declare @.Country char(100)
Set @.country = 'TH','MY'
"Travis" <Travis@.discussions.microsoft.com> wrote in message
news:DF03833A-4A65-4969-A661-D98DCB859489@.microsoft.com...
> Hi ,
> Is it possible to declare a variable to accept mutiple values at a time
> ?
> for example :
> Declare @.Country char(100)
> Set @.country = 'TH','MY'
>
No arrays in SQL Server. What are you trying to do? Maybe this will help:
http://www.sommarskog.se/arrays-in-sql.html
David Portas
SQL Server MVP
|||Do not think there are arrays you can use fixed length , delimited or
XML
Regards ,
C#, VB.NET , SQL SERVER , UML , DESIGN Patterns Interview question book
http://www.geocities.com/dotnetinterviews/
My Interview Blog
http://spaces.msn.com/members/dotnetinterviews/

Accept Multiple Values

Hi ,
Is it possible to declare a variable to accept mutiple values at a time ?
for example :
Declare @.Country char(100)
Set @.country = 'TH','MY'"Travis" <Travis@.discussions.microsoft.com> wrote in message
news:DF03833A-4A65-4969-A661-D98DCB859489@.microsoft.com...
> Hi ,
> Is it possible to declare a variable to accept mutiple values at a time
> ?
> for example :
> Declare @.Country char(100)
> Set @.country = 'TH','MY'
>
No arrays in SQL Server. What are you trying to do? Maybe this will help:
http://www.sommarskog.se/arrays-in-sql.html
--
David Portas
SQL Server MVP
--|||Do not think there are arrays you can use fixed length , delimited or
XML
--
Regards ,
C#, VB.NET , SQL SERVER , UML , DESIGN Patterns Interview question book
http://www.geocities.com/dotnetinterviews/
My Interview Blog
http://spaces.msn.com/members/dotnetinterviews/

Accept Multiple Values

Hi ,
Is it possible to declare a variable to accept mutiple values at a time ?
for example :
Declare @.Country char(100)
Set @.country = 'TH','MY'"Travis" <Travis@.discussions.microsoft.com> wrote in message
news:DF03833A-4A65-4969-A661-D98DCB859489@.microsoft.com...
> Hi ,
> Is it possible to declare a variable to accept mutiple values at a time
> ?
> for example :
> Declare @.Country char(100)
> Set @.country = 'TH','MY'
>
No arrays in SQL Server. What are you trying to do? Maybe this will help:
http://www.sommarskog.se/arrays-in-sql.html
David Portas
SQL Server MVP
--|||Do not think there are arrays you can use fixed length , delimited or
XML
--
Regards ,
C#, VB.NET , SQL SERVER , UML , DESIGN Patterns Interview question book
http://www.geocities.com/dotnetinterviews/
My Interview Blog
http://spaces.msn.com/members/dotnetinterviews/

accept all directory in sql query analizer

Well I try to find why I can not run dtsrun with xp_cmdschell
but I try to put all the directory c:\program files\microsoft SQL\...
and the procedure response that he dont find c:\program command
is there a instruccion for the large names on directories that make
the correct functionality of the path?

Regards. Mirtha.I use double-quoted names in other places, maybe it works here... also, as a turn around you can use the ~ short names form.
Hope it helps,
Csar|||There is a convention for shortening a long name to an 8.3 convention but I find it hard to remember.

You can just put your pathname and executable in double quotes, i.e. "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\bcp.exe"|||Originally posted by Cesar Fraustro
I use double-quoted names in other places, maybe it works here... also, as a turn around you can use the ~ short names form.
Hope it helps,
Csar
Yes , I do but it does not work. thanks.|||Originally posted by Paul Young
There is a convention for shortening a long name to an 8.3 convention but I find it hard to remember.

You can just put your pathname and executable in double quotes, i.e. "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\bcp.exe"

Yes it works, thanks and regards.