Dapper and varchars

I found the following comment on the Dapper .NET project home page. Dapper supports varchar params, if you are executing a where clause on a varchar column using a param be sure to pass it in this way: Query<Thing>("select * from Thing where Name = @Name", new {Name = new DbString { Value = "abcde", IsFixedLength = true, Length = 10, IsAnsi = true }); On Sql Server it is crucial to use the unicode when querying unicode and ansi when querying non unicodeI'm evaluating Dapper for use with a legacy database (SQL Server 2008), with ...Read more

visual studio - Stored procedure varchar output parameter

Yesterday, I noticed something odd when returning a varchar(100) output parameter from my stored procedure in my asp.net application. It appears that the returned value is now including the extra white spaces to return a full 100 characters. This behavior is new. The only thing I have changed recently is migrating the project from VS 2015 to 2017. I am using System.Data.SQLClient to connect to the database. Select statements for varchar columns return just the values in the columns and no extra white spaces. Ansi_padding is off for the da...Read more

netsuite - Not able to load table throgh Informatica due to source table is having a column of 0 varchar lenght

I am loading data from Netsuite to Oracle through informatica. There is a table in Netsuite which is having a column of wvarchar(). But while converting it shows as varchar of 0 length and when informatica tries to load that tables, it sees that column of 0 length and throws error. Is there a way to convert from wvarchar() to varchar() on Netsuite side or can we identify throgh informatica?...Read more

varchar - jtds TDS Protocol error: Invalid packet type

I'm connecting to Sybase ASA v11.0.1 using the jTDS library (v1.2.6) and I'm getting the following error every time I try to return varchar data Protocol error: Invalid packet type 0x0(or x4 or x7)The queries work fine when I return a timestamp or numeric value. Any idea what is causing this error or how to resolve it?...Read more

sql insert - SQL Server Varchar to VarBinary Conversion

I have to insert the string "johnmelling" value into a table which has the column as[USERPASS] varbinary NOT NULL. Please could any one suggest me, what would be the best conversion to insert "johnmelling"?I tried to to insert as below, Insert into table(column1)Values(CONVERT(varbinary(1), 'johnmelling')) Then I got the error Line 1: String or binary data would be truncated. Thank You,...Read more

CONVERTING VARCHAR to DATA TYPE INT

I have the following code. The Case statements are converting the listed numbers to text and the rest of the codes into NULL, but i keep getting the following error: CONVERSION FAILED WHEN CONVERTING THE VARCHAR VALUE 'RDG5' TO DATA TYPE INT. RDG5 is one of the many codes being converted to NULL. Any thoughts? SELECT dbo.TACCPLI.SYS_EMP_ID_NR, MAX(dbo.TACCPLI.AML_TYP_CD) AS DEG, (CASE WHEN dbo.TACCPLI.AML_TYP_CD IN (20, 25) THEN 'Associates' WHEN dbo.TACCPLI.AML_TYP_CD IN (30, 35) THEN 'Bachelors' WHEN dbo.TACCPLI.A...Read more