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

    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 …

  2. 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?

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

    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 …

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

    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...

  5. sql - Changing the maximum length of a varchar column? - Stack …

    Jan 12, 2012 · In Microsoft SQL Server Management Studio, you can also right-click a table and select "Design" to open the design view. From here you are presented with a list of each …

  6. Altering column size in SQL Server - Stack Overflow

    Apr 13, 2012 · ALTER TABLE tab_name ALTER COLUMN col_name new_larger_data_type; To overcome this inconvenience, there is a magic column enlargement pill that your table can …

  7. sql server - Altering a column: null to not null - Stack Overflow

    Mar 27, 2009 · ALTER TABLE table_name CHANGE COLUMN column_name column_name VARCHAR(200) NOT NULL DEFAULT ''; Change VARCHAR(200) to your datatype, and …

  8. 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 …

  9. How to add a boolean datatype column to an existing table in sql?

    Oct 25, 2016 · ALTER TABLE person add [AdminApproved] BIT default 'FALSE'; Also there are other mistakes in your query When you alter a table to add column no need to mention column …

  10. Alter table if exists or create if doesn't - Stack Overflow

    May 30, 2013 · To do this, you need: Create temporary table, an exact copy of the existing table Populate the temporary table with the data from the old table Drop the old table Create the …