|
|
Rank: Newbie
Joined: 5/22/2012 Posts: 5
|
Our mapping maps from SQL to xml. (we have SQL server 2008). DB columns typically have type of 'nvarchar[n]' (n value vary) and schema corresponding attributes are strings. Most of the generated queries contain 'where' clause that looks like:
WHERE (CAST(? AS nvarchar(max))) = [key1] and ...
Such queries are very slow, because due to CAST indexes are not used.
When I manually do 'replace' in the generated code to 'Where ? = [key1]', the same query runs 100 times faster.
Altering generated code manually is not a good practice. Is there a way to config MapForce NOT to create queries with CAST in the first place?
(I unchecked 'Cast Values to target types', but it didn't help)
Thanks,
Ofer
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
Are you using the same driver to connect MapForce to your database and to execute this code afterwards?
|
|
Rank: Member
Joined: 11/23/2015 Posts: 18 Location: Trenton, NJ
|
Bump: The OP's question about "not generating CAST in the first place"? There seems to be no way to suppress CASTs in MapForce 2016 Enterprise, and the advice for other component types: select "Properties", and then uncheck the "Cast values to target types" doesn't seem to work for databases components.
|
|
|
guest |