sql server - SQL Converting a Function to a Stored Procedure -


i have function has 3 parameters want put ssrs using bids.

i need function converted stored procedure cannot work.

inside select statement have deleted in example below 3000 lines of code lots of individual selects , sub queries.

the create script function below.

use [server1] go  /****** object:  userdefinedfunction [dbo].[newfunction]    script date: 04/10/2014 11:49:21 ******/ set ansi_nulls on go  set quoted_identifier on go  create function [dbo].[newfunction] ( @start datetime,  @end datetime,  @name int  )  returns table return (  select bla, bla, bla lots of selects , sub querys in here     t1 left outer join t2 on t1.f1 = t2.f1  left outer join t3 on t1.f1 = t3.f1   f1 in (@name) )  go 

the syntax stored procedure is:

create procedure [dbo].[newprocedure] ( @start datetime,  @end datetime,  @name int  )  select bla, bla, bla lots of selects , sub querys in here     t1 left outer join t2 on t1.f1 = t2.f1  left outer join t3 on t1.f1 = t3.f1  f1 in (@name) 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -