Code samples do not correlate well with the rest of the information provided. Without code, your post seems consistent enough, so I tend to think these fragments are simply wrong.
In any case, your idea seems clear. In SQL Server 2005+, you can solve your problem with an INSERT statement like this:
string insertCommand = "INSERT INTO Topics (Theme, Topics, Date) " + "OUTPUT 'CONVERT(uniqueidentifier, '" + giveMeGuidID() + "'), INSERTED.TopicID, @dateTime, @questionTitle, @subTopic " + "INTO Threads (UserID, TopicID, Date, ThreadTitle, ThreadParagraph) " + "VALUES (@Theme, @Topics, @Date)";
Although this is a single statement, it performs two inserts into different tables. The "main" insert is done in the Topics table. Secondary, in Threads , is defined by the OUTPUT...INTO clause. Basically, the OUTPUT clause allows you to reference the inserted data and either return it as a set of rows to the client, or (in combination with INTO ) direct them to an existing table, as you can see here.
source share