Click here to Skip to main content
15,900,258 members
Home / Discussions / Database
   

Database

 
GeneralRe: Retrieving the lastest instance of a record Pin
#realJSOP22-Mar-10 0:05
professional#realJSOP22-Mar-10 0:05 
GeneralRe: Retrieving the lastest instance of a record Pin
i.j.russell22-Mar-10 0:13
i.j.russell22-Mar-10 0:13 
GeneralRe: Retrieving the lastest instance of a record Pin
#realJSOP21-Mar-10 2:26
professional#realJSOP21-Mar-10 2:26 
AnswerRe: Retrieving the lastest instance of a record [ SOLVED] Pin
Luc Pattyn20-Mar-10 4:49
sitebuilderLuc Pattyn20-Mar-10 4:49 
GeneralRe: Retrieving the lastest instance of a record [ SOLVED] Pin
#realJSOP20-Mar-10 6:22
professional#realJSOP20-Mar-10 6:22 
QuestionT-SQL - Select with relationships Pin
#realJSOP20-Mar-10 2:50
professional#realJSOP20-Mar-10 2:50 
AnswerRe: T-SQL - Select with relationships Pin
amer shammout20-Mar-10 4:25
amer shammout20-Mar-10 4:25 
AnswerRe: T-SQL - Select with relationships Pin
i.j.russell20-Mar-10 4:28
i.j.russell20-Mar-10 4:28 
Yes you still have to do a join if you want data from both tables. A Foreign Key constraint is there to only allow non-null values that are in the parent column. The FK plays no part in the query; If you were to remove it, the query would still work just as well.

By the way, your chosen style of joins is not considered to be good practice and may well be deprecated in future versions of Sql Server.

SELECT *
FROM TableA a
JOIN TableB b
    ON b.ID = a.ID


The primary reason for this is that if you forget/remove the WHERE clause you have a CROSS JOIN. This can't happen with the suggested approach.

Ian
QuestionSQL server encryption Pin
Central_IT19-Mar-10 6:00
Central_IT19-Mar-10 6:00 
QuestionRe: SQL server encryption Pin
Chris Meech19-Mar-10 8:20
Chris Meech19-Mar-10 8:20 
AnswerRe: SQL server encryption Pin
Jörgen Andersson19-Mar-10 8:59
professionalJörgen Andersson19-Mar-10 8:59 
GeneralRe: SQL server encryption Pin
Chris Meech19-Mar-10 11:26
Chris Meech19-Mar-10 11:26 
AnswerRe: SQL server encryption Pin
Jörgen Andersson19-Mar-10 8:56
professionalJörgen Andersson19-Mar-10 8:56 
QuestionSQL Server Interview Question and Answers - Need your valuable comments, real experience and suggestions Pin
pinaldave18-Mar-10 23:07
pinaldave18-Mar-10 23:07 
AnswerRe: SQL Server Interview Question and Answers - Need your valuable comments, real experience and suggestions Pin
i.j.russell19-Mar-10 2:03
i.j.russell19-Mar-10 2:03 
GeneralRe: SQL Server Interview Question and Answers - Need your valuable comments, real experience and suggestions Pin
pinaldave19-Mar-10 2:32
pinaldave19-Mar-10 2:32 
GeneralRe: SQL Server Interview Question and Answers - Need your valuable comments, real experience and suggestions Pin
Jörgen Andersson19-Mar-10 4:11
professionalJörgen Andersson19-Mar-10 4:11 
GeneralRe: SQL Server Interview Question and Answers - Need your valuable comments, real experience and suggestions Pin
Andy_L_J19-Mar-10 18:08
Andy_L_J19-Mar-10 18:08 
QuestionDatabase design for a private message system Pin
Joshua Tully18-Mar-10 19:35
Joshua Tully18-Mar-10 19:35 
AnswerRe: Database design for a private message system Pin
Wayne Gaylard18-Mar-10 21:21
professionalWayne Gaylard18-Mar-10 21:21 
GeneralRe: Database design for a private message system Pin
Joshua Tully18-Mar-10 22:24
Joshua Tully18-Mar-10 22:24 
GeneralRe: Database design for a private message system Pin
Wayne Gaylard19-Mar-10 1:48
professionalWayne Gaylard19-Mar-10 1:48 
Questionstored procedur to update multiple tables Pin
Enobong Adahada18-Mar-10 2:05
Enobong Adahada18-Mar-10 2:05 
Questionstored procedur to update multiple tables Pin
Enobong Adahada18-Mar-10 1:21
Enobong Adahada18-Mar-10 1:21 
AnswerRe: stored procedur to update multiple tables Pin
Wayne Gaylard18-Mar-10 1:49
professionalWayne Gaylard18-Mar-10 1:49 

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.