f21--修改 代理加盟的区域类型

exec sp_MSforeachdb N'use [?] select dbname = db_name(), username = user_name()'

exec master.dbo.sp_MSenum_replication_agents 1, 0, 1


-- network protocol: LPC
set quoted_identifier on
set implicit_transactions off
set cursor_close_on_commit off
set ansi_warnings on
set ansi_padding on
set ansi_nulls on
set concat_null_yields_null on
set language 简体中文
set dateformat ymd
set datefirst 7


--查询 理加盟的区域类型

use f21j
SELECT * FROM J_Merchant

--修改 代理加盟的区域类型
--要匹配的为8个字节不够尾部补空格;
--'05'要修改的数值  '03'原来的数据
--  SQL: exec sp_executesql N'UPDATE "F21J".."J_Merchant" SET "areaid"=@P1 WHERE "MerchantId"=@P2 AND "areaid"=@P3 AND "ShutName"=@P4 AND "FullName"=@P5 AND "RelName"=@P6 AND "Tel" IS NULL AND "Fax" IS NULL AND "Address" IS NULL AND "Rate"=@P7 AND "bail" IS NULL AND "s_sums" IS NULL AND "Sums"=@P8 AND "bank" IS NULL AND "account" IS NULL AND "email" IS NULL AND "m_type" IS NULL AND "backrate" IS NULL AND "backadd" IS NULL AND "backspare" IS NULL AND "backdate" IS NULL AND "bachcredit" IS NULL AND "CrDate"=@P9 AND "Comment" IS NULL AND "updatetime"=@P10 AND "begpact" IS NULL AND "endpact" IS NULL AND "havepact" IS NULL AND "leven" IS NULL AND "cwkh" IS NULL AND "cwbm" IS NULL AND "depotid"=@P11 AND "jmdepotid"=@P12 AND "parentid"=@P13 AND "lb"=@P14 AND "mhthelp"=@P15 AND "setdepotid"=@P16 AND "bhrate" IS NULL AND "freeze"=@P17 AND "aim" IS NULL AND "minaim" IS NULL AND "backspareY" IS NULL AND "backspareM" IS NULL AND "bhbackdate" IS NULL AND "bhdiscount" IS NULL AND "zbset"=@P18 AND "dl_dhrate" IS NULL AND "dl_bhrate" IS NULL AND "company" IS NULL AND "begs_sums" IS NULL AND "begsums" IS NULL AND "ctrlback" IS NULL AND "indentsums" IS NULL AND "indentRate" IS NULL AND "indentuse" IS NULL AND "roundcnt" IS NULL AND "bachcreditpec" IS NULL AND "del" IS NULL AND "onlytag" IS NULL AND "dutynums" IS NULL AND "userid" IS NULL AND "fristdate" IS NULL AND "pceid" IS NULL AND "chkid" IS NULL AND "FLastBackDate" IS NULL AND "FBackBalance" IS NULL AND "s_sumsdate" IS NULL', N'@P1 varchar(6),@P2 varchar(8),@P3 varchar(6),@P4 varchar(12),@P5 varchar(30),@P6 varchar(10),@P7 numeric(12,6),@P8 numeric(12,2),@P9 datetime,@P10 varbinary(8),@P11 varchar(8),@P12 varchar(8),@P13 varchar(8),@P14 varchar(12),@P15 varchar(10),@P16 varchar(8),@P17 bit,@P18 bit', '02', '5024J002', '04', '鞍山董慧', '鞍山董慧', '鞍山董慧  ', 0.000000, 0.00, '05 28 2010  4:55:26:497PM', 0x0000000005255BEF, '50240000', '5024J002', '5024', '加盟商', '5024J002', '50240000', 0, 0
exec sp_executesql N'UPDATE "F21J".."J_Merchant" SET "areaid"=@P1 WHERE "MerchantId"=@P2 AND "areaid"=@P3' , N'@P1 varchar(6),@P2 varchar(8),@P3 varchar(6)', '05', '5010    ', '03'

--以店铺号为条件强制无匹配赋值
exec sp_executesql N'UPDATE "F21J".."J_Merchant" SET "areaid"=@P1 WHERE "MerchantId"=@P2', N'@P1 varchar(6),@P2 varchar(8)', '02', '5010    '

你可能感兴趣的:(f21--修改 代理加盟的区域类型)