Stored Procedures not showing
Well I am not sure if I am doing something wrong but after having created a stored procedure I did the following. I hit the parse script button to check the script, it came back fine. I then executed the script which completed fine. But to my amazement the procedure did not show. I hit the refresh button to no avail I stopped and started the server services. Then I tried to run it again this time it tells me that that it allready exists. Here is the sp any help would be greatly appreciated.
SET
ANSI_NULLSONGO
SET
QUOTED_IDENTIFIERONGO
-- =============================================
-- Author: Shawn Jones
-- Create date: 03/19/06
-- Description: Update Avl Status of machine
-- =============================================
CREATE
PROCEDURE [dbo].[sp_Update_Machine_Status]-- Add the parameters for the stored procedure here@Avl
bit= False,@Name
nvarchar(50)AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from-- interfering with SELECT statements.SETNOCOUNTON;UPDATE
MachinesSET
Available= @AvlWHERE
(Name= @Name)END
GO
[2968 byte] By [
lastpick] at [2008-2-11]
Maybe a silly question, but what database context were you in when you ran the CREATE and is it the same database where you are looking for the SProc? I didn't see anything in your T-SQL that said "USE MyDatabase" so I'm wondering if you actually created the SProc in Master since that is the default context.
Mike - SQL Express team
I thought the same thing, but could not find the stored procedure anywhere. Also I need a clarification on something that is a little confusing. Lets say I have the following situation...
A stored procedure that I created for one database that I would like to use in another. If I open up that script using the sql server management express tool and highlight all the text and copy it then select the create new procedure on the "NEW" database and then proceed to paste all that text in would not forgetting to modify the appropiate information shouldn't that procedure be created in the "NEW" database? Or what if I select the create procedure and then load the saved sp. Maybe I am not being very clear here but it seems as if the sql management tool associates a user behind the scenes when a query or sp is loaded. Is this the case?