Question : Select Into Error

I receive the following error on the query below:

Msg 1038, Level 15, State 5, Line 1
An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Add a name or single space as the alias name.

What am I doing wrong?
1:
2:
3:
4:
5:
SELECT  Item_Number,
        Standard_Cost,
        GETDATE()
INTO    dbo.tspItem_Price_Audit
FROM    dbo.tspvItemMaster

Answer : Select Into Error

because the resulting table already exist, you need to use "insert into" instead of "select into"

insert into dbo.tspItem_Price_Audit (Item_Number,  Standard_Cost, audit_date)
SELECT  Item_Number,
        Standard_Cost,
        GETDATE()
FROM    dbo.tspvItemMaster
Random Solutions  
 
programming4us programming4us