Jump to content

Stored Procedure Help ?


vijay
 Share

Recommended Posts

HiMy question is like this which is proper way and which one is more faster(1)/(2) from following:(1.) Assume that @qry is large and complex using join and typical conditionscreate proc proc_name @qry varchar(8000)as select * into temp from table1 execute (@qry) drop table tempgo(2) Now in this create proc proc_name @param1,@param2,....as declare @qry varchar(8000) select * into temp from table1 -- here I am set query in var @qry set @qry= select * from tablename if(@param1= something) begin set @qry= @qry + 'where some='+@param1+... end ................ ................ ................ .. .. .. drop table tempgoSo Now tell me which one is appropriate/proper and more faster ?Regards,Vijay

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...