This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I'm using LightSpped 5 (5.0.2817.0), Non-unicode datatype (varchar) is supported? Execute conditional query to varchar column, but parameter query is nvarchar. When a parameter type is different, performance issue cast occurs. Thanks, Tatsuro Shibamura. |
|
|
Can you give a more specific example of where this is occurring?
|
|
|
I use this table. UniqueKey is created unique index. execute to this LightSpeed query.
generate sql query is follow. parameter type is nvarchar, for varchar column.
change column type nvarchar to varchar, SQL Server required upcast. ex. Use nvarchar query plan. ex. Use varchar query plan. |
|
|
Thanks, this occurs because when we create the properties the type is inferred by the ADO.NET provider from the entity property data type being used, this case a string infers an nvarchar with SqlClient. The workaround for this would be to use a stored procedure where you can explicitly control the data type being used on the parameters, we dont draw a distinction between varchar columns and nvarchar columns in the designer, we map both of these to strings.
|
|