I have two tables in my DB.
#Table 1 - asset
Fields (asset{PK}, login{FK}, department)
#Table 2 - users
Fields (login{PK}, department)
Basically what I want to do is import the users.department data into the asset.department based upon the asset.login.
I.E.
If table1 has these rows
1,baddos,NULL
2,baddos,NULL
3,joeuser,NULL
I want SQL to grab the department ID from the users table based on their login Primary key and through it into the asset table for evey row matching the login id.
Can this be done w/ a SQL script, or do I need to program something outside of SQL to do the job?
-Bad Dos
#Table 1 - asset
Fields (asset{PK}, login{FK}, department)
#Table 2 - users
Fields (login{PK}, department)
Basically what I want to do is import the users.department data into the asset.department based upon the asset.login.
I.E.
If table1 has these rows
1,baddos,NULL
2,baddos,NULL
3,joeuser,NULL
I want SQL to grab the department ID from the users table based on their login Primary key and through it into the asset table for evey row matching the login id.
Can this be done w/ a SQL script, or do I need to program something outside of SQL to do the job?
-Bad Dos