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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Joining Fields to create a new field.

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-08-15 : 09:11:48
Simon writes "I need to create a username, first we have a table called member and in that table we have a nickname and a memberid. there is also a second table called login and in there it also has the memberid and a field called username. I want to insert a value into that field which is the nickname plus the memberid from the member table.

Please help

Regards,

Simon"

JustinBigelow
SQL Gigolo

1157 Posts

Posted - 2002-08-15 : 09:16:16
try...


update login
set username = m.nickname + ' ' + cast(memberid as varchar(x))
from member m inner join login l
on m.memberid = l.memberid


hth,
Justin

Have you hugged your SQL Server today?
Go to Top of Page
   

- Advertisement -