Test the stored procedure in Microsoft Sql Server Management Studio

How to check an existing stored procedure in Microsoft Sql Server Management Studio?

+4
source share
2 answers

Not sure if the best approach is here, as I do it:

You can right-click on sp> tasks> execute to> new query window. This will allow you to call SP with parameters.

Then you can make selections at different SP points for debugging.

The next way, if it's really a complicated SP, is to get the code out of the SP and just declare the variables instead of paremeters, then you can just run the TSQL directive.

Would love to hear any better ways though.

+6
source

/ MSDN ( )

Transact-SQL Transact-SQL. :

Transact-SQL.

Transact-SQL ​​ Transact-SQL, . , ​​ , , . :

USE AdventureWorks2008R2;
GO
DECLARE @EmpIDVar int;
SET @EmpIDVar = 1234;
SELECT *
FROM HumanRresources.Employee
WHERE BusinessEntityID = @EmpIDVar;

, , 10 000. Transact-SQL.

- , script, . , . :

USE AdventureWorks2008R2;
GO
CREATE PROCEDURE ParmSample @EmpIDParm int AS
SELECT BusinessEntityID, JobTitle
FROM HumanResources.Employee
WHERE BusinessEntityID = @EmpIDParm ;
GO

EXEC ParmSample @EmpIDParm = 109 ;
GO

Transact-SQL.

, C, ++, Basic Java, . , API , , Transact-SQL, , . , . API . , API .

ADO, OLE DB ODBC. - (?), Transact-SQL. . Transact-SQL. . . API DB-Library .

0

All Articles