Solved

delete stored procedure then re-create it

Posted on 2011-02-23
4
297 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
  • 2
  • 2
4 Comments
 
LVL 32

Accepted Solution

by:
ewangoya 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:ewangoya
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

816 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now