Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: Query runs, but never finishes....

Started 1 month, 2 weeks ago by offspring22
> Hello, So I have the query below, to update 1 table and change 1 field to the contents of the same field on a different table, as seen below. update userlist set public_id = b.public_ID from userlist a, member.dbo.members b where a.board_ID = b.member_number and a.board_ID is not NULL It appears to run, but I can let it sit for minutes and it never finishes or ...
Site: SQL Server Forums  SQL Server Forums - site profile
Forum: New to SQL Server  New to SQL Server - forum profile
Total authors: 7 authors
Total thread posts: 10 posts
Thread activity: no new posts during last week
Domain info for: sqlteam.com

Other posts in this thread:

visakh16 replied 1 month, 2 weeks ago
> update a set a.public_id = b.public_ID from userlist a inner join member.dbo.members b on a.board_ID = b.member_number where a.board_ID is not NULL

offspring22 replied 1 month, 2 weeks ago
> Hmmm, that seems to make sense but I get the same results - just runs forever.

offspring22 replied 1 month, 2 weeks ago
> note, public ID is null on some of the records on Userlist - which is mostly what I'm trying to correct.

webfred replied 1 month, 2 weeks ago
> There must be a mistake on joining i.e. in the data in both tables. Have a look at your data and have a special look at the possibility to join a.board_ID = b.member_number. Maybe the join matches 60000 with 6000 because of missing proper ids? No, you're never too old to Yak'n'Roll if you're too young to die.

denis_the_thief replied 1 month, 2 weeks ago
> Are you familiar with Indexes? Do you know how to check if they exist on a table. That could be the issue. Are there any indexes on the tables?

webfred replied 1 month, 2 weeks ago
> Denis that cannot be with only 6000 records. No, you're never too old to Yak'n'Roll if you're too young to die.

russell replied 1 month, 2 weeks ago
> something must be blocking your query. after executing it, open another window, type in "SP_WHO2" and look in the blocking column

cvraghu replied 1 month, 2 weeks ago
> Try using hint - WITH (TABLOCKX) on the updated table

irinag9 replied 1 month, 2 weeks ago
> Hi! Try as I would write: update userlist a set a.public_id = (select b.public_ID from member.dbo.members b where a.board_ID = b.member_number) where a.board_ID is not NULL Hope board_ID is a unique index or primary key. :) cheers!

 

Top contributing authors

Name
Posts
offspring22
3
user's latest post:
Query runs, but never finishes....
Published (2009-11-10 13:41:00)
> note, public ID is null on some of the records on Userlist - which is mostly what I'm trying to correct.
webfred
2
user's latest post:
Query runs, but never finishes....
Published (2009-11-10 16:35:00)
> Denis that cannot be with only 6000 records. No, you're never too old to Yak'n'Roll if you're too young to die.
visakh16
1
user's latest post:
Query runs, but never finishes....
Published (2009-11-10 13:04:00)
> update a set a.public_id = b.public_ID from userlist a inner join member.dbo.members b on a.board_ID = b.member_number where a.board_ID is not NULL
denis_the_thief
1
user's latest post:
Query runs, but never finishes....
Published (2009-11-10 16:15:00)
> Are you familiar with Indexes? Do you know how to check if they exist on a table. That could be the issue. Are there any indexes on the tables?
russell
1
user's latest post:
Query runs, but never finishes....
Published (2009-11-10 18:42:00)
> something must be blocking your query. after executing it, open another window, type in "SP_WHO2" and look in the blocking column
cvraghu
1
user's latest post:
Query runs, but never finishes....
Published (2009-11-11 00:45:00)
> Try using hint - WITH (TABLOCKX) on the updated table
irinag9
1
user's latest post:
Query runs, but never finishes....
Published (2009-11-11 03:06:00)
> Hi! Try as I would write: update userlist a set a.public_id = (select b.public_ID from member.dbo.members b where a.board_ID = b.member_number) where a.board_ID is not NULL Hope board_ID is a unique index or primary key. :) cheers!

Related threads on "SQL Server Forums":

Related threads on other sites:

Thread profile page for "Query runs, but never finishes...." on http://www.sqlteam.com. This report page is a snippet summary view from a single thread "Query runs, but never finishes....", located on the Message Board at http://www.sqlteam.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity