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 to check programmatically if the SQL Server service needs restarting after series of changes in configuration.

Is there any indicator (e.g. in the system registry) that allows to obtain this information?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You can check for differences between value_in_use and value in sys.configurations for non dynamic changes.

Select * from sys.configurations
where value <> value_in_use and is_dynamic=0

to check for a changed logginmode

declare @tab table (name varchar(max),value varchar(max))
insert into @tab EXEC master.sys.xp_loginconfig 'login mode'
insert into @tab
SELECT 'current',CASE SERVERPROPERTY('IsIntegratedSecurityOnly')   
WHEN 1 THEN 'Windows NT Authentication'   
WHEN 0 THEN 'Mixed'   
END 

Select
CAST(
Case when (Select value from @tab where name='login mode')<>(Select value from @tab where name='current') 
then 1 else 0 end as bit) as loginconfig_changed 
share|improve this answer
    
That would be great solution if I wouldn't have to check if server authentication mode has changed :) Unfortunatelly that property isn't accessible through the sys.configurations view... –  Rav May 14 '13 at 12:13
    
@Rav did an edit –  bummi May 14 '13 at 12:44
    
That's it!! Thank you –  Rav May 14 '13 at 13:20

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.