Hi, i need convert a stored procedure into a online function.
My tables are DAY01, DAY02 ... DAY31, and y need to put the SP in a select query.
the sp is:
ALTER PROCEDURE dbo.sp_get_calls
@day varchar(15)
AS
begin
declare @sql varchar(400)
set @sql = 'SELECT * FROM DAY' + @table + 'WHERE calltype = 1'
exec (@sql)
end
I realy apreciate any kind of help
My tables are DAY01, DAY02 ... DAY31, and y need to put the SP in a select query.
the sp is:
ALTER PROCEDURE dbo.sp_get_calls
@day varchar(15)
AS
begin
declare @sql varchar(400)
set @sql = 'SELECT * FROM DAY' + @table + 'WHERE calltype = 1'
exec (@sql)
end
I realy apreciate any kind of help