I'm trying to do a kind of weird insert statement in an asp.net page. This is an example of what I'm trying to do, but when I fill in the values myself to test it, I get the errors I pasted below the insert statement:insert into Export (exportName, profileID, storeID)values (@name, (select profileID from [Profile] where pName=@pName), (select storeID from [Store] where storeName=@storeName))Msg 1046, Level 15, State 1, Line 2Subqueries are not allowed in this context. Only scalar expressions are allowed.Msg 102, Level 15, State 1, Line 2Incorrect syntax near ')'.
So does this mean I cannot use subqueries in insert statements? Or am I doing something wrong?Any suggestions for a better way to do this?Thanks!