New answers tagged

0

You can get name of well-known sid https://support.microsoft.com/en-us/kb/243330 with powershell script $objSID = New-Object System.Security.Principal.SecurityIdentifier ("S-1-5-18") $objUser = $objSID.Translate( [System.Security.Principal.NTAccount]) $objUser.Value Is there any problems with giving MS Sql Server sysadmin role to 'NT AUTHORITY\SYSTEM' ...


4

You don't have to change the option every time. If you change the selection in Tools > Options > Object Explorer > Scripting, it should persist. As for why not scripting indexes is the default, I have no idea. Not a great question for your peers; if you really want the background, hit up someone on the SSMS team and buy them a beer - maybe they'll be able ...


1

I normally put the original values in temp table and then once done with the script/task, I revert it back. SET NOCOUNT ON; IF OBJECT_ID('tempdb..#xp_cmdshelloption') IS NOT NULL DROP TABLE #xp_cmdshelloption; CREATE TABLE #xp_cmdshelloption ( configuration_id INT ,NAME NVARCHAR(35) ,original_value SQL_VARIANT ) INSERT INTO #...


2

Error is at below select statements. If you do ALT+F1 on sys.confiugrations you'll notice that value_in_use column is of type sql_variant and you are trying to assign it to int variables. To fix this, use below statements in your script and it should work fine. SELECT @advanced_options = cast(value_in_use as int) FROM sys.configurations WHERE name = 'show ...



Top 50 recent answers are included