Access parameterised queries upsizing to sql server

J

John

Hi

I am converting Access queries to work with SQL Server syntax as part of
upsizing process. I have several Access queries that use fields form Access
forms as parameters like below;

SELECT <field list>
FROM MyTable
WHERE MyTable.MyField1 = [Forms]![MyAccessForm]![MyField2]

How can I handle such queries in SQL Server context? A code example would be
much appreciated.

Many Thanks

Regards
 
U

Uri Dimant

John
DECLARE @par INT
SET @par=<value>

SELECT <field list>
FROM MyTable
WHERE MyTable.MyField1 = @par
 
A

Albert D. Kallal

John said:
Hi

I am converting Access queries to work with SQL Server syntax as part of
upsizing process. I have several Access queries that use fields form
Access forms as parameters like below;

SELECT <field list>
FROM MyTable
WHERE MyTable.MyField1 = [Forms]![MyAccessForm]![MyField2]

How can I handle such queries in SQL Server context? A code example would
be much appreciated.

If you using linked tables, then the above code does not need to be changed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top