1

I had on another PC a database which did contain a stored procedure, I could see it in the object explorer of MS SQL Server Management Studio like in the picture below: enter image description here

My web-application connected to the SQL database executes this procedure sql.execute("dbo.calculateLiftUp")

Now I switched everything to another location and the old Database is gone. I a new instance of a MS SQL Server 2008R2 database and I created a new database.

Now I need to add to this database test_db( which has no stored procedure in the moment ) my dbo.calculateLiftUp stored procedure from this file calculateLiftUp.sql

enter image description here

I worked with this manual: http://msdn.microsoft.com/en-us/library/ms345415%28v=sql.105%29.aspx I followed the steps, pasted the code from the calculateLiftUp.sql file into the new stored procedure and everything was possible until:

8.To create the stored procedure, on the Query menu, click Execute.

The problem is that the stored procedure wants to ALTER PROCEDURE [dbo].[calculateLiftUp] which is not possible because the stored procedure does not exist. But regarding to the manual you have to execute the stored procedure in order to create it.

enter image description here

My question is: How can I add this file calculateLiftUp.sql as a stored procedure into a database.

4

0 回答 0