Re: ADO error



Nope, definitely doesn't, and there are loads of posts on Usenet showing the
same error message and the same answer - don't use the COLUMN keyword as
it's not part of the SQL Server syntax.

Dan

Daniel wrote to Daniel Crichton on Thu, 15 Jun 2006 16:00:11 +0100:

Hmm, another dig around shows that SQL Server should handle it as
optional. I'll try some tests here on my servers.

Dan

Daniel wrote to kayal on Thu, 15 Jun 2006 15:57:01 +0100:

SQL Server's syntax hasn't changed - the docs for v7 to 2005 all show
that it's ALTER TABLE [tablename] ADD <column_definition>

While the ANSI 92 standard defines the keyword COLUMN after the ADD as
optional, SQL Server doesn't allow it. SQL Server is not fully ANSI 92
compliant.

Dan

kayal wrote on Thu, 15 Jun 2006 05:49:02 -0700:

ya it worked like charm.
thanx.but y is the original syntax changed here in ms sql?

"Daniel Crichton" wrote:

kayal wrote on Thu, 15 Jun 2006 02:42:01 -0700:

"Incorrect syntax near the keyword 'COLUMN' statement(s) could not be
prepared. deferred prepare could not be completed"

can anyone please help me with this error which i get while trying to
add a column to my table.

query "alter table release add column email varchar(2));"

It would help if you specified the database server you're using too.
Assuming MS SQL Server, your problem is that you've put "column" in the
statement - with ALTER TABLE ... ADD you just specify the column
definition, eg.

alter table release add email varchar(2)

Dan


.



Relevant Pages

  • Re: Connecting to a sql server database
    ... You are trying to use integrated security in your app (as is shown in the ... line numbered code where the connection string is shown). ... sql server, hence integrated security fails. ... > causing the error message and what the correction for this. ...
    (microsoft.public.dotnet.general)
  • Re: Problem altering table and adding a default
    ... ALTER TABLE dbo.Test_tbl ADD Notnull_col1 charNOT NULL ... SQL Server does not allow that - you can only add nullable columns. ... After you add a new column in Enterprise Manager, uncheck Allow Nulls, bind the uder- ... Start Profiler and perform a new trace. ...
    (microsoft.public.sqlserver.server)
  • Re: Invalid OLEVERB structure error 80040000 on DTS job
    ... >> Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ... >- I copied this DTS package from a 32 bit Windows Server 2003 system. ... >I would only get that error message in the Job History logs though. ...
    (microsoft.public.sqlserver.dts)
  • Re: Problem altering table and adding a default
    ... SQL Server does not allow that - you can only add nullable ... > After you add a new column in Enterprise Manager, uncheck Allow Nulls, ... the ALTER TABLE statement above will pass to the SQL Server ... > 4) Start Profiler and perform a new trace. ...
    (microsoft.public.sqlserver.server)
  • Re: Classic ASP connectionstring to SQL Server 2005
    ... So this connection string is in the VB6 dll? ... What is the error message? ... Provider cannot be found. ... can you ping the sql server? ...
    (microsoft.public.inetserver.asp.db)