Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE @advanced_options int
- DECLARE @xp_cmdshell int
- --CONVERT ( data_type [ ( length ) ] , expression [ , style ] )
- SELECT @advanced_options = value_in_use
- FROM sys.configurations
- WHERE name = 'show advanced options'
- SELECT @xp_cmdshell = value_in_use
- FROM sys.configurations
- WHERE name = 'xp_cmdshell'
- select @advanced_options as advOptions, @xp_cmdshell as cmdShell
- exec sp_configure 'show advanced options', 1;
- Reconfigure;
- EXEC sp_configure 'xp_CMDShell', 1;
- Reconfigure;
- DECLARE @CMDSQL VARCHAR(1000)
- SET @CMDSQL = 'F:AdressFillDBWithMSTabFiles'--Keep in mind, path needs to be correct.
- EXEC master..xp_CMDShell @CMDSQL
- EXEC sp_configure 'xp_CMDShell', @xp_cmdshell;
- Reconfigure;
- exec sp_configure 'show advanced options', @advanced_options;
- Reconfigure;
- select @advanced_options as advOptions, @xp_cmdshell as cmdShell
- Msg 257, Level 16, State 3, Line 4
- Implicit conversion from data type sql_variant to int is not allowed. Use the CONVERT function to run this query.
- Msg 257, Level 16, State 3, Line 8
- Implicit conversion from data type sql_variant to int is not allowed. Use the CONVERT function to run this query.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement