Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a server I have just restarted and verified which trace flag are active using DBCC TRACESTATUS:

enter image description here

Trace Flag : 3688 Function: Removes messages to errorlog about traces started and stopped

Here you can see what each trace flag does.

Flag 3688

The start parameters are as follows:

enter image description here

Question:

How can I find what the startup parameters of the SQL Server services are, through T-SQL?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

In SQL Server 2008 R2 SP1 or later, this is made considerably easier via the sys.dm_server_registry DMV:

SELECT
    DSR.registry_key,
    DSR.value_name,
    DSR.value_data
FROM sys.dm_server_registry AS DSR
WHERE 
    DSR.registry_key LIKE N'%MSSQLServer\Parameters';

From: An easier way to get SQL Server startup parameters

share|improve this answer
1  
Sorry I did not anticipated your post so posted same thing. –  Shanky 19 hours ago
    
@Shanky No problem. I think something about the formatting in the original blog missed out the `\` between MSSQLServer and Parameters though. –  Paul White 19 hours ago

If you are using 2008 R2 and above(I can see you tagged question as SQL Server 2014) you can use DMV sys.dm_server_registry to get all information about registry values for SQL Server.

Just go to SSMS and run below

select * from sys.dm_server_registry

If you want to filter out parameters related to SQL Server startup

SELECT r.registry_key, r.value_name, r.value_data
FROM sys.dm_server_registry r
WHERE r.registry_key LIKE N'%MSSQLServer\Parameters'

You can find similar blog related to what you were asking.

You can also use undocumented xp_reagread command

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.