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)
 Parameters, from access sql to sql server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-10-07 : 07:10:39
Cronic writes "Hi, im new to sql server. I've done some basic sql through access such as select, update, insert statements. Ive recently learning how to do sql statements within sql server these days. The question i'm ask is how do i use parameters in sql?

eg. access style
SELECT CustomerID, FirstName, LastName
FROM CUSTOMER
WHERE CustomerID = [Enter Customer ID];

I'm trying to do something similar in sql server.

Thanks"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-10-07 : 07:14:24
Something like this

Declare @CustId varchar(20)

Set @CustId='Somevalue'

SELECT CustomerID, FirstName, LastName
FROM CUSTOMER
WHERE CustomerID = @CustId

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -