Jump to content

about different data types in MS Server 2005


Recommended Posts

I am new to database designing. I want to know about different data types in Microsoft SQL Server 2005.

1. bigint

2. binary(50)

3. nchar

4. ntext vs text

5. numeric

6. nvarchar

7. datetime vs smalldatetime

8. smallmoney vs money

9. sql_variant

10. timestamp

What are the appropriate use of such datatypes, I mean suppose when to use nvarchar and when to use ntext??

Link to comment
Share on other sites

Basically char is a fixed-length character string, so if you define char(8) and it contains the character 'A', it is still 8 characters long ('A␢␢␢␢␢␢␢', length 8).

On the other hand, varchar is a variable-length character string, and the contents equals what is entered ('A' = 'A', length 1).

Data type text is similar to varchar, but no longer supported by newer SQL servers, so it should not be used.

Data types nchar, nvarchar, and ntext are the same as above, but for multibyte (Unicode) character sets.

More info at http://msdn.microsoft.com/en-us/library/ms187752%28v=SQL.90%29.aspx

Link to comment
Share on other sites

  • 11 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy