存储过程中参数输出的问题 ( 积分: 50 )

  • 主题发起人 主题发起人 ljzboy
  • 开始时间 开始时间
L

ljzboy

Unregistered / Unconfirmed
GUEST, unregistred user!
小弟遇到一个参数输出的问题,问题出在输入参数是real的问题上:
CREATE PROCEDURE dbo.sp_mc_rating
@mkt varchar(30),
@channelname varchar(10),
@target1 varchar(10),
@virtime real,
@spottime real,
@Rtg1 char(10)='' output
AS
declare @SQL varchar(8000)
set @SQL='select '''+(@Rtg1)+'''=cast('+@mkt+'.rating as char(10)) from '+@mkt+' where target='''+@target1+''' and channelname='''+@channelname+''' and daypart>'''+@virtime+''' and daypart<='''+@spottime+''''
exec(@SQL)
GO

问题就在@virtime和@spottime这两个变量在过程中应该怎么写。就差这一点点了,请指教
谢谢!
 
CREATE PROCEDURE dbo.sp_mc_rating
@mkt varchar(30),
@channelname varchar(10),
@target1 varchar(10),
@virtime real,
@spottime real,
@Rtg1 char(10)='' output
AS
declare @SQL varchar(8000)
set @SQL='select '''+(@Rtg1)+'''=cast('+@mkt+'.rating as char(10)) from '+@mkt+' where target='''+@target1+''' and channelname='''+@channelname+''' and daypart>'''+ Convert(nvarchar(20), @virtime) +''' and daypart<='''+ Convert(nvarchar(20), @spottime) +''''
exec(@SQL)
GO
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
947
SUNSTONE的Delphi笔记
S
I
回复
0
查看
860
import
I
后退
顶部