title: Running an openquery in SQL Server with replace
body: <p>I'm trying to run this query in SQL Server 2008 R2:</p>
  
  <pre><code>SELECT * 
  FROM OPENQUERY(XREF_PROD,
                 'select 
                      resourcecalenderid, 
                      racfid, 
                      leavetype, 
                      leavestartdate, 
                      leaveenddate, 
                      replace('modifiedby','^0-9a-zA-Z -', '') AS [CUSTOMER_MFG_VENDOR_NAME]
                      createdby, 
                      createdon, 
                      modifiedby, 
                      modifiedon 
                  from XREF.XREF_RESOURCE_CALENDER')
  </code></pre>
  
  <p>Keeps telling a quote identifier is needed and I have tried different variations and can't get it to work...</p>
  
  <p>I have tried running with double quotes also..</p>
  
  <p>Thanks
  fordraiders</p>