Re: CTime library & MS SQL Server date field.

"_ _" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
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 <[email protected]>
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
> [email protected]
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.