Guest User

Untitled

a guest
Nov 19th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. /***************************************************************************/
  2. /******************************TEST FOR ARITHABORT ON***********************/
  3. /***************************************************************************/
  4. DECLARE @options TABLE ([name] nvarchar(35), [minimum] int, [maximum] int, [config_value] int, [run_value] int);
  5.  
  6. INSERT INTO @options ([name], [minimum], [maximum], [config_value], [run_value])
  7. EXEC sp_configure 'user_options';
  8.  
  9. SELECT 'ARITHABORT ' + CASE WHEN ([config_value] & 64) = 64 THEN 'ON' ELSE 'OFF' END
  10. FROM @options;
  11.  
  12.  
  13. /***************************************************************************/
  14. /******************************SET ARITHABORT ON****************************/
  15. /***************************************************************************/
  16. -- NOTE: By enabling this at the instance level all .net clients will automatically start connecting with using SET ARITHABORT ON
  17.  
  18. DECLARE @options TABLE ([name] nvarchar(35), [minimum] int, [maximum] int, config_value] int, [run_value] int);
  19. DECLARE @Value INT;
  20.  
  21. INSERT INTO @options ([name], [minimum], [maximum], [config_value], [run_value])
  22. EXEC sp_configure 'user_options';
  23.  
  24. SELECT @Value = [config_value] | 64
  25. FROM @options;
  26.  
  27. EXEC sp_configure 'user_options', @Value;
  28. RECONFIGURE;
  29.  
  30. SELECT * FROM @options; -- prior state
  31. EXEC sp_configure 'user_options'; -- current state
  32.  
  33.  
  34. /***************************************************************************/
  35. /******************************SET ARITHABORT OFF***************************/
  36. /***************************************************************************/
  37.  
  38. DECLARE @options TABLE ([name] nvarchar(35), [minimum] int, [maximum] int, [config_value] int, [run_value] int);
  39. DECLARE @Value INT;
  40.  
  41. INSERT INTO @options ([name], [minimum], [maximum], [config_value], [run_value])
  42. EXEC sp_configure 'user_options';
  43.  
  44. SELECT @Value = [config_value] & ~64
  45. FROM @options;
  46.  
  47. EXEC sp_configure 'user_options', @Value;
  48. RECONFIGURE;
  49.  
  50. SELECT * FROM @options; -- prior state
  51. EXEC sp_configure 'user_options'; -- current state
Add Comment
Please, Sign In to add comment