??洢???????????
???????????? ???????[ 2012/7/18 11:09:06 ] ????????
?????洢?????????????????sql???????????????????棬????????????洢??????????????????
?????洢????????
???????——????????????????????????????????????????????????????????????ɡ?
????????????——?????????
????????????????——???????????
?????????——???????????????????????洢??????????????????
?????????——?????????????DBO???????????SA??????????洢?????洢???????????????????????????з????????????????????????????????????????????С???????????????????????????????????
??????????????????????????洢??????м??????????С???????????????
????????????????????????????????????????????????綽???????????????????????????????????????????????????????????????????????????????????????????????????д??洢????????????
<SPAN style="FONT-SIZE: 24px">CREATE PROCEDURE [dbo].[procCardByMore]</SPAN>
@cardNo varchar (50)??
@TeacherID varchar(50)??
@Name varchar(50)??
@telephone varchar(50)
AS
DECLARE @sql varchar(1000)
SET @sql='SELECT TeacherID as ???????Name as ?????????GradeName as ????????cardNo as ?????cash as ???????realName as ???????OpenTime as ???????state as ????telephone as ????綽 FROM view_CardDetail '
IF(@cardNo <>'')
BEGIN
SET @sql=@sql+'and cardNo='''+@cardNo+''''
END
IF(@TeacherID <>'')
BEGIN
SET @sql=@sql+'and TeacherID='''+@TeacherID+''''
END
IF(@Name <>'')
BEGIN
SET @sql=@sql+'and Name='''+@Name+''''
END
IF(@Name <>'')
BEGIN
SET @sql=@sql+'and telephone='''+@telephone+''''
END
exec(@sql)
????????????翨?????????????д??????sql????????????
SELECT TeacherID as ???????Name as ?????????GradeName as ????????cardNo as ?????cash as ???????realName as ???????OpenTime as ???????state as ????telephone as ????綽FROM view_CardDetail and cardNo='@cardNo’
??????仰?????????????????????????????????where?????????????and???????????????????????????????????????????洢???????????????????
CREATE PROCEDURE [dbo].[procCardByMore]
@cardNo varchar (50)??
@TeacherID varchar(50)??
@Name varchar(50)??
@telephone varchar(50)
AS
DECLARE @sql varchar(1000)
SET @sql='SELECT TeacherID as ???????Name as ?????????GradeName as ????????cardNo as ?????cash as ???????realName as ???????OpenTime as ???????state as ????telephone as ????綽FROM view_CardDetail WHERE 1=1 '
IF(@cardNo <>'')
BEGIN
SET @sql=@sql+'and cardNo='''+@cardNo+''''
END
IF(@TeacherID <>'')
BEGIN
SET @sql=@sql+'and TeacherID='''+@TeacherID+''''
END
IF(@Name <>'')
BEGIN
SET @sql=@sql+'and Name='''+@Name+''''
END
IF(@Name <>'')
BEGIN
SET @sql=@sql+'and telephone='''+@telephone+''''
END
exec(@sql)
???????????г????????????????
SELECT TeacherID as ???????Nameas ?????????GradeName as ????????cardNo as ?????cashas ???????realName as ???????OpenTime as ???????stateas ????telephone as ????綽FROM view_CardDetail WHERE 1=1and cardNo ='+@cardNo+'
?????????????????????????????????????????“1=1“????????????????????y???????????????????ξ??檔
????????????????????????????????????
?????????????????????????????????????????????????????????????????
?????洢??????????£?
CREATE PROCEDURE [dbo].[procConsumeByMore]
@TeacherID varchar(50)??
@TimeStart datetime??
@TimeEnd datetime
AS
DECLARE @sql varchar(1000)
SET @sql='SELECT TeacherID as ???????Name as ?????????orderID as ????????adultNum as ??????????childNum as ?????????consumeCash as ??????consumeTime as ???????userID as ?????????realName as ?????????FROM view_consumeDetail WHERE 1=1 '
IF(@TeacherID <>'')
BEGIN
SET @sql=@sql+'and TeacherID ='''+@TeacherID+''''
END
IF( @TimeStart<>null and @TimeEnd<>null)
BEGIN
SET @sql=@sql+'and consumeTime between '''+@TimeStart +''' and '''+@TimeEnd+''''
END
exec(@sql)
????????@TimeStart??@TimeEnd??????????????????????????????????????????????????????????????????????????
exec procConsumeByMore ''?? '1799-01-01'??'9999-12-29'
????????????????????????е??????????
?????????????????б??????????????????????????????????????????????????????????????????
??????????????????ζ????????壬???????????鶯???????????????????????λ?????????????????????????‘???????????????????????’????????????????????????????????????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11