Hi!
I'm using VS2005 and trying to save my very simple stored procedure.
The error message "Invalid object name 'dbo.xxxxx' just pop's up.
The SP is written through the Server Explorer > Stored Procedures > Add new... etc.
Using SQL server 2000.
Don't think this has to do with the SP-code but here it is:
ALTER PROCEDUREdbo.KontrollUnikPersNr
@.PersNrnvarchar(50) =null OUTPUT
AS
SELECT@.PersNr = PersNrFROMUserWHEREPersNr = @.PersNr
RETURN@.@.ROWCOUNT
Thanx i advance for any help!
Looks like you are trying to ALTER a proc that does not exist. Try changing the ALTER to CREATE and see if it helps.
Also, I dont understand what you are trying to return from the stored proc - the rowcount or the value from the database?
|||Thanx a lot!
I changed the Alter to Create and it works... didn't have to think of the in VS2003.
I'm returning the rowcount to see if there is any Users with the specific values that has to be unique in my user database table.
Thanks a lot again!
If you just need the count you could do it like this:
ALTER PROCEDURE dbo.KontrollUnikPersNr@.PersNrvarchar(50) =NULL,@.countint OUTPUTASBEGINSET NOCOUNT ONSELECT @.count =count(*)FROMUserWHERE PersNr = @.PersNrSET NOCOUNT OFFEND|||
Hm, did'nt think of that... nice.
Thanx a lot again... let me know if I can help you with any tricky stuff.. erhm...
No comments:
Post a Comment