<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SQL stored procedure and passing today's date in User written code in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SQL-stored-procedure-and-passing-today-s-date-in-User-written/m-p/450446#M13896</link>
    <description>Not an SQL Server specialist, but if you are letting the stored procedure fix the date you'll probably get more accurate help in an SQL Server forum.&lt;BR /&gt;Have you successfully called it outside SAS?</description>
    <pubDate>Mon, 02 Apr 2018 19:41:07 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2018-04-02T19:41:07Z</dc:date>
    <item>
      <title>SQL stored procedure and passing today's date in User written code</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SQL-stored-procedure-and-passing-today-s-date-in-User-written/m-p/450430#M13895</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a DI Studio job with a User Written transformation where I'm calling a SQL stored procedure. I need to pass&amp;nbsp;today's date to the&amp;nbsp;stored procedure. My code is giving me this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: CLI execute error: [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'convert'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;connect to odbc ("dsn=SQL server Xxx; Trusted_Connection=yes; database=Xxxxxx");&lt;/P&gt;&lt;P&gt;execute (CCR_Rpt.spUpdate_Pers_Pref_Report @RunDate = convert(date, getdate())) by odbc;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What do I need to do to correctly pass today's date to the stored procedure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DI Studio 4.9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Apr 2018 18:56:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SQL-stored-procedure-and-passing-today-s-date-in-User-written/m-p/450430#M13895</guid>
      <dc:creator>kjarvis</dc:creator>
      <dc:date>2018-04-02T18:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: SQL stored procedure and passing today's date in User written code</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SQL-stored-procedure-and-passing-today-s-date-in-User-written/m-p/450446#M13896</link>
      <description>Not an SQL Server specialist, but if you are letting the stored procedure fix the date you'll probably get more accurate help in an SQL Server forum.&lt;BR /&gt;Have you successfully called it outside SAS?</description>
      <pubDate>Mon, 02 Apr 2018 19:41:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SQL-stored-procedure-and-passing-today-s-date-in-User-written/m-p/450446#M13896</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-04-02T19:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: SQL stored procedure and passing today's date in User written code</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SQL-stored-procedure-and-passing-today-s-date-in-User-written/m-p/450451#M13897</link>
      <description>&lt;P&gt;Linus - I have called several SPs via SAS successfully. This is the first time trying to use today's date for the parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 02 Apr 2018 20:03:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SQL-stored-procedure-and-passing-today-s-date-in-User-written/m-p/450451#M13897</guid>
      <dc:creator>kjarvis</dc:creator>
      <dc:date>2018-04-02T20:03:15Z</dc:date>
    </item>
  </channel>
</rss>

