<?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: Pass Through SQL Select Into ? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187057#M47495</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, DBailey!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried again using your code (exactly as you typed) and I got this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLI execute error: [Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name 'cust_data'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The cust_data&amp;nbsp; dataset exits.&amp;nbsp; Not sure why it doesn't like it.&amp;nbsp; Any suggestions?&amp;nbsp; Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Jan 2014 21:42:50 GMT</pubDate>
    <dc:creator>KevinC_</dc:creator>
    <dc:date>2014-01-02T21:42:50Z</dc:date>
    <item>
      <title>Pass Through SQL to Append/Update a SQL Server Table?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187052#M47490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use pass through SQL to append new data to an existing SQL Server table.&amp;nbsp; I get this error pointing to the libname reference devsrv: "Expecting a : .".&amp;nbsp; I use the same libname reference when I create tables on the same server and and it has always worked.&amp;nbsp; I suspect the error is caused by something else in my code.&amp;nbsp; Does anyone have any suggestions?&amp;nbsp; Any input would be greatly appreciated.&amp;nbsp; Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Libname devsrv ODBC DSN="SERV1" schema=dbo;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect to odbc(dsn="SERV1");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into devsrv.cust_table1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from cust_data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; disconnect from odbc;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 21:06:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187052#M47490</guid>
      <dc:creator>KevinC_</dc:creator>
      <dc:date>2014-01-02T21:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Through SQL Select Into ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187053#M47491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Libname devsrv ODBC DSN="SERV1" schema=dbo;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table devsrv.cust_table1 as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from cust_data;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 21:22:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187053#M47491</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2014-01-02T21:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Through SQL Select Into ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187054#M47492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure exactly what you are trying to accomplish, but I've used the into: to create a macro variable in PROC SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;select max(order_date) into: most_recent_shipment&lt;/P&gt;&lt;P&gt;from cust_data&lt;/P&gt;&lt;P&gt;where ship_ind = 1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;create table late_ship as&lt;/P&gt;&lt;P&gt;select order_id&lt;/P&gt;&lt;P&gt;from order_table&lt;/P&gt;&lt;P&gt;where ship_ind = 0&lt;/P&gt;&lt;P&gt;and order_date &amp;lt; &amp;amp;most_recent_shipment;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 21:22:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187054#M47492</guid>
      <dc:creator>GlenGold</dc:creator>
      <dc:date>2014-01-02T21:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Through SQL Select Into ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187055#M47493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS SQL instruction &lt;STRONG&gt;into&lt;/STRONG&gt; is attempting to place the data into a SAS macro variable which should be indicated by the : .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 21:24:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187055#M47493</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-01-02T21:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Through SQL Select Into ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187056#M47494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;reread your question...try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect to odbc(dsn="SERV1");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; execute (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into cust_table1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from cust_data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) by odbc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; disconnect from odbc;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 21:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187056#M47494</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2014-01-02T21:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Through SQL Select Into ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187057#M47495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, DBailey!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried again using your code (exactly as you typed) and I got this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLI execute error: [Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name 'cust_data'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The cust_data&amp;nbsp; dataset exits.&amp;nbsp; Not sure why it doesn't like it.&amp;nbsp; Any suggestions?&amp;nbsp; Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 21:42:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187057#M47495</guid>
      <dc:creator>KevinC_</dc:creator>
      <dc:date>2014-01-02T21:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Through SQL Select Into ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187058#M47496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, this is becoming a bit SQL Server specific question.&lt;/P&gt;&lt;P&gt;But to read your question again, by doing select into in SQL Server. it means that you are creating a table based on the structure in the select statement.&lt;/P&gt;&lt;P&gt;So in your case, your query fails because the table already exists (or does it exist within SQL Server?).&lt;/P&gt;&lt;P&gt;But you said you wish to insert data into your table, then you need to use the insert into construct instead/as well.&lt;/P&gt;&lt;P&gt;If your table cust_data resides in SAS, you can't use explicit pass-thru.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 22:07:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187058#M47496</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-01-02T22:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Through SQL Select Into ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187059#M47497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, LinusH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed my SAS code to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Libname devsrv ODBC DSN="SERV1" schema=dbo;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect to odbc(dsn="SERV1");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; execute (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Insert into devsrv.cust_table1 (cust_id, loan_count, category)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select cust_id, loan_count, category&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from cust_data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) by odbc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; disconnect from odbc;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the error I got: &lt;/P&gt;&lt;P&gt;CLI execute error: [Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name 'devsrv.cust_table1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions from anyone?&amp;nbsp; Thanks.:)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 22:33:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187059#M47497</guid>
      <dc:creator>KevinC_</dc:creator>
      <dc:date>2014-01-02T22:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Through SQL Select Into ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187060#M47498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Now that you are sending the SQL code directly to ODBC yourself you need to use syntax that ODBC can interpret.&amp;nbsp; It knows nothing of the SAS libref DEVSRV that you created so you need to use the native syntax for referencing the table you want. In your LIBNAME statement you linked the SAS libref of DEVSRV to the DBO schema. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You probably need to change devsrv.cust_table1 to dbo.cust_table1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 22:55:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187060#M47498</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-01-02T22:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Through SQL Select Into ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187061#M47499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The odbc connections include a default library which if you didn't specify becomes MASTER.&amp;nbsp; On the SQLServer, there is a database that you would include and the syntax is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; databasename.schema.tablename.&amp;nbsp; So...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect to odbc(dsn="SERV1");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; execute (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into databasename.schema.cust_table1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from databasename.schema.cust_data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) by odbc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; disconnect from odbc;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this doesn't work, then you probably will need to get with the sqlserver dba to help understand the correct databasename and schema.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 16:14:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187061#M47499</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2014-01-03T16:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Through SQL Select Into ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187062#M47500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You haven't told us yet if your table "cust_data" is a database table or a SAS WORK table. Assuming it's a SAS work table code as below should do (not tested):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPTIONS SASTRACE=',,,d' SASTRACELOC=SASLOG NOSTSUFFIX;&lt;/P&gt;&lt;P&gt;libname devsrv ODBC DSN="SERV1" schema=dbo &lt;SPAN class="strong"&gt;DBCOMMIT=0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc append base=devsrv.cust_table1 data=cust_data force /* nowarn */ ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To take full advantage of "DBCOMMIT=0" you might also need to set values other than the defaults for:&lt;/P&gt;&lt;P&gt;"INSERT_SQL" and "INSERTBUFF"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Jan 2014 01:28:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187062#M47500</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-01-04T01:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Through SQL to Append/Update a SQL Server Table?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187063#M47501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My contribution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use the SQL Pass-Through facility you don't need the libname but instead you need to do a &lt;STRONG&gt;select * from connection&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect to odbc(dsn="SERV1");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&amp;nbsp; select * from connection to odbc (&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; **** Here the sql code you want the SQL server to execute ****&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; disconnect from odbc;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jan 2014 18:54:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187063#M47501</guid>
      <dc:creator>CTorres</dc:creator>
      <dc:date>2014-01-14T18:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Through SQL to Append/Update a SQL Server Table?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187064#M47502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you ever get a solution with this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am now having a similar issue and found by inserting this line I can do it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USE &amp;lt;databasename&amp;gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PROC SQL;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect to odbc as sasx(dsn="SERV1");&lt;/P&gt;&lt;P&gt;Execute(USE &amp;amp;db; /*==specify your database===*/&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; Insert into cust_table1 (cust_id, loan_count, category)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select cust_id, loan_count, category&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from cust_data&lt;/P&gt;&lt;P&gt;)by sasx;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; disconnect from &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;sasx&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;QUIT;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2014 15:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pass-Through-SQL-to-Append-Update-a-SQL-Server-Table/m-p/187064#M47502</guid>
      <dc:creator>Lenvdb</dc:creator>
      <dc:date>2014-08-06T15:23:23Z</dc:date>
    </item>
  </channel>
</rss>

