吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1363|回复: 8
收起左侧

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

[复制链接]
朱头 发表于 2021-4-6 12:52
本帖最后由 朱头 于 2021-4-6 13:52 编辑

事件跟踪到的表名比实际的表名多出来,不知道这些是什么原因呢?
微信图片_20210406100622.png

事件跟踪到的insert语句
[SQL] 纯文本查看 复制代码
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


数据表 结构为:
[SQL] 纯文本查看 复制代码
CREATE TABLE [dbo].[saledetail](
[invoiceid] [dbo].[t_keyid] NOT NULL,
[itemno] [dbo].[t_keyid] NOT NULL,
[goodsid] [dbo].[t_keyid] NOT NULL,
[unitid] [dbo].[t_keyid] NOT NULL,
[aprice] [dbo].[t_price] NOT NULL,
[disc] [dbo].[t_disc] NOT NULL,
[price] [dbo].[t_price] NOT NULL,
[quantity] [dbo].[t_quantity] NOT NULL,
[unitprice] [dbo].[t_price] NOT NULL,
[unitqty] [dbo].[t_quantity] NOT NULL,
[batchrefid] [dbo].[t_keyid] NULL,
[batchcode] [varchar](32) NULL,
[produceddate] [dbo].[t_date] NULL,
[validdate] [dbo].[t_date] NULL,
[taxrate] [dbo].[t_double] NOT NULL,
[goodsamt] [dbo].[t_amount] NOT NULL,
[taxamt] [dbo].[t_amount] NOT NULL,
[amount] [dbo].[t_amount] NOT NULL,
[userdef1] [varchar](64) NULL,
[userdef2] [varchar](64) NULL,
[userdef3] [varchar](64) NULL,
[memo] [varchar](64) NULL,
[refertype] [dbo].[t_integer] NULL,
[referbillid] [dbo].[t_keyid] NULL,
[referitemno] [dbo].[t_keyid] NULL,
[ispresent] [dbo].[t_bool] NOT NULL,
[returnqty] [dbo].[t_quantity] NOT NULL,
[returnamt] [dbo].[t_amount] NOT NULL,
[refercount] [dbo].[t_integer] NOT NULL,
[nprice] [dbo].[t_price] NULL,
[goodsaddress] [varchar](32) NULL,
[userdef4] [varchar](64) NULL,
[userdef5] [varchar](64) NULL,
[userdef6] [varchar](64) NULL,
[userdef7] [varchar](64) NULL,
[userdef8] [varchar](64) NULL,
[userdef9] [varchar](64) NULL,
[userdef10] [varchar](64) NULL,
[userdef11] [varchar](64) NULL,
[userdef12] [varchar](64) NULL,
[userdef13] [varchar](64) NULL,
[userdef14] [varchar](64) NULL,
[userdef15] [varchar](64) NULL,
[scorerate] [dbo].[t_quantity] NOT NULL,
[barcodeid] [dbo].[t_keyid] NULL,
)

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

lapangxe 发表于 2021-4-6 13:12
可能是 临时表
flyingdancex 发表于 2021-4-6 13:39
"SD11102N_09ZB".."#saledetail",SD11102N_09ZB库中的临时表#saledetail,MSSQL加#号就是临时表,CREATE TABLE [dbo].[saledetail]这个就不是临时表啦
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
非常感谢
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-26 04:47

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表