I created a database from the following flow chart: https://www.learncodinganywhere.com/learningmanagementsystem/links/07_DB/SQL_Drill.pdf
I am trying to retrieve the book title, borrower name, and borrower address in my 'Booksville' library branch where the due date is today. I created the following query:
Title, b.[Name], b.[Address] as 'Due Today'
BOOK_LOANS bl ON b.CardNo = bl.CardNo
LIBRARY_BRANCH lb ON lb.BranchId = bl.CardNo
BOOK bk ON bk.BookId = bl.BookId
BranchName = 'Booksville'
AND DueDate = '10-25-2016'
Msg 248, Level 16, State 1, Line 1
The conversion of the varchar value '5397270262193419' overflowed an int column.
Ok there is information enought, but usually you get this error comparing numeric and alphanumeric fields.
I don't know the table schema but it seems there is mistake here:
BranchId should match CardNo?