Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All


SQL Server 2000

Returns the offset (position relative to the start of a statement) of specified keywords in Transact-SQL statements to DB-Library applications.


SET OFFSETS keyword_list



Is a comma-separated list of Transact-SQL constructs including SELECT, FROM, ORDER, COMPUTE, TABLE, PROCEDURE, STATEMENT, PARAM, and EXECUTE.


SET OFFSETS is used only in DB-Library applications.

The setting of SET OFFSETS is set at parse time and not at execute time or run time. Setting at parse time means that if the SET statement is present in the batch or stored procedure, it takes effect, regardless of whether code execution actually reaches that point; and the SET statement takes effect before any statements are executed. For example, even if the set statement is in an IF...ELSE statement block that is never reached during execution, the SET statement still takes effect because the IF...ELSE statement block is parsed.

If SET OFFSETS is set in a stored procedure, the value of SET OFFSETS is restored after control is returned from the stored procedure. Therefore, a SET OFFSETS statement specified in dynamic SQL does not have any effect on any statements following the dynamic SQL statement.


SET OFFSETS permissions default to all users.

See Also



Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft