Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sirmilt
Starting Member
49 Posts |
Posted - 2010-11-02 : 12:49:48
|
| This query works perfectly in Access 2000,SELECT tblBooks.*, tblOnLoan.*FROM tblBooks LEFT JOIN tblOnLoan ON [tblBooks].[ID]=[tblOnLoan].[CollectionID]WHERE [tblBooks].[ID]=[@ID];I am trying to convert from Access to SQL Server 2008 EXpress R2 and when I try to use the same query in my Visual Basic 2008 program I get the error "Invalid column name '@ID'."There may be situations where there is no record in the tblOnLoan but there will always be a record in the table tblBooks.Milt |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-11-02 : 13:00:25
|
quote: Originally posted by sirmilt This query works perfectly in Access 2000,SELECT tblBooks.*, tblOnLoan.*FROM tblBooks LEFT JOIN tblOnLoan ON [tblBooks].[ID]=[tblOnLoan].[CollectionID]WHERE [tblBooks].[ID]=@ID;I am trying to convert from Access to SQL Server 2008 EXpress R2 and when I try to use the same query in my Visual Basic 2008 program I get the error "Invalid column name '@ID'."There may be situations where there is no record in the tblOnLoan but there will always be a record in the table tblBooks.Milt
No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-11-03 : 04:44:44
|
| You need to declare and assign a value to the variable @IDMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|