prepared statement
843854Aug 29 2003 — edited Apr 1 2008Hi,
I am using prepared statements for querying the data base for my application, I use SQLServer and JSQLCONNECT driver.
I started SQLServer's profiler and while my application is running I could see all the queries that are going to DB in the Profiler .
Here is the interesting thing,If you see the below query an N is prefixed in the where clause(If the column in where clause is VARCHAR).
SELECT * FROM ZipInfo WHERE (ZipCd = '11364') is shown as
SELECT * FROM ZipInfo WHERE (ZipCd = N'11364') in SQL Profiler.
This query I gave as a sample one, the actual tables have thousands of records.
This is causing a big performance issue, when I see the execution plan in SQLSerer with out N is much faster than with N.
Strangely I am not appending it through my code.
Could some one plz help me why this is happening.............
thanks in advance....plz send your suggestions to rramachandruni@lendingspace.com