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 |
|
james_yoder@hotmail.com
Starting Member
9 Posts |
Posted - 2003-10-01 : 07:34:20
|
| Here is a simple problem : I want to assign a variable the number of rows that meet a given view condition. Problem is when I try this I get an error.Here is the SQL statment :DECLARE@MyRowCount AS IntSET @MyRowCount = (SELECT COUNT(*) FROM v_Gallery)Where v_Gallery is a view. I get the following Error : Server: Msg 8624, Level 16, State 16, Line 3Internal SQL Server error.I know this must have something to do with the view, but when I excute the simple command SELECT COUNT(*) FROM v_Gallery I don't get any error, and the correct number is returned.Anyone out there have any idea why this happens?Thanks for your help.James |
|
|
samsekar
Constraint Violating Yak Guru
437 Posts |
Posted - 2003-10-01 : 07:46:44
|
| Try this,DECLARE@MyRowCount AS IntSELECT @MyRowCount =COUNT(*) FROM v_GallerySELECT @MyRowCount 'My Row Count'- Sekar |
 |
|
|
james_yoder@hotmail.com
Starting Member
9 Posts |
Posted - 2003-10-01 : 08:57:50
|
That did it Thanks! |
 |
|
|
|
|
|