473,569 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Where the !@?!@ is my Stored Procedure?

Hi,

I wrote the following in the SQL Server 2005 Express Management Studio
Query Analyzer
and hit execute. Even though Query Analyzer indicated success when I
hit refresh on the stored procedure folder the procedure does not show
up in the stored procedure list. When I entered 'exec Test' I get an
error indicating that SQL Server 2005 can't find the procedure. I
executed the following code 'select * from sys.all_objects where name
like '%Test%'' and the object is not in the returned result. So I tried
to execute the code again, and lo and behold, SQL Server gives me the
following error - There is already an object named 'Test' in the
database. What the hell?

Thanks,
Frustrated

-- =============== =============== =============== ===
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- =============== =============== =============== ===
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFI ER ON
GO
-- =============== =============== ===============
-- Author: <Author,,Name >
-- Create date: <Create Date,,>
-- Description: <Description, ,>
-- =============== =============== ===============
CREATE PROCEDURE dbo.Test
-- Add the parameters for the stored procedure here
--<@Param1, sysname, @p1> <Datatype_For_P aram1, , int> =
<Default_Value_ For_Param1, , 0>,
--<@Param2, sysname, @p2> <Datatype_For_P aram2, , int> =
<Default_Value_ For_Param2, , 0>
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
-- SELECT <@Param1, sysname, @p1>, <@Param2, sysname, @p2>

-- blah, blah
END
GO

Dec 21 '05 #1
2 2738
Responding to my own post - I created a store procedure and deleted it
then couldn't locate it. I guess if you don't specify the database and
owner, by default the stored procedure is copied into the Master
database under system stored procedures (!), so if you can't find your
stored procedure, this is probably a good place to look.

Still perplexed about why users are allowed to store stuff in the
System Procedure folder and why this is where procedures with
unqualified names are stored by default.

Dec 21 '05 #2
Crazy Cat (da******@hotma il.com) writes:
Responding to my own post - I created a store procedure and deleted it
then couldn't locate it. I guess if you don't specify the database and
owner, by default the stored procedure is copied into the Master
database under system stored procedures (!), so if you can't find your
stored procedure, this is probably a good place to look.

Still perplexed about why users are allowed to store stuff in the
System Procedure folder and why this is where procedures with
unqualified names are stored by default.


First or all, there is no System Procedure folder, really. That is
just a visualization in Mgmt Studio.

Users are indeed permitted to create objects in the master database
if they have permissions. And, assuming that you have SQL Express on
your own machine, you presumably belong to BUILTIN\Adminis trators on
the box, and thus you have sysadmin when you log in with Windows
Authentication. And then you may indeed create procedures in the master
database.

Mgmt Studio has a dropdown which tells you the current database, and
this also displays on the tab, although it may be compressed. The Object
Explorer is not related to the query window.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Dec 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4262
by: Rhino | last post by:
I've written several Java stored procedures now (DB2 V7.2) and I'd like to write down a few "best practices" for reference so that I will have them handy for future development. Would the experts here agree with the following? Would they add any other points? 1. If the shop standard calls for logging of application errors, a stored...
4
3177
by: Rhino | last post by:
Is it possible for a Java Stored Procedure in DB2 V7.2 (Windows) to pass a Throwable back to the calling program as an OUT parameter? If yes, what datatype should I use when registering the Throwable as an OUT parameter and what datatype should I use in the CREATE PROCEDURE and DROP PROCEDURE statements? Here's what I tried: - the method...
8
7910
by: Thomasb | last post by:
With a background in MS SQL Server programming I'm used to temporary tables. Have just started to work with DB2 ver 7 on z/OS and stumbled into the concept of GLOBAL TEMPORARY TABLE. I have created a temporary database with a tables space. Verified that DECLARE GLOBAL TEMPORARY TABLE TEMP (A INTEGER); INSERT INTO SESSION.TEMP VALUES(10);...
5
3381
by: Rhino | last post by:
I am trying to determine the behaviour of stored procedures in DB2 V8.2.x in Windows/Unix/Linux and how I can control that behaviour. Some documentation in the manuals is confusing the issue somewhat. First, am I right in understanding that the normal behaviour of a stored procedure, fenced or unfenced, is to only go into memory when it is...
3
3465
by: kd | last post by:
Hi All, How to debug a stored procedure? Thanks, kd
9
4133
by: fniles | last post by:
I am using VB.NET 2003 and SQL2000 database. I have a stored procedure called "INSERT_INTO_MYTABLE" that accepts 1 parameter (varchar(10)) and returns the identity column value from that table. When calling the stored procedure from VB.NET, in the CommandText, can I just say "INSERT_INTO_MYTABLE '12345'" instead of calling it with...
9
8964
by: jyothi1105 | last post by:
Hi all, Here is some information which could help people who want to create stored procedures and execute them in their program. You can create stored procedures in two ways: Through front end or writing procedure from backend SQLServer. Back End First we'll cover how to write a stored procedure in back end. The following example is...
1
2647
by: Sureshbari | last post by:
Dear All, I have four table in database , each table contain the 5 lacs record, i have created a view on that four table using union clause. and now i am call that view form my code like select * form myview where name like '%Xya%' after that i am getting the memory fault .
2
4072
by: acw | last post by:
On a SQL Server 2000 db I would like to setup a stored procedure that accesses couple tables and runs the extended stored procedure xp..cmdshell. The goal is to grant users with limited privileges the right to run the stored procedure but not the rights to directly access either the referenced tables or the extended stored procedure. TIA!
0
7701
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.