SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


is it possible to change an instance server properties with T-SQL ?


is it possible to change an instance server properties with T-SQL ?

Author
Message
pooya1072
pooya1072
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 22
hi
can i change the properties of a server instance with T-SQL ...like Enabling mixed mode or change the name of server ?
WolfgangE
WolfgangE
SSC-Addicted
SSC-Addicted (479 reputation)SSC-Addicted (479 reputation)SSC-Addicted (479 reputation)SSC-Addicted (479 reputation)SSC-Addicted (479 reputation)SSC-Addicted (479 reputation)SSC-Addicted (479 reputation)SSC-Addicted (479 reputation)

Group: General Forum Members
Points: 479 Visits: 792
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.
Orlando Colamatteo
Orlando Colamatteo
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14901 Visits: 14396
pooya1072 (12/31/2012)
hi
can 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

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
pooya1072
pooya1072
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 22
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.
Orlando Colamatteo
Orlando Colamatteo
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14901 Visits: 14396
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search