The text, ntext, and image data > types cannot be compared or sorted, except when using IS NULL or LIKE > operator

since you are using SQL Server, why not change the data type to VARCHAR(100)? To work around this error without changing the datatype, the TEXT or NTEXT column needs to be converted to VARCHAR or NVARCHAR when used in either the ORDER BY clause or the GROUP BY clause of a SELECT statement. eg, which … Read more

insert a multiline string in Oracle with sqlplus

Enable SQLBLANKLINES to allow blank lines in SQL statements. For example: SET SQLBLANKLINES ON insert into table(id, string) values (1, ‘Line1goesHere Line2GoesHere blablablabla ‘); The premise of this question is slightly wrong. SQL*Plus does allow multi-line strings by default. It is only blank lines that cause problems.

How do I build a dynamic Where clause with Dapper when passing in a model

You can also use Dapper’s SqlBuilder. Note that you’ll have to install the Dapper.SqlBuilder NuGet package since it doesn’t come with Dapper’s main distribution. Here is an example: [Test] public void Test() { var model = new PersonModel {FirstName = “Bar”, City = “New York”}; var builder = new SqlBuilder(); //note the ‘where’ in-line comment … Read more

Generate a resultset of incrementing dates in T-SQL

If your dates are no more than 2047 days apart: declare @dt datetime, @dtEnd datetime set @dt = getdate() set @dtEnd = dateadd(day, 100, @dt) select dateadd(day, number, @dt) from (select number from master.dbo.spt_values where [type] = ‘P’ ) n where dateadd(day, number, @dt) < @dtEnd I updated my answer after several requests to do … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)