How to alter multiple columns in SQL Table which has data in it.

I have to increase DataType Size for few columns .. in a Table which  has records in it.

Create Table has below Syntax in it.

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

When i tried to Alter the Table, I get an error as

Msg 1934, Level 16, State 1, Procedure Capture_objects_changed, Line 18
INSERT failed because the following SET options have incorrect settings: 'ANSI_PADDING'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.

Experts, Kindly help me to resolve this issue.
chokkaStudentAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft SQL Server Data DudeCommented:
>I have to increase DataType Size for few columns .. in a Table which  has records in it.
>... are correct for use with indexed views and/or indexes on computed columns

< wild guesses > 
There is a calculated column, which prevents editing of the columns in the calculation, so you'd have to drop that column, then alter the source column, then re-create the calculated column.
There is an indexed view on the table, which effectively makes it SCHEMABINDING, so you have to drop the view, alter your table column, then re-create the view.

Would help if you posted your ALTER TABLE query in this question.
chokkaStudentAuthor Commented:
Answer is : We cant alter multiple column data type.

It has to be alter one column datatype at a time.


SET ANSI_PADDING ON
GO

-- ALTER SYNTAX

SET ANSI_PADDING OFF
GO

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chokkaStudentAuthor Commented:
@Jim, I have answered in my Comment # ID: 40915690

SET ANSI_PADDING ON   -> Before Alter Table

After the Alter Table . SET ANSI_PADDING OFF
chokkaStudentAuthor Commented:
I found the answer. My answer is right
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.