Re: How to find the maximum possible value of a given datatype
- From: Gert-Jan Strik <sorry@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 27 Jun 2007 20:26:04 +0200
No there isn't.
But there are solutions. You can read more at
http://groups.google.nl/group/microsoft.public.sqlserver.programming/browse_thread/thread/46512c2691da4607/6743f4aea485c6d1
(url may wrap)
HTH,
Gert-Jan
"jshunter@xxxxxxxxxxxxx" wrote:
.
Does anyone know of a built-in function to return the maximum possible
value of a given datatype? I have to return the biggest value for a
smalldatetime or datetime in a view if the field is null, but can't
find such a function. The closest I've come is:
select datalength(cast(getdate() as smalldatetime))
...but that only return the number of bytes, not the value itself,
which is '6-6-2079 11:59'
I know I could create my own lookup table and function, but I was
hoping that Transact-SQL would have a built-in solution
--John Hunter
- References:
- How to find the maximum possible value of a given datatype
- From: jshunter@xxxxxxxxxxxxx
- How to find the maximum possible value of a given datatype
- Prev by Date: How to make a SQL run longer?
- Next by Date: Re: How to make a SQL run longer?
- Previous by thread: Re: How to find the maximum possible value of a given datatype
- Next by thread: Stored Procedure definition not updating, causing DTS copy error
- Index(es):