Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Adding SQL Objects to VS201 errors Expand / Collapse
Author
Message
Posted Monday, August 09, 2010 11:54 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Monday, December 30, 2013 2:21 PM
Points: 552, Visits: 197
I am trying to add database objects of existing SQL database to source control.

Here are the steps I am using:
1: create new database project
2: add dbschemas for master and model databse
3: add dbschema for tempdb database (from master.dbschema)

4: Import database objects and settings

I am able to import all objects but I receive errors when trying to build solutions. All these errors related to INFORMATION_SCHEMA or SYS.XXX objects.

Database: SQL 2008

Anyone else faced the same issue(s) and have any suggestions?

Some errors are:


Error 98 SQL03006: View: [dbo].[XXX_vw] has an unresolved reference to object [SYS].[FOREIGN_KEYS]. C:\Projects\..\Schema Objects\Schemas\dbo\Views\XXX_vw.view.sql 8 6 DB_NAME


Error 100 SQL03006: View: [dbo].[XXX_vw] contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [SYS].[FOREIGN_KEY_COLUMNS].[FC]::[Column_Name], [SYS].[FOREIGN_KEY_COLUMNS].[Column_Name] or [SYS].[FOREIGN_KEYS].[FC]::[Column_Name]. C:\Projects\..\Schema Objects\Schemas\dbo\Views\XXX_vw.view.sql 3 20 DB_NAME


Error 105 SQL03006: View: [dbo].[XXX_vw] contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [SYS].[FOREIGN_KEY_COLUMNS].[FC]::[REFERENCED_COLUMN_ID], [SYS].[FOREIGN_KEY_COLUMNS].[REFERENCED_COLUMN_ID] or [SYS].[FOREIGN_KEYS].[FC]::[REFERENCED_COLUMN_ID]. C:\Projects\..\Schema Objects\Schemas\dbo\Views\XXX_vw.view.sql 6 35 DB_NAME


Warning 39 SQL04151: Procedure: [dbo].[XXX_SP] contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [dbo].[TABLE_NAME_1].[SO]::[xtype], [dbo].[TABLE_NAME_2].[SO]::[xtype], [dbo].[sysobjects].[SO]::[xtype] or [dbo].[SYSOBJECTS].[XTYPE]. C:\Projects\..\Schema Objects\Schemas\dbo\Programmability\Stored Procedures\XXX_SP.proc.sql 152 8 DB_NAME


Warning 46 SQL04151: Procedure: [dbo].[XXX_SP] has an unresolved reference to object [#TEMP_TABLE]. C:\Projects\..\Schema Objects\Schemas\dbo\Programmability\Stored Procedures\XXX_SP.proc.sql 61 7 DB_NAME


C:\Projects\..\SCHEMA OBJECTS\SCHEMAS\DBO\PROGRAMMABILITY\FUNCTIONS\UDF_XXX.FUNCTION.SQL(39,8): Warning SQL04151: Function: [dbo].[UDF_XXX] contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [MASTER].[dbo].[SYSMESSAGES].[SL]::[NAME], [sys].[syslanguages].[NAME] or [sys].[syslanguages].[SL]::[NAME].

C:\Projects\..\SCHEMA OBJECTS\SCHEMAS\DBO\PROGRAMMABILITY\STORED PROCEDURES\DT_WHOCHECKEDOUT.PROC.SQL(20,84): Warning SQL04151: Procedure: [dbo].[dt_whocheckedout] has an unresolved reference to object [dbo].[dtproperties].[property].


Thanks in advance!



Post #966147
Posted Tuesday, July 23, 2013 12:23 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, March 27, 2014 3:54 PM
Points: 2, Visits: 20
Did you ever resolve this? I have a similar issue with VS2012 giving me warning messages about resolving sys.partitions from within a user defined function (UDF) definition. The actual code works if queried directly, and the UDF defined from the code works just fine, but the warning messages in VS2012 regarding the inability to resolve the reference to a system catalog piece in disconcerting.

Thanks!
Post #1476749
Posted Saturday, March 15, 2014 12:56 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, April 10, 2014 5:50 AM
Points: 1, Visits: 3
I had a similar issue and could solve it by adding master-db as database reference (right click on references -> add database reference -> selecting master in System database).

Please note:
1.) as I'm using VS2010 the way of adding a database reference could be different
2.) I'm still struggling with some sys.-objects; e.g. any usage of sys.syslanguages leads still to a warning "unresolved reference ..."

any hints on this are welcome

Hope that helps!
regards,
Gregor
Post #1551517
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse