<?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 ODBC connection to SSMS, in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ODBC-connection-to-SSMS/m-p/700257#M214288</link>
    <description>&lt;P&gt;I have connected to a database on SQL Server Management Studio on my local machine, with SQL Express,&amp;nbsp; with the following ODBC code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  libname MattsLib odbc noprompt="driver=ODBC Driver 11 for SQL Server;
                             server=&amp;lt;my local machine ID&amp;gt;\SQLEXPRESS;
                             database=TestDB;
                             Trusted_Connection=yes"
                  schema=DBO;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This connects as expected, but in trying to figure out how to use "alter table" in SAS to alter SQL tables in SSMS, I ran this following code to create a table.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;CREATE TABLE dbo.account
( account_id INT NOT NULL IDENTITY(1,1) CONSTRAINT PK_account PRIMARY KEY CLUSTERED,
  account_name VARCHAR(100) NOT NULL,
  account_start_date DATE NOT NULL,
  account_address VARCHAR(1000) NOT NULL,
  account_type VARCHAR(10) NOT NULL,
  account_create_timestamp DATETIME NOT NULL,
    account_notes VARCHAR(500) NULL,
  is_active BIT NOT NULL);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It ran with no errors, warnings or notes... But where did it create the table to?&amp;nbsp; I am unable to locate it.&amp;nbsp; It is not in any database in SSMS that i can see (Particularly not in TestDB where i was expecting it)&amp;nbsp; And it is not in any library in my SAS session.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note:&amp;nbsp; i copied and pasted that create table code from here:&amp;nbsp;&lt;A href="https://www.sqlshack.com/methods-to-insert-data-into-sql-server/" target="_self"&gt;https://www.sqlshack.com/methods-to-insert-data-into-sql-server/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Nov 2020 16:43:03 GMT</pubDate>
    <dc:creator>mcook</dc:creator>
    <dc:date>2020-11-19T16:43:03Z</dc:date>
    <item>
      <title>ODBC connection to SSMS,</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODBC-connection-to-SSMS/m-p/700257#M214288</link>
      <description>&lt;P&gt;I have connected to a database on SQL Server Management Studio on my local machine, with SQL Express,&amp;nbsp; with the following ODBC code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  libname MattsLib odbc noprompt="driver=ODBC Driver 11 for SQL Server;
                             server=&amp;lt;my local machine ID&amp;gt;\SQLEXPRESS;
                             database=TestDB;
                             Trusted_Connection=yes"
                  schema=DBO;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This connects as expected, but in trying to figure out how to use "alter table" in SAS to alter SQL tables in SSMS, I ran this following code to create a table.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;CREATE TABLE dbo.account
( account_id INT NOT NULL IDENTITY(1,1) CONSTRAINT PK_account PRIMARY KEY CLUSTERED,
  account_name VARCHAR(100) NOT NULL,
  account_start_date DATE NOT NULL,
  account_address VARCHAR(1000) NOT NULL,
  account_type VARCHAR(10) NOT NULL,
  account_create_timestamp DATETIME NOT NULL,
    account_notes VARCHAR(500) NULL,
  is_active BIT NOT NULL);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It ran with no errors, warnings or notes... But where did it create the table to?&amp;nbsp; I am unable to locate it.&amp;nbsp; It is not in any database in SSMS that i can see (Particularly not in TestDB where i was expecting it)&amp;nbsp; And it is not in any library in my SAS session.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note:&amp;nbsp; i copied and pasted that create table code from here:&amp;nbsp;&lt;A href="https://www.sqlshack.com/methods-to-insert-data-into-sql-server/" target="_self"&gt;https://www.sqlshack.com/methods-to-insert-data-into-sql-server/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 16:43:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODBC-connection-to-SSMS/m-p/700257#M214288</guid>
      <dc:creator>mcook</dc:creator>
      <dc:date>2020-11-19T16:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: ODBC connection to SSMS,</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODBC-connection-to-SSMS/m-p/700275#M214294</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/319809"&gt;@mcook&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you show the actual SAS code you used to connect and run the CREATE TABLE statement?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;The following options will show the exact SQL that SAS is sending to the database:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;OPTIONS SASTRACE=',,,d' SASTRACELOC=saslog NOSTSUFFIX;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Rerun the job and include the resultant SAS log in this thread. If the table does exist, your SAS log will have an error stating that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck,&lt;/P&gt;
&lt;P&gt;Jeff&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 17:28:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODBC-connection-to-SSMS/m-p/700275#M214294</guid>
      <dc:creator>JBailey</dc:creator>
      <dc:date>2020-11-19T17:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: ODBC connection to SSMS,</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODBC-connection-to-SSMS/m-p/700477#M214375</link>
      <description>&lt;P&gt;I'm just a fool.&amp;nbsp; Ignore this question.&amp;nbsp; after working in sql for a few days, i forgot to start with proc sql in SAS.&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 14:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODBC-connection-to-SSMS/m-p/700477#M214375</guid>
      <dc:creator>mcook</dc:creator>
      <dc:date>2020-11-20T14:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: ODBC connection to SSMS,</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODBC-connection-to-SSMS/m-p/700959#M214591</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/319809"&gt;@mcook&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't worry about it and welcome to the club. Many of us are members. I join this club at least once a day.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best wishes,&lt;BR /&gt;Jeff&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 16:20:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODBC-connection-to-SSMS/m-p/700959#M214591</guid>
      <dc:creator>JBailey</dc:creator>
      <dc:date>2020-11-23T16:20:25Z</dc:date>
    </item>
  </channel>
</rss>

