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 |
logicmechanic
Starting Member
4 Posts |
Posted - 2009-01-14 : 16:26:12
|
Simple select statement to a table in a different database (same sql server 2000 install) does not return anything. No errors, no indication what the problem is. the statement:select @BU = BalanceUnits, @UU = UsedUnits from dbProduct.dbo.tblUnits where UnitID = @IDIs there some trick I should know about? Permissions maybe?Thank you. |
|
logicmechanic
Starting Member
4 Posts |
Posted - 2009-01-14 : 16:42:59
|
I forgot to mention, if I take the statement out of the stored procedure and modify it to just return a record, it works. I am using debug the stored procedure in Query analyzer. |
|
|
rohitkumar
Constraint Violating Yak Guru
472 Posts |
Posted - 2009-01-14 : 16:46:48
|
its simply setting values of variables @BU and @UU and will not return anythingdo a SELECT @BU, @UUafter your select to check. |
|
|
logicmechanic
Starting Member
4 Posts |
Posted - 2009-01-14 : 17:02:27
|
This is inside a stored procedure and I am using debug the stored procedure in query analyzer. I can see the variables do not populate with the data from the dbProduct.dbo.tblUnits table which resides in a different database even though it is the same sql server install. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
logicmechanic
Starting Member
4 Posts |
Posted - 2009-01-15 : 11:21:59
|
Thank you Tara. I must have been tired yesterday when thinking about this. You are correct, there was no row returned on the select. I will now build in accounting for that very scenario. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|