freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] CTime library & MS SQL Server date field.
- From: "_ _" <enrico25.806 AT gmail.com>
- To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] CTime library & MS SQL Server date field.
- Date: Wed, 21 May 2008 10:07:22 +0200
Thanks a lot, I was missing the point about the 'time' problem, you know,
inexperienced programmers (aka ME) working on large projects sometimes get
confused and ask silly questions :) Sometimes Google is just enough...
I did the 'send to server' part with SQLExecDirect() but didn't tried yet...
Is that the right way to do the job?
Thanks again!
Enrico Coi.
On Mon, May 19, 2008 at 7:17 PM, James K. Lowden <jklowden AT freetds.org>
wrote:
> Enrico Coi wrote:
> > how can I
> > catch the current time on my machine (using CTime library) and send it
> > as a record field in a MS SQL 2005 DB?
>
> The best answer is: don't. Instead, define the column with a default of
> getdate() and let the server set the time when you insert the row. If you
> want the same on updates, write a trigger, or include that in your stored
> procedure. (You are using stored procedures, right?)
>
> Second choices:
>
> 1. time(3), localtime(3), and strftime(3).
> 2. SELECT getdate() from the server.
>
> The server is pretty flexible about input formats. I recommend YYYYMMDD:
>
> 1> select cast('20070102 13:14:15' as smalldatetime)
> 2> go
>
> -------------------
> Jan 02 2007 01:14PM
>
> > how can i run the cross compiled FreeTDS into a chroot jail?
>
> I can't think of anything special about FreeTDS concerning chroot except
> getting freetds.conf (and the libraries, of course) in the right places.
> That's just a question of setting up your environment and, yes, OT here.
>
> HTH.
>
> --jkl
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
-
[freetds] CTime library & MS SQL Server date field.,
_ _, 05/19/2008
-
Re: [freetds] CTime library & MS SQL Server date field.,
James K. Lowden, 05/19/2008
- Re: [freetds] CTime library & MS SQL Server date field., _ _, 05/21/2008
-
Re: [freetds] CTime library & MS SQL Server date field.,
James K. Lowden, 05/19/2008
Archive powered by MHonArc 2.6.24.