Re: Warning: Existing columns have ANSI_PADDING 'off'

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Steve Kass (skass_at_drew.edu)
Date: 09/26/04


Date: Sat, 25 Sep 2004 20:22:32 -0400

Matt,

  Try adding the column by running an ALTER TABLE query in Query
Analyzer instead of using Enterprise Manager:

ALTER TABLE MattsTable ADD newColumn CHAR(10)
GO

If that doesn't work, try setting ANSI_PADDING to OFF before adding the
column (still in Query Analyzer)..

SET ANSI_PADDING OFF
GO
ALTER TABLE MattsTable ADD newColumn CHAR(10)
GO

Steve Kass
Drew University

Matt wrote:

>I'm having an issue where I inhereted a database where existing columns in a
>table have ANSI Padding Off
>
>I am trying to add a column to the table and get a messge
>
>" Warning: Existing columns have ANSI_PADDING 'off'. New columns will be
>created with ANSI_PADDING 'on'."
>
>I'm adding a char(10) column...even tried a varchar(10) column.
>
>The problem I'm having is that when all is said and done and I add this
>column and acknowledge the warning and the column is added, I then go to run
>the program that connects to this database (also inhereted) and it throws an
>SQL error.
>
>I delete the column and the program loads fine.
>
>My question is, what is possibly happening and how can I add a column to the
>database so that it conforms to the rest of the columns in the table IE ANSI
>Padding off instead of on...so that this program doesnt throw this error.
>
>



Relevant Pages