I am building my first MVC app, so please excuse me if its a rookie question. I am building a web app that queries an existing SQL database Log tables that are created when a new record is created, mapping the response back using Dapper.
However, the Log messages text can be 1000's of lines long. Is there a way that I can limit the length of the returned value to say 100 characters?
EDIT #1 I have tried the following after success in the SQL Server manager query:
CAST(myColumn as CHAR(100)),
LEFT(myColumn,100),
SUBSTRING(myColumn,0,100)
All of these worked in the Server Manager Query window, but did not work when I put them in my ConnectionString.Query for Dapper.
Alright I found what was i was doing wrong. This is what i used to get the first 100 characters from the returned value:
SELECT CAST(myColumn as CHAR(100)) AS mySHORTENEDColumn FROM myTable
I am kinda embarrassed that I didn't find it before posting the question but I figure maybe it will help someone else, that's a rookie like me.