显示标签为“smallint”的博文。显示所有博文
显示标签为“smallint”的博文。显示所有博文

2012年3月25日星期日

Anyone got a chart of datatype conversions?

I'm looking for a chart that shows the VB6 > .NET > SQL 2005 datatypes.
E.g.
VB6 .NET SQL2005
integer int16 smallint
long int32 int
byte byte tinyint
But I want a whole chart with all datatypes. Anyone know of a URL with a
chart?Do a search in google. There are several sites with VB6 and VB.NET type
comparisons.
Regarding SQL 2005 types there are no direct mapping for all the available
types. What you may have to look for is ADO.NET type comparisons. Checkout
the MSDN site for a full list of all ADO.NET type mappings.
--
Anith|||I did a google search and didn't much that was helpful with SQL 2005.
That's why I opened this thread. I appreciate msdn suggestion but hopefully
someone will still have a URL they like for datatype conversions.
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:%2385m9c4UGHA.1160@.TK2MSFTNGP09.phx.gbl...
> Do a search in google. There are several sites with VB6 and VB.NET type
> comparisons.
> Regarding SQL 2005 types there are no direct mapping for all the available
> types. What you may have to look for is ADO.NET type comparisons. Checkout
> the MSDN site for a full list of all ADO.NET type mappings.
> --
> Anith
>

2012年2月11日星期六

ANSI's stance on SmallInt vs. Int

I decided to push this out to it's own thread. Here's the question, if you a
re
deciding to abide purely by ANSI SQL 92 standards and are only thinking in t
erms
of the logical model, how does the modeler decide when to use a SmallInt vs.
an
Integer if the allowed range is considered a physical implementation?
A secondary question relates to boolean values. Is the official ANSI solutio
n to
storing boolean values (0 or 1) to use either a full blown Int (of course, s
ince
we are only talking about ANSI, we have no idea how big that is ;-> ) or a
Char(1)?
ThomasANSI / ISO SQL doesn't define absolute numeric precision so the
decisions on which datatype to use can only be made in the context of
an actual implementation. Those physical details are just outside the
scope of the standard. Does it matter?
SQL99 defines a Boolean datatype but SQL Server doesn't support it.
David Portas
SQL Server MVP
--|||> ANSI / ISO SQL doesn't define absolute numeric precision so the
> decisions on which datatype to use can only be made in the context of
> an actual implementation. Those physical details are just outside the
> scope of the standard. Does it matter?
By specifying the concept of a SmallInt but providing no information that wo
uld
help the modeler choose one over the other, it sounds like the ANSI team mad
e an
outright error in including SmallInt in the first place. Said another way, s
ince
designers are already required to accommodate the given DBMS for things like
the
range of values for a SmallInt, where is the problem in using DBMS specific
features like TinyInt? After all, if portability is the holy grail of standa
rds
use, it is already the case that porting a database from one DBMS to another
might break because one vendor used 2-bytes for their SmallInt while another
used 1-byte for their SmallInt. Thus, in terms of data types certainly, it m
akes
sense to use things like TinyInt to accomplish you goal.
In case you were wondering, I bring this up becuase of a comment Mr. Celko m
ade
about not using SQL's TinyInt datatype.

> SQL99 defines a Boolean datatype but SQL Server doesn't support it.
Is that true of SQL 2005 as well?
Thomas