I've got an SSN column (nvarchar) in the db and a string property called SSN in my code. All is well except we started getting very slow performance when doing a query on SSN even though there is an index. It turns out that because the SSNs are all digits, nhibernate is sending a query that looks like this to the server
select * from Census where SSN=265145847 and this is causing the sql server to call CONVERT_IMPLICIT on each value in the database to convert it to an integer to do the comparison. what i want is a query that looks like this: select * from Census where SSN='265145847' which sql will be able to query normally and quickly. The only difference being the single quotes. I've tried explicitly setting the type in the mapping file and in the query, but nothing seems to force quotes for a string if it is all digits. anyone got ideas? thanks! Ralph -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
