December 31, 2012 at 10:16 am
hi
can i change the properties of a server instance with T-SQL ...like Enabling mixed mode or change the name of server ?
December 31, 2012 at 10:27 am
of course you can. Depends on what property or configuration you actually want to change.
Just to name an example, have a look at "sp_configure".
Changing the name of a sqlserver can be done using sp_dropserver and sp_addserver. Just google for it.
December 31, 2012 at 3:05 pm
pooya1072 (12/31/2012)
hican i change the properties of a server instance with T-SQL ...like Enabling mixed mode or change the name of server ?
Have you learned about the Script button in SSMS? It will help you to review what will actually be run against your instance to ensure you know what is happening as well as help you save the change for later use in production after you have tested the change in a non-produciton environment 😉
Personally I never apply changes using the GUI's OK button. I may make the configuration change in the GUI but then I will always script it to a query window using the Script button and then Cancel the GUI dialog. Then, after revieing the script generated by the GUI, if I agree with the code and want to make the change I will run the script.
Get script for every action in SQL Server Management Studio By Atif Shehzad[/url]
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
January 1, 2013 at 2:01 am
WolfgangE (12/31/2012)
of course you can. Depends on what property or configuration you actually want to change.Just to name an example, have a look at "sp_configure".
Changing the name of a sqlserver can be done using sp_dropserver and sp_addserver. Just google for it.
Have you learned about the Script button in SSMS? It will help you to review what will actually be run against your instance to ensure you know what is happening as well as help you save the change for later use in production after you have tested the change in a non-produciton environment
Personally I never apply changes using the GUI's OK button. I may make the configuration change in the GUI but then I will always script it to a query window using the Script button and then Cancel the GUI dialog. Then, after revieing the script generated by the GUI, if I agree with the code and want to make the change I will run the script.
Get script for every action in SQL Server Management Studio By Atif Shehzad
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.
January 1, 2013 at 4:45 am
pooya1072 (1/1/2013)
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.
No, unfortunately not. You could certainly stop the service using T-SQL but would then have no way to start it again because the service would then be down. If you had a second instance running you could accomplish it but if you need to automate things I would suggest it is best to manage service-level functions, like restarts, using a tool like PowerShell.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply