Search

Schema import creates duplicate objects by Mike425768

Active

4
0
Sign in
to vote
Type: Bug
ID: 532540
Opened: 2/10/2010 6:26:57 AM
Access Restriction: Public
0
Workaround(s)
2
User(s) can reproduce this bug
I have a SQL 2005 DB that was upgraded from a SQL 2000 DB. There are multiple schemas with SP's of the same name in more than one schema. Some SP's were originally created while logged in as the schema owner with unqualified names, but were put in the correct schema by default. sp_helptext shows the SP name without a schema qualifier. Scripting these SP's in SSMS shows a qualified SP name. When I import the DB into a SQL 2005 Database Project it imports the unqualified names and thus ends up with duplicate objects.
Details (expand)

Product Language

English

Version

Visual Studio 2010 Release Candidate

Operating System

Windows 7

Operating System Language

English

Steps to Reproduce

Create a SQL 2005 DB
Create logins U1 and U2
Create schemas U1 and U2
Create users U1 and U2, mapped to logins U1 and U2 having default schemas U1 and U2, respectively
Log in as U1 and create an SP called foo via 'create procedure foo as select 1'
Log in as U2 and create an SP called foo via 'create procedure foo as select 1'
Create a VS 2010 SQL 2005 Database Project
Import the database connecting as sa

Actual Results

Error 26 SQL04105: The model already has an element that has the same name dbo.Foo. c:\users\public\my documents\visual studio 2010\Projects\Database3\Database3\Schema Objects\Schemas\VSUser2\Programmability\Stored Procedures\Foo.proc.sql 1 1 Database3

Expected Results

No errors
      You can indicate your satisfaction with how Microsoft handled this issue by completing this quick 3 question survey. [Details]

 

File Attachments
0 attachments
Sign in to post a comment.
Posted by GorancoB on 2/10/2012 at 9:59 AM
As a good practice schema objects should be schema qualified. Even in duly qualified schema, the import still creates duplicate objects (not all some using VS2010 SP1). This definitly something to be looked after.
Posted by Microsoft on 3/25/2010 at 6:06 PM
Mike,

Thank you for submitting this issue. We have reproduced this issue and have added it to our product backlog. We were unable to fix this issue for Visual Studio 2010 RTM. It will be considered for the service release of Visual Studio 2010.

Thanks,

Barclay Hill
Program Manager | Visual Studio Product Team (Team Engineering - Database Tools) | Microsoft Corporation
Posted by Microsoft on 2/10/2010 at 7:02 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.