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/问候语.sql

68 lines
2.3 KiB

UPDATE TReceiptGreetings SET FContent = ' '
delete TReceiptGreetings
SELECT * FROM TWeChatAppInfo
SELECT ISNULL( (SELECT CAST(MAX(CAST(FRowVersion AS BIGINT)) AS VARCHAR(20)) FROM TReceiptGreetings WITH(NOLOCK) WHERE 1=1 ) ,'')
+ '' + (SELECT CAST(p.rows AS VARCHAR)
FROM sys.indexes i, sys.partitions p
WHERE i.object_id = object_id('TReceiptGreetings')
AND p.object_id = i.object_id
AND is_primary_key = 1
AND p.index_id = i.index_id)
SELECT CAST(MAX(CAST(FRowVersion AS BIGINT)) AS VARCHAR(20)) FROM TReceiptGreetings
UPDATE TWeChatAppConfig SET FValue = '匠人组合双十一限量秒杀,先到先得,抓紧抢购'
WHERE FKEY = 'MallShareTitle'
select * from TWeChatAppConfig
ALTER TABLE TWeChatAppConfig ADD FRowVersion ROWVERSION
IF NOT EXISTS(SELECT 1 FROM TReceiptGreetings)
BEGIN
SELECT * FROM TSystemParam WHERE FKey LIKE '%Greetings%'
SELECT * FROM TSystemParamSub WHERE FParamKey LIKE '%Greetings%'
DELETE TReceiptGreetings
INSERT TReceiptGreetings(FCompId,FName,FContent)
SELECT FCompId,REPLACE(FParamKey,'ReceiptGreetings',''),FValue
FROM TSystemParamSub
WHERE FParamKey LIKE '%ReceiptGreetings%'
INSERT TReceiptGreetings(FCompId,FName,FContent)
SELECT C.FId,REPLACE(A.FKey,'ReceiptGreetings',''),A.FValue
FROM TSystemParam AS A,TCompany AS C
WHERE A.FKey LIKE '%ReceiptGreetings%'
AND C.FId > 0
AND NOT EXISTS(SELECT 1 FROM TReceiptGreetings AS B WHERE B.FCompId = C.FId AND B.FName = REPLACE(A.FKey,'ReceiptGreetings',''))
SELECT * FROM TReceiptGreetings
UPDATE TReceiptGreetings SET FContent = ''
SELECT * FROM TReceiptGreetings
END
use zhengzhou_jiangrenzuhe
IF OBJECT_ID(''dbo.TReceiptGreetings'') IS NOT NULL
BEGIN
DROP TABLE TReceiptGreetings
END
CREATE TABLE dbo.TReceiptGreetings
(
FCompId DT_Id not null,
FName VARCHAR(128) not null,
FContent VARCHAR(7500) not null,
FRowVersion ROWVERSION not null,
CONSTRAINT PK_RECEIPT_GREETINGS PRIMARY KEY (FCompId, FName)
)