Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

is it possible to change an instance server properties with T-SQL ? Expand / Collapse
Author
Message
Posted Monday, December 31, 2012 10:16 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, June 26, 2013 8:47 PM
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 ?
Post #1401431
Posted Monday, December 31, 2012 10:27 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, August 29, 2014 5:21 AM
Points: 197, Visits: 730
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.
Post #1401438
Posted Monday, December 31, 2012 3:05 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Friday, September 19, 2014 7:27 PM
Points: 7,107, Visits: 12,657
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
Post #1401514
Posted Tuesday, January 1, 2013 2:01 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, June 26, 2013 8:47 PM
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.
Post #1401563
Posted Tuesday, January 1, 2013 4:45 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Friday, September 19, 2014 7:27 PM
Points: 7,107, Visits: 12,657
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
Post #1401572
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse