Why does my CLR function keep disappearing
I am a rookie to SQL and here is my questions.
I have some CLR sql functions and procedures. When I deploy the 1st one, everything is fine. But after the 2nd one deployed, the first one will disappear.
Anyone can help me out?
Thanks a lot
Actually, I simply create a new SQL project in VS, adding a new function or stored procedure, click deploy, and I can see the new function in my SQL instance. Then I close that project and open a new one, repeat the above steps, OK, the 2nd function is there i my instance but the 1st one disappeared or be replaced and no longer queryable for use.
Thank you for your reply.
All these clr functions and procedures are in the same instance 开发者_StackOverflow中文版of the database.
It sounds like you have 2 DB projects associated with the same database. Each DB project will be saying 'make the database look like this project' and therefore deleting the existing objects.
If you're using VS 2010 the following might help you...
- Go to the Deploy tab of your project properties
- Click to edit your 'deployment configuration file'
- Uncheck 'Always re-create database'
- Uncheck Generate DROP statements for objects that are in the target database but that are not in the database project.
精彩评论