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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Delete stored procedure

Author  Topic 

densma
Starting Member

21 Posts

Posted - 2004-05-27 : 12:30:39
trying to create Delete stored procedure with where clause but when i pass parameter i get 0 row(s) affected
it's wont delete

here my code
create PROCEDURE deldispute
(@id char, @ticket char)
AS
DELETE FROM TBLES
where theirid=@id
and ticket=@ticket


wht's wrong with that code and why it wont delete?

Kristen
Test

22859 Posts

Posted - 2004-05-27 : 14:26:46
Do yuo need a SIZE after the char definition?

Kristen
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-05-27 : 14:33:16
Unless it's 1 byte long


DECLARE @x varchar
SELECT @x = '123456789012345678901234567890123456789012345678901234567890'
SELECT @x



I thought it defaulted to 30 though....



Brett

8-)
Go to Top of Page

LarsG
Constraint Violating Yak Guru

284 Posts

Posted - 2004-05-27 : 14:55:21
quote:

I thought it defaulted to 30 though...




cast(v as varchar)


that defaults to 30 for some inconsistent reason.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-27 : 15:07:06
I'm guessing that the parameters aren't being passed properly. What happens when you execute the stored procedure from Query Analyzer?

Tara
Go to Top of Page
   

- Advertisement -