2012-09-08 158 views
0

我想在我的客戶端數據庫中的某個表中插入少量行。我無法這樣做。無法插入到SQL Server表中

我可以在除此之外的其他表上執行插入,更新,刪除操作。當我嘗試執行插入,更新或刪除時,它不會給出錯誤,但需要無限的時間來執行。

我甚至嘗試禁用所有觸發器和約束。

任何人都可以幫忙嗎?

if not exists(select '' from table_name where col1='val1' and col2='Val2') 
begin 
    insert into lw_code_group_ext(col1,col2,col3) values(val1,val2,val3); 
end 
+0

你確定它是無限的時間嗎?這是等待很長時間... –

回答

2

該表可能被鎖定。這意味着它正在被其他進程讀取。試着找出可以讀取這張表格的東西,如果你發現它,使用:

... from lw_code_group_ext with (nolock) ... 
+0

Thnx ...真的幫助。 –