Hi, In MICROSOFT SQL SERVER have the following table:
CREATE TABLE [T1]
(
[ID] int IDENTITY (1, 1) NOT NULL,
[col1] int NOT NULL,
[col2] int NOT NULL,
[col3] int NULL,
[col4] datetime NOT NULL DEFAULT (getdate()),
[col5] datetime NOT NULL DEFAULT (getdate())
)
I want to write an insert statement that select 2 columns from another table and insert all the other column as NULL or default. This is what I have tried so far (but it doesn't work):
INSERT INTO [T1] ([col1],[col2], [COL3])
SELECT [1column],[2column],NULL
FROM [T2]
When I right click on T1 table and select open table the table has only 2 columns, even if in the columns "folder" in object explorer there are all the columns
What I want to achieve is to have in T1: in Col1 and COL2 the result of the SELECT and in COL3 NULL and in COL4 and COL5 the default value!