Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplicateing the first function in Access

Status
Not open for further replies.

DKamadulski

Programmer
Jul 12, 2001
1
US
I have converted an Access database and need to duplicate one of the queries in T-SQL. The query in question is useing the Access First function, is there a similar function in T-SQL? Or a bit of code I could write that does not use temp tables and cursors?
 

First does not exist in SQL Server. It is not an ANSI standard function. There is no sure way to reproduce the FIRST function in SQL Server. Depending on the data and the requirement, you might be able to accomplish the same thing with a TOP 1 query or SET ROWCOUNT 1. In some cases you can use MIN as an equivalent. But there are no guarantees that you will get the same result with any of these techniques because SQL and the relational model don't guarantee the order of rows. Terry Broadbent
Please review faq183-874.

"The greatest obstacle to discovery is not ignorance -- it is the illusion of knowledge." - Daniel J Boorstin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top