About 644,000 results
Open links in new tab
  1. How to add a column with a default value to an existing table in SQL ...

    Jun 21, 2016 · ALTER TABLE [dbo.table_name] ADD [Column_Name] BIT NOT NULL Default ( 0 ) Here is another way to add a column to an existing database table with a default value. A much more …

  2. How to DROP multiple columns with a single ALTER TABLE statement …

    Jun 14, 2011 · 409 I would like to write a single SQL command to drop multiple columns from a single table in one ALTER TABLE statement. From MSDN's ALTER TABLE documentation...

  3. sql server - Add a new table column to specific ordinal position ...

    83 Is it possible to add a column to a table at a specific ordinal position in SQL Server? For instance, our tables always have CreatedOn, CreatedBy, LastModifiedOn, LastModifiedBy columns at the "end" of …

  4. How do you change the datatype of a column in T-SQL Server?

    Mar 9, 2009 · I am trying to change a column from a varchar(50) to a nvarchar(200). What is the SQL command to alter this table?

  5. alter table - Adding column between two other columns in SQL server ...

    Mar 16, 2011 · Can you add a column to a table inserting it in between two existing columns in SQL Server without dropping and re-creating the table?

  6. sql - How to use ALTER TABLE to add a new column and make it …

    Sep 17, 2010 · My MS SQL Server will allow me to run "ALTER TABLE table_name ADD UNIQUE (column_name)" as many times as I want. If I then go into SQL Management Studio and examine the …

  7. How to ALTER multiple columns at once in SQL Server

    Jan 24, 2015 · I need to ALTER the data types of several columns in a table. For a single column, the following works fine: ALTER TABLE tblcommodityOHLC ALTER COLUMN …

  8. What is the SQL to change the field length of a table column in SQL ...

    Oct 6, 2017 · 9 The ALTER TABLE Statement The ALTER TABLE statement is used to add, delete, or modify columns in an existing table. SQL ALTER TABLE Syntax To add a column in a table, use the …

  9. Alter table add multiple columns ms sql - Stack Overflow

    Jul 8, 2016 · Can anyone tell me where is the mistake in the following query ALTER TABLE Countries ADD ( HasPhotoInReadyStorage bit, HasPhotoInWorkStorage bit, HasPhotoInMaterialStorage bit, …

  10. How do I rename a column in a database table using SQL?

    Oct 6, 2008 · 155 If I wish to simply rename a column (not change its type or constraints, just its name) in an SQL database using SQL, how do I do that? Or is it not possible? This is for any database …