I created a UDF that accesses the view [INFORMATION_SCHEMA].[TABLES] :
CREATE FUNCTION [dbo].[CountTables] ( @name sysname ) RETURNS INT AS BEGIN RETURN ( SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = @name ); END
In Visual Studio, the schema and name for the view are marked with a warning:
SQL71502: Function: [dbo]. [CountTables] has an unresolved object reference [INFORMATION_SCHEMA]. [TABLES].
I can still publish the database project without any problems, and the UDF seems to work correctly. IntelliSense fills in the view name for me, so it has no problem with it.
I also tried changing the implementation to use sys.objects instead of this view, but I was also given the same warning for this view.
How can I resolve this warning?
sql sql-server tsql ssdt
Sam Aug 07 '13 at 6:21 2013-08-07 06:21
source share