|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, May 28, 2013 9:33 AM
Points: 18,
Visits: 20
|
|
hi can i change the properties of a server instance with T-SQL ...like Enabling mixed mode or change the name of server ?
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: 2 days ago @ 11:51 PM
Points: 109,
Visits: 492
|
|
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.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 1:07 PM
Points: 6,826,
Visits: 11,951
|
|
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
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, May 28, 2013 9:33 AM
Points: 18,
Visits: 20
|
|
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.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 1:07 PM
Points: 6,826,
Visits: 11,951
|
|
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
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|