Click here to Skip to main content
15,905,875 members
Home / Discussions / Database
   

Database

 
GeneralRe: Copy database from one remote environment to development environment Pin
Richard Deeming10-Jul-13 3:45
mveRichard Deeming10-Jul-13 3:45 
GeneralRe: Copy database from one remote environment to development environment Pin
jschell10-Jul-13 8:24
jschell10-Jul-13 8:24 
Questionmyisam or innodb? how would you decide? Pin
Jassim Rahma8-Jul-13 5:55
Jassim Rahma8-Jul-13 5:55 
QuestionRe: myisam or innodb? how would you decide? Pin
Eddy Vluggen8-Jul-13 7:24
professionalEddy Vluggen8-Jul-13 7:24 
AnswerRe: myisam or innodb? how would you decide? Pin
jschell8-Jul-13 8:43
jschell8-Jul-13 8:43 
AnswerRe: myisam or innodb? how would you decide? Pin
Richard MacCutchan8-Jul-13 21:34
mveRichard MacCutchan8-Jul-13 21:34 
QuestionSql injection Attack Pin
Aatif Ali from Bangalore5-Jul-13 3:32
professionalAatif Ali from Bangalore5-Jul-13 3:32 
AnswerRe: Sql injection Attack Pin
Eddy Vluggen5-Jul-13 3:38
professionalEddy Vluggen5-Jul-13 3:38 
GeneralRe: Sql injection Attack Pin
Aatif Ali from Bangalore5-Jul-13 21:16
professionalAatif Ali from Bangalore5-Jul-13 21:16 
GeneralRe: Sql injection Attack Pin
Eddy Vluggen6-Jul-13 11:37
professionalEddy Vluggen6-Jul-13 11:37 
AnswerRe: Sql injection Attack Pin
Richard Deeming5-Jul-13 3:41
mveRichard Deeming5-Jul-13 3:41 
GeneralRe: Sql injection Attack Pin
Aatif Ali from Bangalore5-Jul-13 21:15
professionalAatif Ali from Bangalore5-Jul-13 21:15 
GeneralRe: Sql injection Attack Pin
GuyThiebaut7-Jul-13 23:34
professionalGuyThiebaut7-Jul-13 23:34 
GeneralRe: Sql injection Attack Pin
Richard Deeming8-Jul-13 1:46
mveRichard Deeming8-Jul-13 1:46 
QuestionCalculation For Time Attendance System Pin
caulsonchua3-Jul-13 22:13
caulsonchua3-Jul-13 22:13 
AnswerRe: Calculation For Time Attendance System Pin
Mycroft Holmes4-Jul-13 23:26
professionalMycroft Holmes4-Jul-13 23:26 
AnswerRe: Calculation For Time Attendance System Pin
Amol_B7-Jul-13 20:58
professionalAmol_B7-Jul-13 20:58 
GeneralRe: Calculation For Time Attendance System Pin
caulsonchua7-Jul-13 21:13
caulsonchua7-Jul-13 21:13 
Questionsqlserver 2005 connection problem Pin
hamadam212-Jul-13 23:13
hamadam212-Jul-13 23:13 
AnswerRe: sqlserver 2005 connection problem Pin
Eddy Vluggen3-Jul-13 0:30
professionalEddy Vluggen3-Jul-13 0:30 
QuestionSQL Server 2012 - forming relationship between tables Pin
RickBStewart2-Jul-13 10:53
RickBStewart2-Jul-13 10:53 
AnswerRe: SQL Server 2012 - forming relationship between tables Pin
Richard Deeming2-Jul-13 11:06
mveRichard Deeming2-Jul-13 11:06 
All of the primary key columns from the table on the "one" side need to be present in the table on the "many" side. In this case, you would add both building name and room number to your assets table, and specify both columns in the FOREIGN KEY relationship.

I'd be inclined to move the buildings out to a separate table with a surrogate key, since the value is likely to be repeated across many rows in the rooms table. Similarly, room type and staff name might be better in their own lookup tables, depending on your data.

Buildings
---------
BuildingId (PK)
BuildingName

Rooms
-----
BuildingId (PK, FK->Buildings)
RoomNumber (PK)
...

Assets
------
AssetNumber (PK)
BuildingId (FK->Rooms)
RoomNumber (FK->Rooms)
...




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: SQL Server 2012 - forming relationship between tables Pin
RickBStewart2-Jul-13 11:47
RickBStewart2-Jul-13 11:47 
GeneralRe: SQL Server 2012 - forming relationship between tables Pin
Mycroft Holmes2-Jul-13 13:01
professionalMycroft Holmes2-Jul-13 13:01 
GeneralRe: SQL Server 2012 - forming relationship between tables Pin
Ralph D. Wilson II10-Jul-13 6:50
Ralph D. Wilson II10-Jul-13 6:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.