Solved

delete stored procedure then re-create it

Posted on 2011-02-23
4
299 Views
Last Modified: 2012-06-27
SQL SERVER EXPRESS 2005

I would like to delete the currect stored procedure below and then create it again...

Is this possible...I would like to do it without opening sql server express if possible ?

Thanks
fordraiders
USE [DescMatchGisXref]
GO
/****** Object:  StoredProcedure [dbo].[get_View_SAP_Data_Grid1]    Script Date: 02/23/2011 11:16:58 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[get_View_SAP_Data_Grid1]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[get_View_SAP_Data_Grid1] @param3 nvarchar(100)  
AS	
SELECT dbo.MfrnumXrefKey.MFRNUM, dbo.SapData.MFRNAME, dbo.SapData.WWGDESC, dbo.SapData.ITEM, dbo.SapData.XREF, dbo.SapData.SPIN, 
dbo.SapData.REDBOOKNUM, dbo.SapData.WWGMFRNAME, dbo.SapData.WWGMFRNUM, WwgExtra.dbo.SapAltData.ALT1, 
WwgExtra.dbo.SapAltData.ALT1SPIN, dbo.SapData.RICHTEXT, dbo.SapData.COMMENTS, WwgExtra.dbo.SapAltData.ALT1DESC, 
WwgExtra.dbo.SapAltData.ALT1DESC2, WwgExtra.dbo.WwgExtra.GREEN, WwgExtra.dbo.WwgExtra.SEGMENT, 
WwgExtra.dbo.WwgExtra.PRIVATE_LABEL
FROM dbo.MfrnumXrefKey INNER JOIN 
dbo.SapData ON dbo.MfrnumXrefKey.MFRNUM = dbo.SapData.MFRNUM INNER JOIN
WwgExtra.dbo.WwgExtra ON dbo.SapData.ITEM = WwgExtra.dbo.WwgExtra.ITEM INNER JOIN
WwgExtra.dbo.SapAltData ON WwgExtra.dbo.WwgExtra.ITEM = WwgExtra.dbo.SapAltData.ITEM
WHERE SapData.MFRNUM = '''' + @param3 + ''''
' 
END

Open in new window

0
Comment
Question by:fordraiders
[X]
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
  • 2
  • 2
4 Comments
 
LVL 32

Accepted Solution

by:
Ephraim Wangoya earned 500 total points
ID: 34962726


drop procedure get_View_SAP_Data_Grid1

--then recreate
0
 
LVL 3

Author Comment

by:fordraiders
ID: 34962762
can I run this outside of sql server express without opening it ?
0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 34962789

You have to have some kind of interface to execute the command in. Either its powershell, your custom application or SQL Management Studio
0
 
LVL 3

Author Closing Comment

by:fordraiders
ID: 34963164
worked great Thanks !
0

Featured Post

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

Suggested Solutions

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 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