13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

602 Data Types <strong>for</strong> Microsoft SQL Server 4 Chapter 20Server; NO <strong>for</strong> all others. For additional in<strong>for</strong>mation about these options, see “Overviewof the LIBNAME Statement <strong>for</strong> <strong>Relational</strong> <strong>Databases</strong>” on page 87.Microsoft SQL Server supports table names and column names that contain up to 32characters. If DBMS column names are longer than 32 characters, <strong>SAS</strong> truncates themto 32 characters. If truncating a column name would result in identical names, <strong>SAS</strong>generates a unique name by replacing the last character with a number. DBMS tablenames must be 32 characters or less because <strong>SAS</strong> does not truncate a longer name. Ifyou already have a table name that is greater than 32 characters, it is recommendedthat you create a table view.Data Types <strong>for</strong> Microsoft SQL ServerOverviewEvery column in a table has a name and a data type. The data type tells theMicrosoft SQL Server how much physical storage to set aside <strong>for</strong> the column and the<strong>for</strong>m in which the data is stored.Microsoft SQL Server Null ValuesMicrosoft SQL Server has a special value called NULL. A Microsoft SQL ServerNULL value means an absence of in<strong>for</strong>mation and is analogous to a <strong>SAS</strong> missing value.When <strong>SAS</strong>/<strong>ACCESS</strong> reads a Microsoft SQL Server NULL value, it interprets it as a<strong>SAS</strong> missing value.Microsoft SQL Server columns can be defined as NOT NULL so that they requiredata—they cannot contain NULL values. When a column is defined as NOT NULL, theDBMS does not add a row to the table unless the row has a value <strong>for</strong> that column.When creating a DBMS table with <strong>SAS</strong>/<strong>ACCESS</strong>, you can use the DBNULL= data setoption to indicate whether NULL is a valid value <strong>for</strong> specified columns.For more in<strong>for</strong>mation about how <strong>SAS</strong> handles NULL values, see “Potential ResultSet Differences When Processing Null Data” on page 31 in <strong>SAS</strong>/<strong>ACCESS</strong> <strong>for</strong> <strong>Relational</strong><strong>Databases</strong>: <strong>Reference</strong>.To control how <strong>SAS</strong> missing character values are handled by Microsoft SQL Server,use the NULLCHAR= and NULLCHARVAL= data set options.LIBNAME Statement Data ConversionsThe following table shows all data types and default <strong>SAS</strong> <strong>for</strong>mats that <strong>SAS</strong>/<strong>ACCESS</strong>Interface to Microsoft SQL Server supports.Table 20.4Microsoft SQL Server Data Types and Default <strong>SAS</strong> FormatsMicrosoft SQL Server Data TypeDefault <strong>SAS</strong> FormatSQL_CHAR $nSQL_VARCHAR $nSQL_LONGVARCHAR $n

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!