Reputation:
What should i know about involving basic data types in SQL Server?
In my database i need
Is there a TEXT type in SQL Server? I dont want to use varchar(limit) unless i could use something ridiculously high like 128k. How do i specify 1byte - 8byte ints?
Upvotes: 1
Views: 1490
Reputation: 48522
Others have already provided good answers to your question. If you are doing any .NET development, and need to map SQL data types to CLR data types, the following link will be quite useful.
http://msdn.microsoft.com/en-us/library/bb386947.aspx
Randy
Upvotes: 1
Reputation: 755361
For 1), use BIT
- it's one bit, e.g. eight of those fields will be stuck into a single byte.
For 2), use BIGINT
- 64-bit signed int
For 3), definitely do NOT use TEXT/NTEXT
- those are deprecated as of SQL Server 2005 and up.
Use VARCHAR(MAX)
or NVARCHAR(MAX)
for up to 2 GB of textual information instead.
Here's the list of the SQL Server 2008 data types:
http://msdn.microsoft.com/en-us/library/ms187594.aspx
Upvotes: 4
Reputation: 432657
Use "bit" which is exactly that: one bit
bigint is 64 bit signed
varchar(max) is up to 2GB. Otherwise varchar(8000) is the conventional limit
Microsoft even put into a nice handy web page for you
Upvotes: 3
Reputation: 191048
Here is the document.
http://msdn.microsoft.com/en-us/library/aa258271%28SQL.80%29.aspx
Upvotes: 1