Hot answers tagged

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 ...


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 #...



Only top voted, non community-wiki answers of a minimum length are eligible