Collections:
EXECUTE - Executing Stored Procedures in SQL Server
How To Execute a Stored Procedure in SQL Server Transact-SQL?
✍: FYIcenter.com
If you want execute a stored procedure created previously, you can use the EXECUTE statement in the following formats:
EXEC procedure_name; EXECUTE procedure_name;
The key word EXEC is actually optional. So you can execute a stored procedure by just entering the procedure name as the statement. See examples in the following tutorial exercise:
USE FyiCenterData; GO -- create a quick procedure CREATE PROCEDURE date AS PRINT CONVERT(VARCHAR(20),GETDATE(),107); GO -- execute with EXEC EXEC date; GO May 19, 2007 -- execute with EXEC date; GO May 19, 2007 -- using a reserved keyword as procedure name CREATE PROCEDURE datetime AS PRINT GETDATE(); GO datetime; GO May 19, 2007 11:35PM
Looks like SQL Server allows you to reserved keywords as stored procedure names.
2017-01-05, 1309👍, 0💬
Popular Posts:
How To List All Login Names on the Server in SQL Server? If you want to see a list of all login name...
How To Create a Simple Stored Procedure in SQL Server Transact-SQL? If you want to create a simple s...
How to run Queries with "sqlcmd" tool in SQL Server? "sqlcmd" is a client tool that you can use to i...
How To Create a Dynamic Cursor with the DYNAMIC Option in SQL Server Transact-SQL? If the underlying...
What is SQL Server Transact-SQL (T-SQL)? SQL Server Transact-SQL, also called T-SQL, is an extension...