Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Dependencies in Views

Author  Topic 

brian_mosher
Starting Member

5 Posts

Posted - 2015-04-23 : 12:46:23
I use several stored procedures and functions that read data from Views that I have setup in a Database and then emails me some info when data meets a certain criteria. I'm having a weird problem where when I try to update my Views with ALTER VIEW to select the whole table I'm creating the View as, it just sits there and runs forever. No error or anything. When I click "Check Dependencies" on the view, my Stored Procedures show up there. The only difference I see between Views that update successfully and ones that hang are the ones that hang have these Stored Procedures as Dependencies and the ones that update correctly do not. Any idea how to resolve this?

Thanks,

Brian

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-04-23 : 13:45:05
Check for blocking. And how are you updating your views?

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

brian_mosher
Starting Member

5 Posts

Posted - 2015-04-23 : 13:59:10
Sorry, kind of a noob when it comes to the DBA type stuff. How do I check for blocking? And basically I'm just right-clicking the View in SQLSMS, going to Script View as-->Alter to-->New Query Editor, and then letting it populate that and hitting Execute.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-04-23 : 14:04:48
select * from master..sysprocesses where blocked <> 0

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

brian_mosher
Starting Member

5 Posts

Posted - 2015-04-23 : 16:54:55
Thank you. Interestingly, it seemed to work after I just tried to run the script to select * from the table to update the VIEW again after a period of time. I'm not sure if there was just some job on the SQL Server that was eating up resources at the time I was trying it originally, or what, but it completed without issue when I tried again later without altering anything.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-04-23 : 17:06:12
Pretty sure it was a blocking issue.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -