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 |
evanburen
Posting Yak Master
167 Posts |
Posted - 2006-12-21 : 21:35:35
|
I want to insert a new record into a table TCompProfileCustom where the userID matches the table TSubscribers. I'm not sure how to do this. ThanksINSERT INTO TCompProfileCustom(UserID, ProfileName, DateCreated, divDefault, divOrder)Vales(?, 'ProfileName, '12/21/2006', 0, 'Div1, Div2') |
|
evanburen
Posting Yak Master
167 Posts |
Posted - 2006-12-21 : 21:45:13
|
I didn't phrase this question very well. I want to insert a new record into TCompProfileCustom where the AccountNo in Tsubscribers is '00245'. The userID value in the insert statement comes from the TSubscribers table. Thanks.insert into TCompProfileCustom(UserID, ProfileName, DateCreated, divDefault, divOrder)VALUES (select tsubscribers.userid from tsubscriberswhere tsubscribers.AccountNo='00245', 'Test', '12/22/2006', 0, 'Div1') |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-12-21 : 22:36:20
|
[code]insert into TCompProfileCustom (UserID, ProfileName, DateCreated, divDefault, divOrder)select userid, 'Test', '12/22/2006', 0, 'Div1'from tsubscriberswhere AccountNo='00245'[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-12-22 : 00:35:35
|
<<'12/22/2006'>>If the server date format is DMY, that will give you errorAlways use Universal Format'20061222'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|