Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2008-06-15
4
353 Views
Last Modified: 2013-11-26
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
Comment
Question by:JAYANSPX
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
amritgill earned 250 total points
ID: 21790882
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
 

Author Comment

by:JAYANSPX
ID: 21790926
thank

but i need code in vb.net  
0
 
LVL 3

Expert Comment

by:amritgill
ID: 21791014
u can use the if exist scenario in vb.net also it should work
0
 

Author Comment

by:JAYANSPX
ID: 21791648
ok
thank's a lot

0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question