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 2005 Forums
 Transact-SQL (2005)
 Creating a Index on a View with NOLOCK option.

Author  Topic 

8022421
Starting Member

45 Posts

Posted - 2008-12-19 : 10:40:44
I have created a view with NOLOCK option in the table. when i am trying to create a index it says. "Cannot create index on view 'dev13d1.dbo.viewname' because the view contains a table hint. Consider removing the hint." When I am removed the NOLOCK condition it works fine But I need the index to be created with the Nolock on the view is there a option to create it?

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-12-19 : 11:45:29
quote:
Originally posted by 8022421

I have created a view with NOLOCK option in the table. when i am trying to create a index it says. "Cannot create index on view 'dev13d1.dbo.viewname' because the view contains a table hint. Consider removing the hint." When I am removed the NOLOCK condition it works fine But I need the index to be created with the Nolock on the view is there a option to create it?



index views have certain restrictions.You have to follow it.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-19 : 12:26:48
Why do you need to index your view anyway? Why can't you just index the underlying table(s)?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -