Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert query

Status
Not open for further replies.

sardinka2

Programmer
May 6, 2004
38
0
0
US
What is wrong with my query?It will not compile
insert into table1
(GID, SID, DateEntered)
values (
select GID,SID,getdate()
from table2
where GID='1' and SID
not in (select SID from table3
where GID='1')
)
 
You can't use the values clause and select together.
Try this instead
Code:
insert    into    table1
    (GID, SID, DateEntered)
select GID,SID,getdate()
    from table2
    where GID='1'  and SID
             not in (select SID from table3
                where  GID='1')

Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top