Home Forums SQL Server 2012 SQL 2012 - General Initialize sp parameter using a select statement RE: Initialize sp parameter using a select statement
John Mitchell-245523
SSC Guru
Points: 148809
More actions
December 20, 2014 at 3:26 am
#1765838
You could put some control flow in your procedure, so that if a value for @top is passed, it used, but if it's null, the query is executed without the TOP clause.
John