Here's some info that might help:

nvarchar = MS$ variable character string, up to 4000 characters, stored
as UNICODE UCS-2.  AFAIK, MySQL doesn't (yet) support UNICODE directly.
However, M$ SQL often forces the nvarchar/ntext types on by default.
So, if you don't need UNICODE, use varchar.  If you do, you can use
VARCHAR BINARY to store the data, but you won't get exactly what
you're after when it comes to string operations and comparisons
(? true -- can someone else elaborate - I'm not much into UNICODE).

M$ SQL smallint = 16-bit signed integer = MySQL smallint

M$ SQL bit = tinyint(1) (MySQL treats "BIT" as a synonym for "tinyint(1)"),
just be careful to store only 0 or 1 -- or code things as "= 0" and
"<> 0".

M$ int = 32-bit signed integer = MySQL int

ntext = variable-length UNICODE data, max 2**30 - 1 chars.  Since MySQL
doesn't (yet) support UNICODE directly, replace this with MySQL's blob
for UNICODE storage or text if UNICODE is not required (? needs more on
what would happen if you put UNICODE chars in a blob and then tried to
sort/substring/compare/etc. the values -- I assume this won't work as
expected).

M$ SQL real = floating point number from -3.40E+38 to 3.40E+38 stored
as 4 bytes = MySQL float

M$ SQL float = floating point from -1.79E-308 to 1.79E+308 (but precision
can be affected by size -- float(24) is a single-precision, float(53)
is double-precision) = MySQL double

M$ SQL datetime = Date & time to 1/3 millisecond = MySQL DATETIME, however
MySQL doesn't store the fractional time portion.  You may have to split this
into two columns, a DATETIME to hold date and time with accuracy to 1 second,
and a separate INT to hold the millisecond portion of the time.

M$ SQL money = 4-place decimal from -2**63 to 2**63 - 1 = MySQL
DECIMAL(21,4), although you may not need that much space

M$ SQL smalldatetime = Date and time with minute accuracy = MySQL
datetime, but be sure to mask off any seconds before you store
values, since MySQL stores the time down to seconds.

M$ SQL numeric & decimal = MySQL decimal

hth

Bob Diss, [EMAIL PROTECTED]

>From: "Tom Coffin" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Date: Thu, 12 Dec 2002 09:25:38 -0500
>
>Hi all-
>
>I need to know what the mySQL equivalents are to the following MS SQL
>datatypes:
>
>nvarchar
>smallint
>bit
>int
>ntext
>real
>datetime
>float
>money
>smalldatetime
>numeric
>decimal
>
>
>Thanks for your help!
>Tom
>-----
>Improve your reimbursement rate and lower your risk for audit. The MMI
>Coding Hotline is ready to assist you with coding answers and billing
>guidelines at http://hotline.institute.md
>
>---------------------------------------------------------------------
>Before posting, please check:
>   http://www.mysql.com/manual.php   (the manual)
>   http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <[EMAIL PROTECTED]>
>To unsubscribe, e-mail <[EMAIL PROTECTED]>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to