Menu

Running SQLDOM on the server

2014-12-31
2014-12-31
  • Russell Shilling

    If you wish to run SQLDOM as a job on the server, there is different behavior than running on SSMS that must be compensated for. The default setting will truncate the results from the HTTP GET (and POST, I presume) at 512 characters.

    To compensate, add the following statement at the beginning of your batch:

    SET TEXTSIZE 2147483647;
    
     

    Last edit: Russell Shilling 2014-12-31
  • William Mercer Morris

    Russel;

    I am having this issue where only 512 bytes are being returned when I run the SQLDOM executing a Stored Procedure on SQL Agent. I have added the set TEXTSIZE before and I still am getting 512 bytes? It does not matter which website I retrieve the data from.

    SET TEXTSIZE 10000

    DECLARE @HTML varchar(MAX)

    EXEC master.[sdom].[sputilGetHTTP]
    --@URL = 'http://quotes.freerealtime.com/dl/frt/M?IM=stats&exch=O&stat=3',
    --@URL = 'http://www.finviz.com/',
    @URL = 'http://www.yahoo.com/',
    @ResponseText = @HTML OUTPUT,
    @SuppressResultset = 0

    <html id="atomic" lang="en-US" class="atomic my3columns l-out Pos-r https fp fp-v2 rc1 fp-default mini-uh-on viewer-right two-col ntk-wide ltr desktop Desktop bktCG004,fpdmcntrl,FP131,SR014"> <head> Yahoo<meta http-equiv="x-dns-prefetch-control" content="on"><link rel="dns-prefetch" href="//s.yimg.com"><link rel="preconnect" href="//s.yimg.com"><link rel="dns-prefetch" href="//search.yahoo.com"><link rel="preconnect" href="//search.yahoo.com">
     
  • William Mercer Morris

    The Bytes returned are always 512......Do you have any idea what I am doing wrong? When I execute the SP from MMS it returns the correct results, SQL Agent is it always 512. I am running SQL 2016

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.