好吧,假设您使用的是 SSMS,那么您可以这样做:将 EXEC 命令放在一行中,将参数替换为“#”,然后剪切并粘贴该行 100 次。然后用列表中的实际参数替换“#”并执行。
这是一个包含 10 行代码的示例,可帮助您入门:
USE [Students]
GO
DECLARE @rt int
EXEC @rt = [School].[Student_Entry] @StudentName=N'#', @StudentClass=N'#'; SELECT 'Return Value'=@rt
EXEC @rt = [School].[Student_Entry] @StudentName=N'#', @StudentClass=N'#'; SELECT 'Return Value'=@rt
EXEC @rt = [School].[Student_Entry] @StudentName=N'#', @StudentClass=N'#'; SELECT 'Return Value'=@rt
EXEC @rt = [School].[Student_Entry] @StudentName=N'#', @StudentClass=N'#'; SELECT 'Return Value'=@rt
EXEC @rt = [School].[Student_Entry] @StudentName=N'#', @StudentClass=N'#'; SELECT 'Return Value'=@rt
EXEC @rt = [School].[Student_Entry] @StudentName=N'#', @StudentClass=N'#'; SELECT 'Return Value'=@rt
EXEC @rt = [School].[Student_Entry] @StudentName=N'#', @StudentClass=N'#'; SELECT 'Return Value'=@rt
EXEC @rt = [School].[Student_Entry] @StudentName=N'#', @StudentClass=N'#'; SELECT 'Return Value'=@rt
EXEC @rt = [School].[Student_Entry] @StudentName=N'#', @StudentClass=N'#'; SELECT 'Return Value'=@rt
EXEC @rt = [School].[Student_Entry] @StudentName=N'#', @StudentClass=N'#'; SELECT 'Return Value'=@rt
GO