i have a table with an integer field that is of type PositiveInt_Type with a
length of 4. I am having a problem where when alarger integer tries to get
stored (let's say 125,000), it shows up in the database as 99,999.
What datatype and length should I be using for an integer that could be up
to 1,000,000 in length?
Thanks
JoeThe max value allowed in an integer column is 2^31 - 1 (2,147,483,647). See
"Data Types" in BOL.
AMB
"Joe Williams" wrote:
> i have a table with an integer field that is of type PositiveInt_Type with
a
> length of 4. I am having a problem where when alarger integer tries to ge
t
> stored (let's say 125,000), it shows up in the database as 99,999.
> What datatype and length should I be using for an integer that could be up
> to 1,000,000 in length?
> Thanks
> Joe
>
>|||Try a MySQL newsgroup for MySQL questions. You will have more chance of a
quick and correct answer. This is a newsgroup dedicated to Microsoft SQL
Server.
Jacco Schalkwijk
SQL Server MVP
"Joe Williams" <joe@.anywhere.com> wrote in message
news:eFgaSy6BFHA.1260@.TK2MSFTNGP12.phx.gbl...
>i have a table with an integer field that is of type PositiveInt_Type with
>a length of 4. I am having a problem where when alarger integer tries to
>get stored (let's say 125,000), it shows up in the database as 99,999.
> What datatype and length should I be using for an integer that could be up
> to 1,000,000 in length?
> Thanks
> Joe
>|||This is Microsoft SQL Server - SQL 2000
"Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid> wrote
in message news:udIW156BFHA.2568@.TK2MSFTNGP11.phx.gbl...
> Try a MySQL newsgroup for MySQL questions. You will have more chance of a
> quick and correct answer. This is a newsgroup dedicated to Microsoft SQL
> Server.
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "Joe Williams" <joe@.anywhere.com> wrote in message
> news:eFgaSy6BFHA.1260@.TK2MSFTNGP12.phx.gbl...
>|||On Mon, 31 Jan 2005 11:08:53 -0500, Joe Williams wrote:
>This is Microsoft SQL Server - SQL 2000
Hi Joe,
In that case, try rephrasing your question. Your original question is:
MS SQL Server 2000 doesn't support a datatype PositiveInt_Type.
MS SQL Server will also never (as far as I know - and that's pretty far)
truncate an overflowed value down to the maximum - if you attempt to store
a value outside of the numerical range, you'll get a runtime (arithmetic
overflow) error.
As Alejandro already pointed out: int holds values from -2,147,483,648
through 2,147,483,647.
More details can be found in Books Online.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Hugo (and all),
Thanks for the response. I guess now I am wondering about what is going on,
as I have Micorosft SQL 2000 Server and one of my valid choices in
Enterprise Manager for a data type is PoitiveInt_Type.
If SQL doesn't support, why is it there? And how did it get there?
I also have some other strange type:
PositiveReal_Type
ParmNo_Type
NormalTime_Type
What's the deal? Thanks
Joe
"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:96osv01p0ts5pb34grrbn9bdrtpv8pn035@.
4ax.com...
> On Mon, 31 Jan 2005 11:08:53 -0500, Joe Williams wrote:
>
> Hi Joe,
> In that case, try rephrasing your question. Your original question is:
>
> MS SQL Server 2000 doesn't support a datatype PositiveInt_Type.
>
> MS SQL Server will also never (as far as I know - and that's pretty far)
> truncate an overflowed value down to the maximum - if you attempt to store
> a value outside of the numerical range, you'll get a runtime (arithmetic
> overflow) error.
>
> As Alejandro already pointed out: int holds values from -2,147,483,648
> through 2,147,483,647.
> More details can be found in Books Online.
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)|||Nope, the issue is not with SQL Server 2000. PositiveInt_Type is not a
native datatype in SQL Server 2000.
Do you use any third party software which uses the PositiveInt_Type data
type?
(Storing the maximum value allowed when the value that is inserted is
greater than the maximum value allowed (i.e. store 99,999 instead of
125,000) is one of those nice "features" of MySQL. That's why I thought that
it was MySQL at first, but apparently there are more systems out there where
data integrity doesn't matter.
Jacco Schalkwijk
SQL Server MVP
"Joe Williams" <joe@.anywhere.com> wrote in message
news:upKOl76BFHA.1296@.TK2MSFTNGP10.phx.gbl...
> This is Microsoft SQL Server - SQL 2000
>
> "Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid>
> wrote in message news:udIW156BFHA.2568@.TK2MSFTNGP11.phx.gbl...
>|||Those are User Defined Data Types. You can find the definitions in
Enterprise Manager under the folder User Defined Data Types under your
database folder.
Jacco Schalkwijk
SQL Server MVP
"Joe Williams" <joe@.anywhere.com> wrote in message
news:%23oTv9W7BFHA.608@.TK2MSFTNGP15.phx.gbl...
> Hugo (and all),
> Thanks for the response. I guess now I am wondering about what is going
> on, as I have Micorosft SQL 2000 Server and one of my valid choices in
> Enterprise Manager for a data type is PoitiveInt_Type.
> If SQL doesn't support, why is it there? And how did it get there?
> I also have some other strange type:
> PositiveReal_Type
> ParmNo_Type
> NormalTime_Type
> What's the deal? Thanks
> Joe
>
> "Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
> news:96osv01p0ts5pb34grrbn9bdrtpv8pn035@.
4ax.com...
>|||These must be user-defined datatypes (UDT). See Books Online, sp_addtype. An
UDT is basically an
alias name for a built-in datatype, and there might be an UDT formed in EM w
here you can see the
base datatype for each UDT.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Joe Williams" <joe@.anywhere.com> wrote in message news:%23oTv9W7BFHA.608@.TK2MSFTNGP15.phx.
gbl...
> Hugo (and all),
> Thanks for the response. I guess now I am wondering about what is going on
, as I have Micorosft
> SQL 2000 Server and one of my valid choices in Enterprise Manager for a da
ta type is
> PoitiveInt_Type.
> If SQL doesn't support, why is it there? And how did it get there?
> I also have some other strange type:
> PositiveReal_Type
> ParmNo_Type
> NormalTime_Type
> What's the deal? Thanks
> Joe
>
> "Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
> news:96osv01p0ts5pb34grrbn9bdrtpv8pn035@.
4ax.com...
>|||Sounds like you have a few User Defined Data Types. In Enterprise Manager
under the database you are working in check the User Defined Data Types
folder. Also check BOL for details of course.
Perhaps you inherited a SQL database that was developed by a fromer MySQL
developer?
Paul
"Joe Williams" wrote:
> Hugo (and all),
> Thanks for the response. I guess now I am wondering about what is going on
,
> as I have Micorosft SQL 2000 Server and one of my valid choices in
> Enterprise Manager for a data type is PoitiveInt_Type.
> If SQL doesn't support, why is it there? And how did it get there?
> I also have some other strange type:
> PositiveReal_Type
> ParmNo_Type
> NormalTime_Type
> What's the deal? Thanks
> Joe
>
> "Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
> news:96osv01p0ts5pb34grrbn9bdrtpv8pn035@.
4ax.com...
>
>
No comments:
Post a Comment