Click here to Skip to main content
15,908,013 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I have a SQL database project in visual studio 2015.On compiling the project not showing the error for the missing table object.
A stored procedure using a table which is deleted form project and after the compilation it is not showing the error.

Does it is possible to find out the missing object reference on the compile time in sql database project ?

What I have tried:

1. Create a database project.
2. Delete the table from project which is already used by a stored procedure.
3. Compile the project.
Posted
Updated 2-Jun-20 0:08am

1 solution

If the table is in your database then you can;t check for it at compile time, only at run time.
The compiler does not open or attempt to open any connection to your database - it not only doesn't know the connection string, it has no idea to to communicate with your DB at all!

So no: you can't check a table exists at compile time. Even if you could - which you can't - it would be of no use, as the table could be deleted thirty seconds later and the EXE file would still be the same.
 
Share this answer
 
Comments
Siddharth Rai 2-Jun-20 8:31am    
Thank you such much for help,
Sir, but i am asking about my database project solution.
Example: i have table Product.sql in Table directory and Stored procedure PROC_PRODUCT.SQL in Stored Procedure Directory.
both are in same solution . and PRC_PRODUCT.sql is using Product table.

once i am deleting the table Product.sql from table directory and build the project. it is not showing error .

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900