November 20, 2002
Oracle v SQL Server, Part 1
So I am converting my tables and associated scripts. As an Oracle bod for many a year this new fangled technology is all a bit different, but strangely familiar. I am going to use this blog to record those little differences as and when I find them.
First, DDL. When creating tables in SQL Server data types are subtly different.
- VARCHAR2 should be replaced by VARCHAR
- NUMBER should be replaced by DECIMAL (or NUMERIC)
- NUMBER columns with no digits after the decimal point can be converted to INT (or BIGINT)
- DATE should be replaced by DATETIME
- SQL Server has a MONEY (and associated SMALLMONEY) data type, Oracle doesn't. Use at your own risk.
- CLOB should be replaced by TEXT
- BLOB should be replaced by IMAGE
A minor point, but if you are migrating some SQL scripts, REM isn't a valid comment marker in Transact-SQL, replace it with double dash ("--") or put C style comment markers (/* */) around whole blocks of comments.
Posted by Andy Todd at November 20, 2002 03:17 PM