I have a query like this in my DataSet (the database is in the .mdf file):
SELECT * FROM TableName WHERE SomeField LIKE @Param
The table TableNamecontains an entry in the field . SomeField
TableName
SomeField
When , it works fine, but when or it returns 0 rows. also works.@Param %@Param % % %%%
@Param
%
%%%
Why does '%' work as a one-character pattern?
Your problem is that you should use @param NVARCHAR, not NCHAR
declare @Param nchar(255) set @Param = N'%'
It's really
N'% ...' (many more spaces)
Thus, it will not match your data, which
N' ...' (padded with spaces)
Source: https://habr.com/ru/post/1796137/More articles:Failed to load Main-Class manifest attribute from - javaRecommended approaches for getting my code included? - c ++Indicate how many days in the future will be the date and time. - c #Redirecting problems - c #Can I split more than one file at a time using subversion and Beyond Compare? - svnN-Layered ASP.NET app: one class library for all my layers or one class library for each layer? - c #Как вызвать событие APPCRASH в приложениях Delphi? - delphiпроблема с функцией потолка в С++ - c++Customize / resize views using presentModalViewController - objective-cCan I embed HTML5 video from YouTube using -tag? - html5All Articles