About 10,700,000 results
Open links in new tab
  1. Change Schema Name Of Table In SQL - Stack Overflow

    I want to change schema name of table Employees in Database. In the current table Employees database schema name is dbo I want to change it to exe. How can I do it ? Example: FROM …

  2. insert a NOT NULL column to an existing table - Stack Overflow

    As an option you can initially create Null-able column, then update your table column with valid not null values and finally ALTER column to set NOT NULL constraint:

  3. SQL Server add auto increment primary key to existing table

    7 This answer is a small addition to the highest voted answer and works for SQL Server. The question requested an auto increment primary key, the current answer does add the primary key, but it is not …

  4. How to rename a table in SQL Server? - Stack Overflow

    The SQL query that I have used is : ALTER TABLE oldtable RENAME TO newtable; But, it gives me an error. Server: Msg 156, Level 15, State 1, Line 1 Incorrect syntax ...

  5. sql server - SQL-script: How to write ALTER statements to set Primary ...

    SQL-script: How to write ALTER statements to set Primary key on an existing table? Asked 13 years, 4 months ago Modified 1 year, 7 months ago Viewed 1.1m times

  6. sql - Default getdate for Insert date - Stack Overflow

    ALTER TABLE sample ALTER COLUMN INSERT_DATE [datetime] NULL DEFAULT GetDate() If you already have values in the column, you can do something like this:

  7. SQL Server sequence set current value - Stack Overflow

    I am using SQL Server 2012 (v11.0.2100) and I want to create a sequence that starts with a random (dynamic) number but I wasn't able to do this, also I put my effort to find a good solution for thi...

  8. Change a Nullable column to NOT NULL with Default Value

    ALTER TABLE dbo.MyTable ALTER COLUMN Created DATETIME NOT NULL Is there any way to also specify the default value as well on the ALTER statement?

  9. Change collations of all columns of all tables in SQL Server

    ALTER TABLE [table] ALTER COLUMN [column] VARCHAR(100) COLLATE Latin1_General_CI_AS But I have to do this for all tables and all columns inside. Before I know start to write a stored …

  10. sql - Alter table to modify default value of column - Stack Overflow

    I have a requirement where we need to modify a column's default value in database table. The table is already an existing table in database and currently the default value of the column is NULL. No...