Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7437547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:24:57+00:00 2026-05-29T10:24:57+00:00

We are using Visual Studio and a database project to generate our database. I

  • 0

We are using Visual Studio and a database project to generate our database.

I just made a number of database changes (including adding a new table named Correspondence) imported those changes into the database project, and attempted to deploy (rebuild) the database.

When I do, I get the following error:

Creating [dbo].[Correspondence]…
Msg 1934, Level 16, State 1, Server (Server Name), Line 1
CREATE TABLE failed because the following SET options have incorrect settings
: ‘ANSI_WARNINGS, 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.

Can anyone explain this error to me, and help me resolve it? Here’s the script the database project uses to create this table.

PRINT N'Creating [dbo].[Correspondence]...';
GO

SET ANSI_NULLS, QUOTED_IDENTIFIER ON;
GO

CREATE TABLE [dbo].[Correspondence] (
    [Id]                INT              IDENTITY (1, 1) NOT NULL,
    [WorkbookId]        INT              NOT NULL,
    [ProviderId]        UNIQUEIDENTIFIER NOT NULL,
    [MessageThreadId]   INT              NOT NULL,
    [MessageThreadType] AS               ((1)) PERSISTED NOT NULL
);
GO

SET ANSI_NULLS, QUOTED_IDENTIFIER OFF;
GO

PRINT N'Creating PK_Correspondence...';
GO

ALTER TABLE [dbo].[Correspondence]
ADD CONSTRAINT [PK_Correspondence] PRIMARY KEY CLUSTERED ([Id] ASC)
    WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF,
    IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF);
GO
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:24:58+00:00Added an answer on May 29, 2026 at 10:24 am

    According to BOL:

    Indexed views and indexes on computed columns store results in the
    database for later reference. The stored results are valid only if all
    connections referring to the indexed view or indexed computed column
    can generate the same result set as the connection that created the
    index.

    In order to create a table with a persisted, computed column, the following connection settings must be enabled:

    SET ANSI_NULLS ON
    SET ANSI_PADDING ON
    SET ANSI_WARNINGS ON
    SET ARITHABORT ON
    SET CONCAT_NULL_YIELDS_NULL ON
    SET NUMERIC_ROUNDABORT ON
    SET QUOTED_IDENTIFIER ON
    

    These values are set on the database level and can be viewed using:

    SELECT 
        is_ansi_nulls_on,
        is_ansi_padding_on,
        is_ansi_warnings_on,
        is_arithabort_on,
        is_concat_null_yields_null_on,
        is_numeric_roundabort_on,
        is_quoted_identifier_on
    FROM sys.databases
    

    However, the SET options can also be set by the client application connecting to SQL Server.

    A perfect example is SQL Server Management Studio which has the default values for SET ANSI_NULLS and SET QUOTED_IDENTIFIER both to ON. This is one of the reasons why I could not initially duplicate the error you posted.

    Anyway, to duplicate the error, try this (this will override the SSMS default settings):

    SET ANSI_NULLS ON
    SET ANSI_PADDING OFF
    SET ANSI_WARNINGS OFF
    SET ARITHABORT OFF
    SET CONCAT_NULL_YIELDS_NULL ON 
    SET NUMERIC_ROUNDABORT OFF
    SET QUOTED_IDENTIFIER ON
    GO
    
    CREATE TABLE T1 (
        ID INT NOT NULL,
        TypeVal AS ((1)) PERSISTED NOT NULL
    ) 
    

    You can fix the test case above by using:

    SET ANSI_PADDING ON
    SET ANSI_WARNINGS ON
    

    I would recommend tweaking these two settings in your script before the creation of the table and related indexes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When we build our Visual Studio 2010 Database Project from the command line using
I am using Visual Studio 2008 Database Project GDR2 to manage multiple databases and
I have a Visual Studio 2010 Database project, from which I want to generate
I've noticed that when generating a new C++ project using MS Visual Studio 2008,
We are using the SQL Server Database project template with Visual Studio 2010. As part of
I'm using Visual Studio 2005. I create a project, not Web Project, just Windows
I have a scenario where I am using a visual studio 2010 database project
I'm using Visual Studio 2010 In my project I was added a local database
Visual Studio has a Database Project for Sql Server. This has a number of
I am using a SQL 2008 database project (in visual studio) to manage the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.