I have a SQL Server table and it is located on a remote server. I can connect to it with SQL Server Management Studio but opening it takes time instead, I am doing my jobs with SQL Query
window without reaching it.
Recently I've made a change on the local copy of this table and want to update the remote one as well. All I've done is adding one more column which is Nullable
and I'd like to learn how to add this one more column to the remote SQL Server with T-SQL
without ruining the remote one data.
Here is the additional info:
Table Name: Products
Columns to be added: LastUpdate, Nullable and varchar(200)
Thanks.
To insert a column, pick any cell in the table and right-click. Point to Insert, and pick Table Rows Above to insert a new row, or Table Columns to the Left to insert a new column.
If you use ALTER TABLE statement, it will automatically add the new column to the end of the table. The ALTER privilege is required to perform this: ALTER TABLE table_name ADD col_name data_type NULL | NOT NULL; It will not drop any existing data.
The syntax you need is
ALTER TABLE Products ADD LastUpdate varchar(200) NULL
This is a metadata only operation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With