12.07.2015 Views

Solution Guide for Migrating Oracle on UNIX to SQL Server - Willy .Net

Solution Guide for Migrating Oracle on UNIX to SQL Server - Willy .Net

Solution Guide for Migrating Oracle on UNIX to SQL Server - Willy .Net

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<str<strong>on</strong>g>Soluti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>Guide</str<strong>on</strong>g> <str<strong>on</strong>g>for</str<strong>on</strong>g> <str<strong>on</strong>g>Migrating</str<strong>on</strong>g> <str<strong>on</strong>g>Oracle</str<strong>on</strong>g> <strong>on</strong> <strong>UNIX</strong> <strong>to</strong> <strong>SQL</strong> <strong>Server</strong> <strong>on</strong> Windows 111tables in a specific order based <strong>on</strong> the <str<strong>on</strong>g>for</str<strong>on</strong>g>eign key c<strong>on</strong>straints (parent tables first). Opti<strong>on</strong>two is <strong>to</strong> create tables in any order, leaving out the <str<strong>on</strong>g>for</str<strong>on</strong>g>eign key c<strong>on</strong>straints, and addingthem after all the tables have been created.CommentsThis is a property of the table that is often not documented and, hence, easily overlookedduring a migrati<strong>on</strong>. <strong>SQL</strong> <strong>Server</strong> does not have a comment property associated with tablesand columns. However, <strong>SQL</strong> <strong>Server</strong> provides the capability <strong>to</strong> associate cus<strong>to</strong>mproperties, called extended properties, with objects.Comments can be added <strong>to</strong> tables and columns using Enterprise Manager and systems<strong>to</strong>red procedures. To add a comment <strong>on</strong> tables and columns using Enterprise Manager, followthese steps:1. Expand <strong>Server</strong>, then Databases, and then the target database.2. Left-click Tables <strong>to</strong> display the list of tables.3. Right-click the target table and left-click Design Table. This brings up the TableDesigner.4. Comments <str<strong>on</strong>g>for</str<strong>on</strong>g> the individual columns can be added in the Descripti<strong>on</strong> field of theColumns pane at the bot<strong>to</strong>m of the Table Designer window.5. In the Table Designer window, click the Table and Index Properties butt<strong>on</strong> foundabove the grid.6. Left-click the Tables pane of the Properties window. Table comments can beadded in the Descripti<strong>on</strong> field in the Tables pane.The sp_addextendedproperty system s<strong>to</strong>red procedure can be used <strong>to</strong> add any userdefinedmetadata <strong>to</strong> any column in <strong>SQL</strong> <strong>Server</strong>. This (and any other properties that area dded <strong>to</strong> the column) can be retrieved with the fn_listextendedproperty functi<strong>on</strong>.Table 6.10 shows the syntax <str<strong>on</strong>g>for</str<strong>on</strong>g> adding comments at the table and column levels.Table 6.10: Comparis<strong>on</strong> of Functi<strong>on</strong>ality<str<strong>on</strong>g>for</str<strong>on</strong>g> Adding Comments in <str<strong>on</strong>g>Oracle</str<strong>on</strong>g> and<strong>SQL</strong> <strong>Server</strong><str<strong>on</strong>g>Oracle</str<strong>on</strong>g>COMMENT ON TABLE table_name IScommentCOMMENT ON COLUMNtable_name.column_name IS comment<strong>SQL</strong> <strong>Server</strong>sp_ addextendedproperty 'comment',comment,'user', schema_name, 'table',table_namesp_addextendedproperty 'comment',comment,'user', schema_name, 'table',table_name, 'column', column_nameC<strong>on</strong>straintsC<strong>on</strong>straints are data integrity rules that are defined <strong>on</strong> the columns of a table <strong>to</strong> en<str<strong>on</strong>g>for</str<strong>on</strong>g>cecertain business rules. As an example, the specificati<strong>on</strong> of data types in the definiti<strong>on</strong> ofthe column c<strong>on</strong>stitutes a c<strong>on</strong>straint.

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

Saved successfully!

Ooh no, something went wrong!