June 14, 2012 at 8:53 am
Hello All,
I am trying to connect to the table which is in different server. I am using open row set for that. With open row set I am trying to connect to the table and filter the results with some conditions and load this result set into a temp table. But at the end near the where condition I have filter for strings.It is showing an error near the 'sbrpt%' and '%Subreport%'. Can anyone tell me how to use these strings when I am using open rowset.
Here is what I am doing
select * into #catalog
from OPENROWSET('SQLOLEDB', 'servername'; 'userid'; 'pwd',
'select [ItemID]
,[Path]
,[Name]
,[ParentID]
,[Type]
,[Content]
,[Intermediate]
,[SnapshotDataID]
,[LinkSourceID]
,[Property]
,[Description]
,[Hidden]
,[CreatedByID]
,[CreationDate]
,[ModifiedByID]
,[ModifiedDate]
,[MimeType]
,[SnapshotLimit]
,[Parameter]
,[PolicyID]
,[PolicyRoot]
,[ExecutionFlag]
,[ExecutionTime]
FROM [ReportServer].[dbo].[Catalog] where type = 2
and c.name not like 'sbrpt%' and c.path not like '%Subreport%''
)
June 14, 2012 at 9:23 am
You need to double your single quotes.
... like ''sbrpt%'' and c.path not like ''%Subreport%'''
June 14, 2012 at 10:04 am
Got it. Thank you so much.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply