[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 370
  • Last Modified:

how to check store procedure exist or not and how to create with vb.net

HI,
Expert

I need to create store procedure thru vb.net , and check to store procedre exist or not

i am useing sql 2005 and vb.net please help me
0
JAYANSPX
Asked:
JAYANSPX
  • 2
  • 2
1 Solution
 
amritgillCommented:
u can try using the follwing...
u will have to replace aaa with your proc name
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[aaa]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[aaa]
GO

Create Proc aaa
...


0
 
JAYANSPXAuthor Commented:
thank

but i need code in vb.net  
0
 
amritgillCommented:
u can use the if exist scenario in vb.net also it should work
0
 
JAYANSPXAuthor Commented:
ok
thank's a lot

0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now