Reputation: 87
I run some stored procedures with the same parameters on a consistent basis in SQL Server 2017. I wanted to know how to create a synonym for a stored procedure with hard-coded parameters. For simplistic example, I have this stored procedure with these parameters:
EXEC xp_readerrorlog 0, 1, N'Server is listening on '
I want to know how I can create a synonym for this entire statement. Thank you.
Upvotes: 1
Views: 1323
Reputation: 33571
You can't do that with a synonym. But nothing says you can't create your own procedure.
create procedure MyLogReader as
set nocount on;
EXEC xp_readerrorlog 0,1,N'Server is listening on ';
Upvotes: 6