Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How to Exclude Procedure in sql server ?
Posted
Comments
Prerak Patel 12-Aug-11 3:15am    
Elaborate more.
Abhinav S 12-Aug-11 3:32am    
What do you mean by exclude?
Do you mean Drop?

 
Share this answer
 
Comments
jacky4lad 17-Aug-11 2:28am    
Hi, Thanks for Reply but Actually I want to Exclude or Include Procedure in Sql server when I needed. as Example In asp.net project Right Click on WebPage or WebForm It's Display Message Exclude From Project or Include In Project
 
Share this answer
 
Comments
jacky4lad 17-Aug-11 2:28am    
Hi, Thanks for Reply but Actually I want to Exclude or Include Procedure in Sql server when I needed. as Example In asp.net project Right Click on WebPage or WebForm It's Display Message Exclude From Project or Include In Project
You can delete a stroed procedure from your database with the DROP PROCEDURE[^] statement.

Be aware that you cannot retrieve it once it has been deleted!
 
Share this answer
 
Comments
jacky4lad 17-Aug-11 2:28am    
Hi, Thanks for Reply but Actually I want to Exclude or Include Procedure in Sql server when I needed. as Example In asp.net project Right Click on WebPage or WebForm It's Display Message Exclude From Project or Include In Project
OriginalGriff 17-Aug-11 4:43am    
You can't: they are either there or not.
The best you could do is probably rename them - but the procedure would still be there.
If you feel the need to include and exclude stored procedures, then you probably have the wrong idea about them completely - the idea is they are there for all users, at all times, rather than switched on and off on a per-user basis.
I think you want to hide the stored procedure from application.
DROP or RENAME the stored procedure
To Drop
SQL
DROP PROCEDURE StoredProcedureName;

To Rename
SQL
EXEC sp_rename 'StoredProcedureOldName', 'StoredProcedureNewName';
 
Share this answer
 
Comments
jacky4lad 17-Aug-11 2:29am    
Hi, Thanks for Reply but Actually I want to Exclude or Include Procedure in Sql server when I needed. as Example In asp.net project Right Click on WebPage or WebForm It's Display Message Exclude From Project or Include In Project

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