title: How to Change All Sql Columns of One DataType into Another
body: <p>I have a database (<code>Sql Server 2005</code>) where there are dozens of <code>tables</code>, each of which has a number of <code>columns</code> (on average 10-20) with datatype set to <code>nvarchar(max)</code>. This is absolutely killing performance (some of these columns are being used for <code>joins</code> and some of the tables have 100K+ rows). I would like to change all of these columns to be <code>varchar(250)</code>. What would be the best way to automate this? (I could use <code>Management Studio</code>, or I could create a utility to perform this through an <code>ASP.net</code> website that has access to the db, whichever is easier).</p>