Posts tagged Stored Procedure
Do you want to execute a Stored Procedure as part of a SELECT statement??
01 year ago
in Transact-SQL
I was on a training course at the end of September, and came across a way to execute a simple stored procedure as part of a select statement using an Inline Table Valued Function.
You (like me) have probably tried to run the following statement expecting to get results from a stored procedure:
USE [...]
Sort results based on a Stored Procedure parameter
01 year ago
in Transact-SQL
If you want to be able to specify the sort criteria for the results returned from a stored procedure, based on a provided parameter, you might want to try using the QUOTENAME function.
Example:
Firstly, here is the declaration (it can easily be changed into a stored procedure):
DECLARE @OrderBy [...]
Create a stored procedure using a parameter default of NULL
03 years ago
in Transact-SQL
The default value of a parameter can be specified as NULL. In this case, if you do not supply a parameter, SQL Server executes the stored procedure according to its other statements. No error message is displayed.
The procedure definition can also specify that some other action be taken if you do [...]