I encountered an interesting scenario that I encountered while creating ETL packages that work with both 2008R2 and 2012 SQL servers. For the test purposes I created an OLE DB source within a Data Flow based around the following SQL command:
declare @v int = ?;
select v = @v;
Now this parses correctly and I am able to bind parameters if I am using an OLE DB connection manager pointing to SQL 2012 instance, but gives the dreaded "Syntax error, permission violation, or other nonspecific error" during parsing or parameter binding attempts if I change the manager to a SQL 2008 R2 source. I tried tinkering with the managers using the different versions of OLE DB driver and SQL Native Client with no results. For some reason I was under impression that it is the driver that does the query parsing, but it appears that server has some involvement as well. My question - is there anything that can be done to make a query of this sort work with 2008 R2 instance? Is this may be some server or database setting I am overlooking? Or is it just a bug that was finally fixed in 2012?
Thanks,
Alex