blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

SSIS Junkie

Conchango are busy and need top level Technical Architects for Microsoft & Open Source platforms in and around London. Interested? Email me or send me a message

T-SQL: Multiple ALTER COLUMN clauses in an ALTER TABLE statement

Quick one.

Do you think it would be useful to be able to do this:

ALTER TABLE t
   ALTER COLUMN c1 int null
   ALTER COLUMN c2 int null
   ALTER COLUMN c3 int null
   ALTER COLUMN c4 int null;

instead of this:

ALTER TABLE t ALTER COLUMN c1 int null;
ALTER TABLE t ALTER COLUMN c2 int null;
ALTER TABLE t ALTER COLUMN c3 int null;
ALTER TABLE t ALTER COLUMN c4 int null;

If the answer's 'yes', head here: https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=351514 and vote for it to be implemented in a future version of SQL Server.

-Jamie

 

UPDATE: I've just thought of another one.

In SQL 2005 you have to write this:

declare @i int
select @i = dbo.udf_MyScalarFunction()
exec usp_MyStoredProc @i

 

In SQL 2008 its a little bit nicer because you can write this:

declare @i int = dbo.udf_MyScalarFunction()
exec usp_MyStoredProc @i

 

but wouldn't it be good if we could just do this:

exec usp_MyStoredProc dbo.udf_MyScalarFunction()

instead?

If you agree, go here: https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=352110 and vote for it.

-Jamie

Published 17 June 2008 16:11 by jamie.thomson
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

ranomore said:

My opinion is it should be more like this:

ALTER TABLE t

  ALTER c1 int null,

  c2 int null,

  c3 int null,

  c4 int null

Kind of like the syntax for add:

ALTER TABLE t

add c5 int null,

c6 int null

June 19, 2008 03:56
 

jamie.thomson said:

ranomore,

yep, I like that. Why not add that suggestion to the Connect posting?

-Jamie

June 20, 2008 11:34

Leave a Comment

(required) 
(optional)
(required) 
Submit

This Blog

Syndication

News

Powered by Community Server (Personal Edition), by Telligent Systems