chupa chups
Сообщений: 3
Оценки: 0
Присоединился: 2008-02-08 09:40:31.406666
|
analogue xp_cmdshell замена для xp_cmdshell ——————————————————————— Windows 2000: need Windows Script 5.6 for Windows XP and Windows 2000 Windows 2003: included ——————————————————————— MSSQL2000 : nothing, Ole Automation Procedures enabled MSSQL2005 : sp_configure 'show advanced options', 1; GO RECONFIGURE; GO sp_configure 'Ole Automation Procedures', 1; GO RECONFIGURE; GO MSSQL2008 : http://msdn2.microsoft.com/en-us/library/ms191188(SQL.100).aspx sp_configure 'show advanced options', 1; GO RECONFIGURE; GO sp_configure 'Ole Automation Procedures', 1; GO RECONFIGURE; GO ——————————————————————— declare @iShl int, @iStm int, @iStdOut int, @hr int, @EndOfStream int, @strText nvarchar(4000), @cmd nvarchar(4000) set @cmd = 'Exec("cmd /c ping -n 3 -w 1000 127.0.0.1")' EXEC @hr = sp_OACreate 'Wscript.Shell', @iShl out EXEC @hr = sp_OAMethod @iShl, @cmd, @iStm out EXEC @hr = sp_OAGetProperty @iStm, 'StdOut', @iStdOut out EXEC @hr = sp_OAGetProperty @iStdOut, 'AtEndOfStream', @EndOfStream out WHILE @EndOfStream = 0 BEGIN EXEC @hr = sp_OAGetProperty @iStdOut, 'ReadLine', @strText out print @strText EXEC @hr = sp_OAGetProperty @iStdOut, 'AtEndOfStream', @EndOfStream out END EXEC @hr = sp_OADestroy @iShl ——————————————————————— Keywords: xp_cmdshell, faq, howto, problem, error, alternative, command line, cmd проблема, как обойти, ошибка ——————————————————————— P.S. В топике с данным кодом на sql.ru вначале была спровоцирована ругань, а потом они были забанены. Повторно заведенный топик (через несколько дней) был забанен сразу. http://sql.ru/forum/actualthread.aspx?tid=520767 http://sql.ru/forum/actualthread.aspx?tid=523744
|