Uploaded data on SQL Server Date format is text

Reply
Contributor
Posts: 21

Uploaded data on SQL Server Date format is text

Hi,

I am uploading a table on SQL Serever from SAS Enterprise Guide, while doing that I am not getting date in correct format:

in SAS dates are :  03AUG2009

after uploading on SQL Serever dates are in text : 2009-08-03

Can anybody please guide me How can I correc them while uploading the data.

Thanks,

KP

Contributor
Posts: 22

Re: Uploaded data on SQL Server Date format is text

Posted in reply to KrunalPatel

Dear

How is define you Date column in your input data ?

Here a sample to see the diffrence beetween data and the format display.

data x;
  mydate=19235;
  mydate2='30AUG2012'd;

run;
data y;
set x;
  format mydate mydate2 date9.;run;
run;

It depend also of with engine you use to insert ?

A good  solution be to do a extraction of a strcuture of you target table  as

PROC SQL INOBS=1 OUTOBS=0;

   CREATE TABLE WORK.target_template AS  * from   SELECT MSSQL.target;

quit;

try to insert in this template to verify you input data;

If you insert to this table is good you cab do a

proc append data=target_template base=MSSQL.target force;run;

I cuold not provide the good solution without more information.

Best regard

Ask a Question
Discussion stats
  • 1 reply
  • 291 views
  • 0 likes
  • 2 in conversation