Guest User

Untitled

a guest
Jul 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. EXEC ('StoredProcedure @Keyword = ''' + @Key + '''')
  2.  
  3. exec('exec <your stored procedure goes here>; select @@RowCount')
  4.  
  5. exec(`
  6. declare @t table (
  7. <columns go here>
  8. );
  9.  
  10. insert into @t
  11. exec(''<your exec here>'');
  12.  
  13. select @rowcount
  14. ');
  15.  
  16. declare @sql nvarchar(max) = N'exec '+@YOURQUERY + '; set @RowCount = @@RowCount';
  17.  
  18. exec sp_executesql @sql, N'@RowCount int output', @RowCount = RowCount output;
  19.  
  20. CREATE PROC PawanXX
  21. (
  22. @a INT
  23. ,@b INT OUTPUT
  24. )
  25. AS
  26. BEGIN
  27.  
  28. SELECT TOP 2 * FROM X
  29.  
  30. SET @b = @@ROWCOUNT
  31.  
  32. RETURN @b
  33.  
  34. END
  35. GO
  36.  
  37. DECLARE @RC int
  38. DECLARE @a int
  39. DECLARE @b int
  40.  
  41. EXECUTE @RC = [dbo].[PawanXX]
  42. @a
  43. ,@b OUTPUT
  44.  
  45. SELECT @RC
Add Comment
Please, Sign In to add comment