Tuesday, February 14, 2012

DBLookup in SQL Server

MS Access has a very udeful fiunction called DBLookup.

It takes 4 parameters: a column, a table, an IDField and an IDValue.

It essentially runs this as a select statement and returns a single value from a database.

Is there an equivalent in SQL Server or .NET 2.0?

Is there a way to write this as a Stored Procedure without granting select permissions on the tables?

Thanks

Take a look at ExecuteScalar in the ADO.NET classes.

No comments:

Post a Comment