在数据库中插入记录时出现超时错误。 [英] Timeout error while inserting the records in database.

查看:257
本文介绍了在数据库中插入记录时出现超时错误。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在数据库中插入记录时遇到了很大的问题。

在我的工作表中我有20个记录。当我首先插入新记录时,如果记录存在与否,我将根据某些字段(如url,location..etc)进行检查。

每个字段和每个字段在插入之前检查17条记录。现在插入记录时出现超时错误。现在记录每天都在增加。

我的服务器配置是32 gb ram和2 TG硬盘。



请给我建议。

谢谢....

Hi,

I have a big problem while inserting the records in database.
In my job table I have 20 laks of records. When I inserting the new record first I will check based on some fields(like url, location..etc) if the record is exist or not.
Each and Every field check 17 laks of records before inserting. Now I got timeout error while inserting the records. Now the records are increased daily.
My server configurations is 32 gb ram and 2 TG harddisk.

Please give me the suggestions.
Thank you....

推荐答案

为您的表添加一个额外的唯一约束,以便保证您检查重复项的字段SQL Server已经是唯一的。

您可以设置约束,例如使用SQL Server Management Studio(单击表 - 然后是Constraints - 然后是New Constraint)。

索引也可以这样做。
Add an additional unique constraint to your table, such that fields which you check for duplicates are guaranteed to be unique by SQL Server already.
You can set constraints e.g. with SQL Server Management Studio (click on the table - then Constraints - then "New Constraint").
An index could do so, too.


这篇关于在数据库中插入记录时出现超时错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆