Advertisement
willianto

CleanString external OLE calls

Jun 18th, 2017
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 1.29 KB | None | 0 0
  1. /*
  2. sp_configure 'show advanced options', 1;  
  3. GO  
  4. RECONFIGURE;  
  5. GO  
  6. sp_configure 'Ole Automation Procedures', 1;  
  7. GO  
  8. */
  9.  
  10. declare @Check  char(1)
  11. Declare @Temp   char(1000)
  12. Declare @FResult   char(1000)
  13. Declare @Token  int
  14. Declare @Result char(1000)
  15.  
  16. Set @Temp = 'Four very different heroes, flung together by a single mystery — why is the Hand, now '
  17.             + 'under Daredevil''s leadership and operating out of the Hell''s Kitchen fortress known '
  18.             + 'as Shadowland, killing C-list mobsters and wiseguys?' + Char(13) + Char(13)
  19.             + 'As New York begins to turn on itself under the terrifying influence of Daredevil''s '
  20.             + 'new reign of martial law, Misty and her unlikely allies race to discover the truth — '
  21.             + 'does Daredevil know about these killings? What is their purpose? And can they be stopped?' + Char(13)
  22.             + 'The answers will lead all four heroes down the dark streets of Shadowland, filled with '
  23.             + 'violence, secrets, betrayal... and blood.'
  24.            
  25. Set @Check = 'e'
  26.  
  27. EXEC sp_OACreate 'CleanString.MyClass', @token OUTPUT
  28. EXEC @Result = sp_OAMethod @token, 'returnvalue', @FResult OUT, @Temp, @Check
  29.  
  30.  
  31. IF @Result <> 0  
  32. BEGIN  
  33.    EXEC sp_OAGetErrorInfo @token
  34.     EXEC sp_OADestroy @token
  35.     RETURN  
  36. END;
  37.  
  38.  
  39. EXEC sp_OADestroy @token
  40.  
  41. Print @FResult
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement