Hi,I've built the following SQL which doesn't seem to error, but which doesn't actually work. I've tested to make sure there's content in my temp table, which there is:insert into documentimagedraft ( documentId, imageID, version, editorId, modified)select @documentId, --this is set elsewhere imageID, --this is coming out of the temp table 1, --this is a contstant editorId, -- this is coming out of the temp table getdate()from #contentImages
I assume this is going wrong because I'm trying to mix variables, constants and other fixed values with column values coming out of the temp table.Is there any way I can do this? I'm in a bit of a bind because I need to be able to insert into DocumentImageDraft a number of rows equal to that in the temp table, with some of the values from that table. However the temp table itself comes from XML using a similar insert/select syntax, so I can't actually insert the other required values into the temp table as it's generated (and the values aren't in the XML either):select imageID, imageTypeID, notes, editorIdinto #contentImagesfrom openxml (@idoc, '/content/document/image', 2) -- read elementswith ( imageID int, imageTypeID int, notes varchar(1000), editorID int0)
Any way round this?Cheers,Matt