On 12 May 2005 16:40:38 -0700,
ry*********@gmail.com wrote:
Hi all, I have a question about inserting records into sql server. I
am brand new to sql server, always using oracle previously. Before
today, I had always written statement such as this:
INSERT INTO TABLE (COL1) VALUES SYSDATE;
Hi Ryan,
Is this a straight copy-and-paste from working Oracle code? The SQL
standard calls for parentheses in the values clause.
(snip)p.s. I tried getdate(), getdate, sysdate, and current_timestamp. All
to no avail :(
Both CURRENT_TIMESTAMP (the ANSI-standard keyword) and getdate() (the
T-SQL proprietary equivalent) should work - but only if you include the
parentheses, and escape the tablename ("table" is a reserved word):
INSERT INTO "TABLE" (COL1) VALUES (CURRENT_TIMESTAMP);
If this doesn't work, then post back with the DDL (the CREATE TABLE
statement used for your table "TABLE"), the complete code, and the exact
error message you get.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)