Execute VBS a partir de SQL

– Código: use [insert-db-name-here]go—-use below code to enable commands (required for xp_cmdshell to work)–exec sp_configure ‘show advanced options’, 1–go–reconfigure–go–exec sp_configure ‘xp_cmdshell’, 1 –go–reconfigure–go————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————if OBJECT_ID(‘vbsScripts’) is not null drop table vbsScriptsgocreate …

Continuar lendo

solte a restrição padrão na tabela

declare @table_name nvarchar(256) = ‘foo’, @col_name nvarchar(256) = ‘foocol’declare @Command nvarchar(1000)select @Command = ‘ALTER TABLE ‘ + @table_name + ‘ drop constraint ‘ + d.namefrom sys.tables t join sys.default_constraints d …

Continuar lendo