Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
conorpboland
Starting Member
1 Post |
Posted - 2009-07-21 : 06:45:11
|
| Hi. I have two tablesHostNameTableHost ID PKHostNameLogTableLog ID PK auto IncrementHostID FKMessageI need to do an insert onto the Log Table and reference the HostID of the HostTable that corresponds to the Name of the host.Insert into LotTable (HostID, Message) values (select hsotid from hosttable where hostname = @host, "message string") does not work as a statement.I am using TSQL |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-07-21 : 06:52:39
|
| insert into lottable (hostid,message)select hostid,'message string' from hosttable where hostname = @host |
 |
|
|
|
|
|