Thinking outside the box

Patron Saint of Lost Yaks
posts - 203, comments - 734, trackbacks - 4

My Links

Advertisement

News

Archives

Post Categories

How to get current connection settings

SELECT  name AS Setting,
        CASE
            WHEN @@OPTIONS & number = number THEN 'ON'
            ELSE 'OFF'
        END AS Value
FROM    master..spt_values
WHERE   type = 'SOP'
        AND number > 0

Or this

SELECT  *
FROM    sys.dm_exec_sessions
WHERE   session_id = @@SPID

Or this

SELECT  *
FROM    sys.dm_exec_request
WHERE   session_id = @@SPID

Print | posted on Saturday, March 20, 2010 9:53 PM | Filed Under [ SQL Server 2008 Administration SQL Server 2005 SQL Server 2000 ]

Feedback

Gravatar

# re: How to get current connection settings

Yep simple, multi-alternative and nice script!
3/20/2010 11:16 PM | Dugi
Gravatar

# re: How to get current connection settings

Tiny correction
You will need to plualize:

Select * from sys.dm_exec_requestS
WHERE session_id = @@SPID

Notice the S at the end of the table name
3/21/2010 8:45 AM | Paul Wehland
Gravatar

# re: How to get current connection settings

Ace solutions.

Just a note for people who are still on sql server 2000, only the 1st one will work.
3/29/2010 3:48 PM | Rajen Shah
Gravatar

# re: How to get current connection settings

DBCC USEROPTIONS
3/30/2010 4:38 PM | Adam Machanic
Gravatar

# re: How to get current connection settings

I recently had a problem on my computer and it seemed that my whole system crashed. I created a new ip and now it seems that my pc is brand new! Thanks for the help!
3/9/2011 12:21 AM | Called.com
Gravatar

# re: How to get current connection settings

I managed to solve my problem thanks to you and Rajen who commented above. He said the only the first one will work but i didn't see it at first and messed it up.
6/16/2011 4:31 AM | EasyHairLossPrevention.com
Comments have been closed on this topic.

Powered by:
Powered By Subtext Powered By ASP.NET