Create a table in access by using proc sql..

Reply
Frequent Contributor
Posts: 89

Create a table in access by using proc sql..

HI all

   how can i create a table in access by using proc sql. I also write code to do the same activity but i couldn't make the necessary result.

  Here i put ma code on below.If anyone help me to do the task

proc sql;

connect to access(path='C:\Users\Krishna\Desktop\sass\three.mdb');

execute(create table kc (id number,name text,depid number)by access;

execute(insert into kc values(1,'abcd',101)) by access;

execute(insert into kc values(2,'jack',102)) by access;

execute(insert into kc values(2,'kilby',103)) by access;

disconnect from access;

quit;

Thanking you

Krishnachandran

Esteemed Advisor
Posts: 5,194

Re: Create a table in access by using proc sql..

So what is the result? DO you get any errors, or does your table not look as you expect?

I assume that the three.mdb already exists.

Are you doing this for testing/educational purposes? Inserting data in Access via SAS using hard coded insert values isn't best practice...

Data never sleeps
Frequent Contributor
Posts: 89

Re: Create a table in access by using proc sql..

Hai Linush am beginner in sas.

The question was about for my learning purpose .Here the three.mdb already exist and the file also contain a table Krish.My need is to add new table in three.mdb with the name kc.I saw the same code in log window while i run the code .I couldn't saw any error messages.

Esteemed Advisor
Posts: 5,194

Re: Create a table in access by using proc sql..

If you don't see any messages at all, you probably haven't fixed the parenthesis problem.

You should see a

NOTE: PROCEDURE SQL used...

after you submitted your code.

Data never sleeps
Esteemed Advisor
Posts: 5,194

Re: Create a table in access by using proc sql..

You are missing a right parenthesis in your create table code line.

Once there it works for me. I use MS Access 2013 on SAS 9.4.

Data never sleeps
Ask a Question
Discussion stats
  • 4 replies
  • 211 views
  • 0 likes
  • 2 in conversation