About 902,000 results
Open links in new tab
  1. How do you change the datatype of a column in T-SQL Server?

    Mar 9, 2009 · ALTER TABLE table_name ALTER COLUMN column_name column_type; For example: ALTER TABLE employees ALTER COLUMN last_name VARCHAR(75) NOT NULL; …

  2. How do I change the data type for a column in MySQL?

    Aug 31, 2009 · To change column data type there are change method and modify method. ALTER TABLE student_info CHANGE roll_no roll_no VARCHAR(255); ALTER TABLE …

  3. Change column datatype in SELECT in SQL Server - Stack Overflow

    From this possible duplicate SO on SQL Server 2008: EXEC sp_RENAME table_name , old_name, new_name Or you could do this: ALTER TABLE table_name RENAME COLUMN …

  4. sql - Modifying a column type with data, without deleting the data ...

    May 18, 2012 · As long as the data types are somewhat "related" - yes, you can absolutely do this. You can change an INT to a BIGINT - the value range of the second type is larger, so …

  5. sql server - How to change the data type of a column without …

    Right-click on the background of the Modify window and select "Generate Change Script." In the window that appears, you can copy the change script to the clipboard. Cancel the Modify …

  6. How to change column datatype in SQL Server database without …

    Apr 5, 2022 · Simply go into Management Studio and change the data type. If the existing value can be converted to bool (bit), it will do that. In other words, if "1" maps to true and "0" maps to …

  7. Is it possible to change the datatype of a column in a view?

    Mar 2, 2016 · Convert(varchar(50),dbo.User_master.User_email) where User_email has previous type as nvarchar(MAX). If you want to convert nvarchar data to datetime then additional …

  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. Changing the data type of a column in Oracle - Stack Overflow

    You can't modify the data type of a table if you have some amount of records already present in the table. You have to empty the table records of the column (you want to modify the data …

  10. How to alter a column's data type in a PostgreSQL table?

    Aug 23, 2015 · If data already exists in the column you should do: ALTER TABLE tbl_name ALTER COLUMN col_name TYPE integer USING (NULLIF(col_name, '')::integer); As pointed …

Refresh