patternsqlMinor
SQL Server 2008 Indexed View
Viewed 0 times
2008sqlviewindexedserver
Problem
I am attempting to add
Syntax 'Openrowset/Openquery/Opendatasource' is not allowed in schema-bound objects.
I am using
This was the syntax I tried with my view
schemabinding to a view in SQL Server 2008, but I am getting an error ofSyntax 'Openrowset/Openquery/Opendatasource' is not allowed in schema-bound objects.
I am using
Openquery because I am querying a linked server and this is the way I must query it. Is there a workaround for this?This was the syntax I tried with my view
Create View dbo.Test
With Schemabinding
As
Select * FROM OPENQUERY(191.183.18.101, 'Select * from ls1prod.hrinfo')
GoSolution
The documentation for Indexed Views is pretty clear about what's allowed, and what's not allowed.
Specifically:
ROWSET functions (OPENDATASOURCE, OPENQUERY, OPENROWSET, AND OPENXML)
There's no 'workaround' because it's not allowed.
Specifically:
ROWSET functions (OPENDATASOURCE, OPENQUERY, OPENROWSET, AND OPENXML)
There's no 'workaround' because it's not allowed.
Context
StackExchange Database Administrators Q#172429, answer score: 5
Revisions (0)
No revisions yet.