About 252,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 · 1230 ALTER TABLE Protocols ADD ProtocolTypeID int NOT NULL DEFAULT(1) GO The inclusion of the DEFAULT fills the column in existing rows with the default value, so …

  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. How to add a boolean datatype column to an existing table in sql?

    Oct 25, 2016 · In SQL SERVER it is BIT, though it allows NULL to be stored ALTER TABLE person add [AdminApproved] BIT default 'FALSE'; Also there are other mistakes in your query …

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

    Oct 6, 2008 · 154 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 …

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

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

    Jul 8, 2016 · Possible duplicate of how to add multiple columns to sql table and add default constraint on one of them?

  7. How To change the column order of An Existing Table in SQL …

    I have a lecture about SQL Server internals: Tables structure where in one of the demo I create two databases > execute the same script which start with creating a table > Result is that one …

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

    Jun 14, 2011 · 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... DROP …

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

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

    May 30, 2013 · In one client the table has one column -A1, and another client has the same table but with column A1 and column A2. I want my sql command to make both clients' table A hold …