Thursday, January 25, 2018

Executing a stored procedure in Microsoft SQL Operations Studio(SQLOPS)

Executing a stored procedure is as easy as running query in SQLOPS.

For example, I restored the Northwind database from a backup file from CodePlex site to the default instance of SQL Server 2017 Developer's Edition.

I connected to the SQL Server 2017 in Microsoft SQLOPS as shown. Here you can see all the objects in the server.



SP_SQLOPS_0

Right click the stored procedure (herein, dbo.CustOrderHist) to display a pick list as shown.



SP_SQLOPS_1

Click Script as Execute.
A query is created as shown:


SP_SQLOPS_2

In the TODO section add-in the value of CustomerID.
Look up the data type of CustomerID as shown here:


SP_SQLOPS_3


You need to modify this query somewhat to see the results (this is Preview software). Add statements to the SQLOPS created script to read as shown here:
---------------------
USE Northwnd
GO
DECLARE @RC int
DECLARE @CustomerID
nchar(5)
-- TODO: Set parameter values here.
Set @CustomerID='ALFKI'
EXECUTE @RC = [dbo].[CustOrderHist]
   @CustomerID
GO
-----------------
Now click Run and you can see the response as shown:

That's all.

No comments:

Post a Comment

Is Vector Search in SQL Server 2025 the Key to Unlocking New Data Insights?

 The advent of AI has ushered in ground breaking changes in most areas of technology. AI is synonymous with a humongous amount of data, data...