is it possible to change an instance server properties with T-SQL ? | SQL Server Performance Forums
SQL Server Performance Forum – Threads Archive
is it possible to change an instance server properties with T-SQL ?hi
can i change the properties of a server instance with T-SQL …like Enabling mixed mode or change the name of server ?
Sure you can do that , just you can use numerous T-SQL Queries which you can find out most of them easily by just selecting the needed option then you can tab the script button exists at the above of Server Properties to generate the relevant T-SQL Script like the below T-SQL Query used to change Degree parallelism EXEC sys.sp_configureN’max degree of parallelism’, N’4′
RECONFIGURE WITH OVERRIDE
GO And the below one used to enable mixed mode: EXEC xp_instance_regwriteN’HKEY_LOCAL_MACHINE’, N’Software\Microsoft\MSSQLServer\MSSQLServer’, N’AuditLevel’, REG_DWORD, 3
GO Please let me know if any further help is needed
thank you very very much….
can i use this to restart SQL service …like that i Right click on Server name and Choose Restart.i want do this in T-SQL.
For server restart , you should use xp_cmdshell SP to run the CMD prompt Net start SQLService name please let me know if any further help is needed