Long time lurker, first time poster. Working on project for a non-profit group to help migrate queries from an offsite customer relations management (CRM) tool into an EDW. Full disclosure, I love to work with data and know just enough SQL to join data and help reconcile financial data. I am posting today because I think someone with more coding or developing experience can help explain. If not, well then at least I took a shot at becoming SO famous.
There are particular challenges to getting the backend sql code, thus the need for an in-house EDW. The CRM has a gui interface with an SQL generator.
Using the gui interface to generate SQL code delivers results in either an "ad-hoc" or "smart query" format. While not clear on what that really means, it appears the sql code is embedded in an XML like tree format.
My question: what does it mean when I see something like
where table.fieldName = N'someValueToFilter'
Is that N prefix really doing anything? Based on my exploratory testing it does not. And I've happily moved forward. When I ask around I'm told that it's just smart query logic, and not to worry about it. If I had to guess, I suspect this prefix is a designation to signal that 'someValueToFilter' is a user defined filter from gui. My hope is an independent person will verify my suspicion. Thank you!