Re: call a function using ado
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Mon, 30 Jan 2006 23:09:00 +0000 (UTC)
chieko (chieko@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
> Yes, you're correct. i was in a hurry so i copied the function from the
> excel vba.
>...
> returns datetime
> as
> begin
> declare @SecondsToAdd bigint, @MilliSecToAdd bigint
> declare @RetVal datetime
>
> set @RetVal = NULL
>
> set @SecondsToAdd = (@FtValue - 116444736000000000)/10000000
> set @MilliSecToAdd = (@FtValue - 116444736000000000)/10000 -
> (@SecondsToAdd * 1000)
>
> if (@SecondsToAdd >= -2147483648) and (@SecondsToAdd <= 2147483647) and
> (@MilliSecToAdd >= -2147483648) and (@MilliSecToAdd <= 2147483647)
> set @RetVal = dateadd(ms, @MilliSecToAdd, dateadd(ss, @SecondsToAdd,
> cast('1970-01-01 00:00:00.000' as datetime)))
>
> return @RetVal
> end
As I can see, the function performs no data access at all. Seems
very ineffectient to me to SQL Server for such a thing. Surely
you should be able to this in VBA?
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- Re: call a function using ado
- From: Mary Chipman [MSFT]
- Re: call a function using ado
- From: Erland Sommarskog
- Re: call a function using ado
- From: chieko
- Re: call a function using ado
- Prev by Date: Re: call a function using ado
- Next by Date: Re: Fast load options in OpenRowset
- Previous by thread: Re: call a function using ado
- Next by thread: GetParameterInfo for JET
- Index(es):
Relevant Pages
|