朱头 发表于 2021-4-6 12:52

通过SQL Server Profiler 跟踪到些事件 但数据表中没有相应的列

本帖最后由 朱头 于 2021-4-6 13:52 编辑

事件跟踪到的表名比实际的表名多出来,不知道这些是什么原因呢?


事件跟踪到的insert语句
exec sp_executesql N'INSERT INTO "SD11102N_09ZB".."#saledetail" ("action","updateflag","invoiceid","itemno","goodsid","unitid","aprice","disc","price","quantity","unitprice","unitqty","taxrate","goodsamt","taxamt","amount","refertype","referbillid","referitemno","ispresent","returnqty","refercount","nprice","scorerate") VALUES (@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10,@P11,@P12,@P13,@P14,@P15,@P16,@P17,@P18,@P19,@P20,@P21,@P22,@P23,@P24)',N'@P1 int,@P2 varchar(77),@P3 int,@P4 int,@P5 int,@P6 int,@P7 numeric(18,6),@P8 numeric(18,6),@P9 numeric(18,6),@P10 numeric(18,6),@P11 numeric(18,6),@P12 numeric(18,6),@P13 numeric(18,6),@P14 numeric(18,6),@P15 numeric(18,6),@P16 numeric(18,6),@P17 int,@P18 int,@P19 int,@P20 varchar(1),@P21 numeric(18,6),@P22 int,@P23 numeric(18,6),@P24 numeric(18,6)',2,'11111111111111111111111111101000000000000010000000000001111111111111000100010',-1,-1,6330,6472,0.000000,100.000000,54000.000000,1.000000,54000.000000,1.000000,0.000000,54000.000000,0.000000,54000.000000,1,24283,1,'F',0.000000,0,54000.000000,1.000000


数据表 结构为:
CREATE TABLE .(
. NOT NULL,
. NOT NULL,
. NOT NULL,
. NOT NULL,
. NOT NULL,
. NOT NULL,
. NOT NULL,
. NOT NULL,
. NOT NULL,
. NOT NULL,
. NULL,
(32) NULL,
. NULL,
. NULL,
. NOT NULL,
. NOT NULL,
. NOT NULL,
. NOT NULL,
(64) NULL,
(64) NULL,
(64) NULL,
(64) NULL,
. NULL,
. NULL,
. NULL,
. NOT NULL,
. NOT NULL,
. NOT NULL,
. NOT NULL,
. NULL,
(32) NULL,
(64) NULL,
(64) NULL,
(64) NULL,
(64) NULL,
(64) NULL,
(64) NULL,
(64) NULL,
(64) NULL,
(64) NULL,
(64) NULL,
(64) NULL,
(64) NULL,
. NOT NULL,
. NULL,

lapangxe 发表于 2021-4-6 13:12

可能是 临时表

flyingdancex 发表于 2021-4-6 13:39

"SD11102N_09ZB".."#saledetail",SD11102N_09ZB库中的临时表#saledetail,MSSQL加#号就是临时表,CREATE TABLE .这个就不是临时表啦

cleangh 发表于 2021-4-6 13:45

有些可能是系统表

朱头 发表于 2021-4-6 13:52

flyingdancex 发表于 2021-4-6 13:39
"SD11102N_09ZB".."#saledetail",SD11102N_09ZB库中的临时表#saledetail,MSSQL加#号就是临时表,CREATE TA ...

好的 感谢

happyyumao 发表于 2021-4-6 14:08

谢谢分享

vr4u 发表于 2021-4-6 15:46

mssql中,临时表是不是用完即焚。还是说等待下次连接的时候再删掉。

flyingdancex 发表于 2021-4-6 16:04

vr4u 发表于 2021-4-6 15:46
mssql中,临时表是不是用完即焚。还是说等待下次连接的时候再删掉。

MSSQL中的临时表,用完需要手动或代码drop,重启MSSQL服务自动销毁,临时表默认存储存tempdb数据库中表名前缀#,一般在存储过程中用的多,触发器中用的相对少

vr4u 发表于 2021-4-7 08:40

非常感谢
页: [1]
查看完整版本: 通过SQL Server Profiler 跟踪到些事件 但数据表中没有相应的列