I am trying to insert into a table using the Select statement and get values from function.
INSERT INTO TABLE1
([Col1]
, [Col2]
,[Col3]
,[Col4]
,[Col5]
,[CreationDate]
,[CreatedBy]
)
VALUES
((Select [Col1],[Col2],[Col3],[Col4
FROM TABLE2)dbo.FUNTION(paramiter) ,SYSDATETIME(), UPPER('USERNAME'))
NOTE: im usring SQL SERVER 2008R2. please let me know how to do this?
Thanks guys
cheers
Make your select statement work first, and then INSERT INTO TABLE1 ([col1], [col2]…) SELECT…
Since your Select statement is broken right now, the insert is also broken. Fix your select to something like