OpenEdge Data Management: DataServer for Microsoft SQL Server
OpenEdge Data Management: DataServer for Microsoft SQL Server
OpenEdge Data Management: DataServer for Microsoft SQL Server
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Chapter 2: Initial Programming Considerations<br />
Naming conventions<br />
When planning <strong>for</strong> maximum transparency across <strong>OpenEdge</strong> databases and MS <strong>SQL</strong><br />
<strong>Server</strong> data sources, be sure to consider the restrictions that each places on naming<br />
data source objects when you per<strong>for</strong>m a <strong>OpenEdge</strong> DB to MS <strong>SQL</strong> <strong>Server</strong> conversion.<br />
Table 6 describes these restrictions, and the notes that follow discuss how the<br />
<strong>Data</strong><strong>Server</strong> resolves differences between <strong>OpenEdge</strong> and MS <strong>SQL</strong> <strong>Server</strong> database<br />
naming conventions.<br />
Table 6: <strong>Data</strong>base naming restrictions<br />
Alphanumeric<br />
characters<br />
Category <strong>OpenEdge</strong> MS <strong>SQL</strong> <strong>Server</strong><br />
A–Z or a–z<br />
0–9<br />
Special characters Allows $, &, #, %, –,<br />
and _ 1<br />
All alphanumeric characters<br />
from the character set that you<br />
defined <strong>for</strong> your MS <strong>SQL</strong><br />
<strong>Server</strong><br />
Allows @, $, #, _, ¥, and £ 2<br />
Initial character Alphabetic only Alphabetic only<br />
Maximum length of<br />
object name<br />
Keywords Not allowed 4<br />
Unique table names Required 5<br />
32 characters 24 characters 3<br />
Not allowed 4<br />
Required 6<br />
1. Although <strong>OpenEdge</strong> allows you to use the ampersand (&) in database-object names, the <strong>OpenEdge</strong><br />
development tools use this character internally to denote preprocessor directives.<br />
2. When the <strong>Data</strong><strong>Server</strong> encounters characters not supported by <strong>OpenEdge</strong> in a sequence, table, index, or<br />
field name, it converts them to underscores ( _ ) in the data source. For example, the data source table<br />
name emp@status becomes emp_status in the schema holder. If the unsupported character is at the<br />
beginning of an object name, the <strong>Data</strong><strong>Server</strong> substitutes a lowercase z. Also, the <strong>Data</strong><strong>Server</strong> strips @<br />
symbols from stored procedure parameter names.<br />
3. Object names are limited to 32 characters. When you use the <strong>OpenEdge</strong> DB to MS <strong>SQL</strong> <strong>Server</strong> utility to<br />
per<strong>for</strong>m a database conversion, however, the utility truncates object names to 24 characters in order to<br />
accommodate the suffix characters that it appends when it finds nonunique names, reused <strong>OpenEdge</strong><br />
keywords, array fields, sequences, triggers, and so <strong>for</strong>th. If you intend to use the <strong>OpenEdge</strong> DB to MS<br />
<strong>SQL</strong> <strong>Server</strong> utility, be sure to limit object names to 24 characters to accommodate this name resolution<br />
during conversion.<br />
4. <strong>OpenEdge</strong> and MS <strong>SQL</strong> <strong>Server</strong> databases contain restrictions against using keywords as database object<br />
names. If a data source object name consists of an <strong>OpenEdge</strong> keyword, the <strong>Data</strong><strong>Server</strong> appends an<br />
underscore character ( _ ) to the name. For example, an object named “each” becomes “each_”<br />
5. MS <strong>SQL</strong> <strong>Server</strong> qualifies nonunique table names to make them unique (see your data source<br />
documentation <strong>for</strong> details); however, <strong>OpenEdge</strong> still regards these qualified names as nonunique. The<br />
<strong>Data</strong><strong>Server</strong> resolves nonunique table names <strong>for</strong> you as follows: when <strong>OpenEdge</strong> encounters matching<br />
table names while creating or updating a schema holder, it names the second and subsequent tables<br />
table-1, table-2, etc. For example, if <strong>OpenEdge</strong> encounters a table named lee.employee (the employee<br />
table owned by the user lee) that is the second instance of the name in the data source, it names the<br />
corresponding table in the schema holder employee-1. Keep in mind that when resolving naming<br />
conventions, the <strong>Data</strong><strong>Server</strong> can append up to three characters to an object name: two in the case of a<br />
nonunique name and one in the case of an <strong>OpenEdge</strong> keyword. There<strong>for</strong>e, you should limit your object<br />
names to 29 characters so that you do not exceed the <strong>OpenEdge</strong> 32-character limit <strong>for</strong> object names in<br />
the schema holder.<br />
6. MS <strong>SQL</strong> <strong>Server</strong> allows you to qualify an object name by adding the database name, the owner’s name,<br />
or the table name (<strong>for</strong> columns).<br />
58 <strong>OpenEdge</strong> <strong>Data</strong> <strong>Management</strong>: <strong>Data</strong><strong>Server</strong> <strong>for</strong> <strong>Microsoft</strong> <strong>SQL</strong> <strong>Server</strong>