Build C# string length validation from SQL Server
If you need a quick and dirty solution to validate string lengths in a .NET model against exact-match columns in SQL Server, you can use this script. This will find all of the varchar and nvarchar columns for a table, and build code to ensure the model doesn’t exceed the max length for any of […]