I am quite new to SQL Server and definitely new writing stored procedures.
I have written a stored procedure in the Query window in SQL Server Mangement Studio Express where I am just pulling the sales from the Sales table:
Then I opened a new query window where I wrote:
So everything works, it looks good and is returning the right data. So I did a "Save All" and it saves all of this as a query in a folder on my computer.
My question is, where does the DB save the Stored Procedure that I created? I can't find it in any of the Folders in SQL Express Management studio. When I drill down in Databases->myDB->Programmability->Stored Procedures->System Stored Procedures ... I can't find my stored procedure...
This doesn't seem right, because if I close out of Management studio, and then open a Query window and perform the EXEC statement from above it works... So, the database is storing this "Stored Procedure" somewhere, hence I should be able to just find the StoredProcedure and edit it in management studio correct? Do I have open my query that i saved locally so I can edit the Stored Procedure???
Z
I have written a stored procedure in the Query window in SQL Server Mangement Studio Express where I am just pulling the sales from the Sales table:
Code:
CREATE PROC GET_ALL_SALES_STATUS
(
@Status INT
)
AS
SELECT * FROM Sales
WHERE StatusID = @Status
GO
Then I opened a new query window where I wrote:
Code:
USE myDB
EXEC GET_ALL_SALES_STATUS 2
So everything works, it looks good and is returning the right data. So I did a "Save All" and it saves all of this as a query in a folder on my computer.
My question is, where does the DB save the Stored Procedure that I created? I can't find it in any of the Folders in SQL Express Management studio. When I drill down in Databases->myDB->Programmability->Stored Procedures->System Stored Procedures ... I can't find my stored procedure...
This doesn't seem right, because if I close out of Management studio, and then open a Query window and perform the EXEC statement from above it works... So, the database is storing this "Stored Procedure" somewhere, hence I should be able to just find the StoredProcedure and edit it in management studio correct? Do I have open my query that i saved locally so I can edit the Stored Procedure???
Z