Unanswered When compiling VS2010 Database Project in VS2012 I receive error SQL71566

  • Sunday, September 23, 2012 1:51 AM
     
     

    Hello,

          When using my old VS2010 Database project in VS2012 after transforming it to VS2012 format on compliing the project I receive forllowing error message in many table definations.

    SQL71566: Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlFilegroup cannot not be set on both the Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlTable and the clustered Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlPrimaryKeyConstraint.

    For refferce here is script associated with this error.

    CREATE TABLE [rootbase].[OperationsMaster](
     [OperationID] [numeric](18, 0) NOT NULL,
     [OperationName] [nvarchar](150) NOT NULL,
     [OperationTypeID] [numeric](18, 0) NOT NULL,
     CONSTRAINT [PK_OperationsMaster] PRIMARY KEY CLUSTERED
    (
     [OperationID] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY]

    In above script in last line on word [PRIMARY] red line appears. When I run the same script in SSMS it executed sucessfully. Any idea why this happens? Can anyone tell me where the problem is?

    Nilkanth S. Desai



    • Edited by Nilkanth Sunday, September 23, 2012 2:03 AM
    •  

All Replies

  • Monday, September 24, 2012 7:03 AM
    Moderator
     
     

    Hi Nilkanth,

    I am sorry that I can't reproduce your issue on my machine. With your given table definition script, I can upgrade database project to SSDT project in VS2012, and I also can build and deploy it successfully. So I think there should be nothing wrong with your SQL script but your VS2012.

    Please offer me more information so that I can better understand your scenario:

    1). Which edition of VS2012 are you using now? Ultimate or Professional or...?
    2). If you create a SSDT project directly in VS2012, and create a table with the above script, will you get the same error message?
    3). Take a look at the event logs in the Event Viewer to see if there is anything useful, if any post here.

    Thanks.


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us

  • Monday, September 24, 2012 1:09 PM
     
     

    Hello vickey,

           Thank you for your reply.

    I qm using VS2012 Ultimate edition.

    Current exception appears in my SSDT PRoject which was created using VS2010 and later converted to VS2012. But even If ?I create a new project fresh in VS2012 same error appears.

    No Event Log was recorded.

    I am using Windows 7 x64 edition ultimate OS

    If any other information is required please let me know.

    Nilkanth S. Desai

  • Tuesday, September 25, 2012 6:04 AM
    Moderator
     
     

    Hi Nilkanth,

    Thanks for your response. And based on your description, it seems that there is something wrong with your VS2012 Ultimate product, so please first try to repair it to see if it helps.

    Please update me the result once you finished it.

    Thanks.


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us

  • Tuesday, September 25, 2012 8:53 PM
     
     

    I'm having the same problem (SQL71566).

    I have repaired VS 2012 Ultimate. I also uninstalled and re-installed SQL Server Data Tools. Still not working.

  • Wednesday, September 26, 2012 6:17 AM
    Moderator
     
     

    Hi Paul, Nilkanth,

    I noticed that these 3 objects: Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlFilegroup, Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlTable and Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlPrimaryKeyConstraint are all in the Microsoft.Data.Schema.Sql.SchemaModel namespace in the Microsoft.Data.Schema.Sql.dll. So, I think the root cause of the issue may be the Microsoft.Data.Schema.Sql.dll is corrupted.

    So, please first back up the Microsoft.Data.Schema.Sql.dll to another folder, then delete it and then repair VS2012. You can find it in the path: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VSTSDB (I suspect that you are working on x64 machines).

    Thanks.


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us


  • Wednesday, September 26, 2012 6:17 PM
     
     

    I did not find Microsoft.Data.Schema.Sql.dll at the location you gave. There is no VSTSDB folder at my C:\Program Files (x86)\Microsoft Visual Studio 11.0. I did a search at that folder but no results came back.

    I found the Microsoft.Data.Schema.Sql.dll at C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.Data.Schema.Sql\v4.0_10.0.0.0__b03f5f7f11d50a3a. I moved the file and did the following with no luck (none of these repaired the dll):

    Repairing VS2012 did not fix it.

    Removed and repaired Microsoft .NET Framework 4.5 Multi-Targeting Pack... Did not fix it.

    Repaired SDK Server Data Tools 10.3 and 11.1... Did not fix it.

    Any other ideas? Thanks for your help.

  • Wednesday, September 26, 2012 9:08 PM
     
     

    Hello Vickey,

          If I am not wrong we have to repair VS2012 and location u mention is also related to VS2012 But u mention in u r above reply that repair VS2010 but location u mention is related to VS2012. If it is so please reply.

    Nilkanth S. Desai

  • Thursday, September 27, 2012 7:32 AM
    Moderator
     
     

    Hi Nilkanth,

    Sorry for my careless, I mean to repair VS2012. Please update me the result once you finished it.

    Thanks.


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us

  • Thursday, September 27, 2012 7:33 AM
    Moderator
     
     

    Hi Paul,

    Which edition of VS2012 you are working with? Ultimate, Professional or...?


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us

  • Thursday, September 27, 2012 9:55 AM
     
     

    Hello Vicky,

           I check u r suggestion with re installing VS2012 but still same problem exists. I am also using VS2012 Ultimate on x64 bit Windows 7 Ultimate edition.

    HTH,

    Nilkanth

  • Thursday, September 27, 2012 2:06 PM
     
     
    I am using VS 2012 Ultimate, Windows 8 Pro.
  • Thursday, September 27, 2012 11:49 PM
     
     

    I was having this problem too and just ended up manually removing the first "ON [Primary]" at the end of the "WITH" statement.

    Unfortunately I don't think this is necessarily the ideal solution (because I'll have to manually do this every time we create a new table), but it got my solution building again, and the automated builds working nightly!

  • Friday, September 28, 2012 2:27 AM
    Moderator
     
     

    Hi All,

    I am sorry that I can't reproduce your issue. I think you can consider submitting one feedback on the Microsoft Connect site, may our senior support engineers can help you out. Go: https://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx

    Please share me the link once you finished it, it will helpful for us to track the status of it.

    Thanks.


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us

  • Friday, September 28, 2012 4:59 PM
     
     
  • Tuesday, October 23, 2012 11:24 AM
     
     

    I've faced the same error When I publish my project with Visual Studio - it works. But when I use MSBuild on the remote server it fails with the same error.

  • Wednesday, November 14, 2012 10:46 AM
     
     

    Hello Vicky,

           I check u r suggestion with re installing VS2012 but still same problem exists. I am also using VS2012 Ultimate on x64 bit Windows 7 Ultimate edition.

    HTH,

    Nilkanth

    Hello all,

           Any updates in November Updates of SSDT? If any workaround please update here so I can proceed.

    Nilkanth S. Desai