﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / T-SQL (SS2K8)  / How to update multiple column definition in single update statement / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 19 Jun 2013 06:34:55 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: How to update multiple column definition in single update statement</title><link>http://www.sqlservercentral.com/Forums/Topic1040888-392-1.aspx</link><description>I don't believe there is a way to do that.  You can add multiple columns in a single command, but not alter multiple columns all at once.Copy-and-paste can remove most of the work with that.  Might be even simpler if you're modifying a predictable set of columns, and you query sys.columns to build the basic strings.[code="sql"]select 'alter table [' + object_name(object_id) + '] alter column [' + name + ']' from sys.columnswhere object_id = ...;[/code]Something like that.</description><pubDate>Thu, 30 Dec 2010 08:33:09 GMT</pubDate><dc:creator>GSquared</dc:creator></item><item><title>RE: How to update multiple column definition in single update statement</title><link>http://www.sqlservercentral.com/Forums/Topic1040888-392-1.aspx</link><description>I need to alter definition of two columns in a table and its being done like this  :ALTER TABLE dbo.JURISDICTION_FIELDALTER COLUMN FIELD_CODE NVARCHAR(60) NOT NULL;ALTER TABLE dbo.JURISDICTION_FIELDALTER COLUMN [DESCRIPTION] NVARCHAR(2000) NULL;If I need to update 20 columns in a table, there will need to be 20 ALTER TABLE statements. Is there a way to update all 20 columns using a single ALTER TABLE statement?Please let me know if you need more clarifications.Thank You.</description><pubDate>Thu, 30 Dec 2010 08:28:45 GMT</pubDate><dc:creator>akhandels</dc:creator></item><item><title>RE: How to update multiple column definition in single update statement</title><link>http://www.sqlservercentral.com/Forums/Topic1040888-392-1.aspx</link><description>I don't think you can do it in SQL 2008 R2 either.  Not sure about Denali.</description><pubDate>Thu, 30 Dec 2010 08:21:17 GMT</pubDate><dc:creator>GSquared</dc:creator></item><item><title>RE: How to update multiple column definition in single update statement</title><link>http://www.sqlservercentral.com/Forums/Topic1040888-392-1.aspx</link><description>Can you elaborate in better can you have some examples for it like how with scenariosThanksParthi</description><pubDate>Thu, 30 Dec 2010 07:59:11 GMT</pubDate><dc:creator>parthi-1705</dc:creator></item><item><title>How to update multiple column definition in single update statement</title><link>http://www.sqlservercentral.com/Forums/Topic1040888-392-1.aspx</link><description>Hi All,Does anybody know if there is a way to update column definition of multiple columns in a single ALTER statement in SQL Server 2008 or Denali CTP 1 ?I am aware it is not possible in SQL Server 2005.Thank You</description><pubDate>Thu, 30 Dec 2010 07:23:19 GMT</pubDate><dc:creator>akhandels</dc:creator></item></channel></rss>