October 29, 2008 at 4:28 am
I need to use the insert...set form in my code but the statement i have written is not working.
insert into contactinfo
set FullName='XYZ',
Source='ABC',
CreatedDate='2008-09-09 00:00:00.000',
ModifiedDate='2008-09-09 00:00:00.000'
Could anyone tell me if there is any syntactical error in the above statement?
I m getting teh followign error:
Incorrect syntax near the keyword 'set'.
October 29, 2008 at 4:47 am
Try this instead:
insert into contactinfo (FullName, Source, CreatedDate, ModifiedDate)
values ('XYZ', 'ABC', '2008-09-09 00:00:00.000', '2008-09-09 00:00:00.000')
October 29, 2008 at 5:29 am
thnkz.
I know the above syntax but I got to know that there is an insert...set form also. Or is it that it is present only in MySQL and not in SQL Server 2005?
October 29, 2008 at 5:31 am
Pooja_prasad (10/29/2008)
thnkz.I know the above syntax but I got to know that there is an insert...set form also. Or is it that it is present only in MySQL and not in SQL Server 2005?
I don't know about MySQL but as far as the SQL language goes I've never seen an insert...set statement anywhere. And there certainly isn't one in SQL Server.
There is an update...set statement though.
October 29, 2008 at 5:35 am
k..Thnkz:-)
October 29, 2008 at 5:39 am
Pooja_prasad (10/29/2008)
thnkz.I know the above syntax but I got to know that there is an insert...set form also. Or is it that it is present only in MySQL and not in SQL Server 2005?
SQL Server <> MySQL !!
UPDATE uses SET, INSERT not. I'm afraid you have to cope with it...
Ronald
Ronald HensbergenHelp us, help yourself... Post data so we can read and use it: http://www.sqlservercentral.com/articles/Best+Practices/61537/-------------------------------------------------------------------------2+2=5 for significant large values of 2
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply