You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sql-tools/添加新疗程.txt

24 lines
1.0 KiB

1 year ago
INSERT INTO TCourse(FId,FNo,FName,FBriefCode,FItemId,FPackId,FSequence,FTypeId,FTimes,FFreeTimes,FDurable,FValidityPeriodUnit,FValidityPeriod,FCreateDate,FExpiredDate,FDescription,FEnabled,FPrice,FAmount,FCalcMode)
SELECT dbo.FNNewId() AS FId,
I.FNo + 'L1' AS FNo,
I.FName + '-' + '<EFBFBD>Ƴ<EFBFBD>1' AS FName,
'''' AS FBriefCode,
I.FId AS FItemId,
0 AS FPackId,
1 AS FSequence,
(SELECT FId FROM TBasicType WHERE FKey = 'CourseType') AS FTypeId,
1 AS FTimes,
0 AS FFreeTimes,
0 AS FDurable,
0 AS FValidityPeriodUnit,
0 AS FValidityPeriod,
getdate() AS FCreateDate,
NULL AS FExpiredDate,
'''' AS FDescription,
1 AS FEnabled,
I.FPrice AS FPrice,
I.FPrice AS FAmount,
1 AS FCalcMode
FROM TItem AS I
WHERE FId NOT IN(SELECT FItemId FROM TCourse)