Hi everyone,
I'm hoping someone could spare a moment to help me with the following:
I have a table with a forename, surname, username and password column.
There are about 18000 rows in this table.
I would like to copy the value from the forename into the username column
and the surname into the password column for each row
I'm sure this can be done using TSQL or perhaps even straight SQL but I have
nt
a clue how to do it.
If anyone could advise I would greatly appreciate
Kindest Regards and Thanks in Advance
tcePlease post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, data types, etc. in
your schema are.
CREATE TABLE Foobar
(username VARCHAR(15) NOT NULL PRIMARY KEY,
password VARCHAR(15) NOT NULL,
forename VARCHAR(15) NOT NULL,
surname VARCHAR(15) NOT NULL);
UPDATE Foobar
SET user_name = fore_name,
password = sur_name;
Now, this will blow up if two or more people have the same name.|||"--CELKO--" <jcelko212@.earthlink.net> wrote in message
news:1124738964.888566.304500@.g47g2000cwa.googlegroups.com...
> Please post DDL, so that people do not have to guess what the keys,
> constraints, Declarative Referential Integrity, data types, etc. in
> your schema are.
> CREATE TABLE Foobar
> (username VARCHAR(15) NOT NULL PRIMARY KEY,
> password VARCHAR(15) NOT NULL,
> forename VARCHAR(15) NOT NULL,
> surname VARCHAR(15) NOT NULL);
>
> UPDATE Foobar
> SET user_name = fore_name,
> password = sur_name;
> Now, this will blow up if two or more people have the same name.
>
No comments:
Post a Comment