Groups | Blog | Home
all groups > sql server programming > february 2004 >

sql server programming : 'Parameters' question


Suzanne
2/22/2004 7:18:01 PM
Hi...This is another problem that is eluding me.
Suggestions on how this should be coded in Sql 2000? I
receive 'incorrect syntax' for 'text' on line 1
and 'tblApTransInvoiceTax' on line 4.

PARAMETERS pTransId Text ( 255 );
DELETE DISTINCTROW tblApTransInvoiceTax.*,
tblApTransInvoiceTax.TransId
FROM tblApTransInvoiceTax
WHERE (((tblApTransInvoiceTax.TransId)=[pTransId]));

This is new to me...learning as I go !

anonymous NO[at]SPAM discussions.microsoft.com
2/22/2004 7:34:36 PM
Also... I changed the query to the following. Query
Analyzer parsed it ok..but the execute gave an error of
'invalid column name ptransid' on line 4

DECLARE @pTransId nvarchar(50)
SET @ptransid = ptransid
DELETE FROM tblApTransInvoiceTax
WHERE tblApTransInvoiceTax.TransId= @pTransid;
[quoted text, click to view]
anonymous NO[at]SPAM discussions.microsoft.com
2/22/2004 8:25:56 PM
This parm value for ptransid appears to be created/set
from a Form ...

[quoted text, click to view]
suzanne
2/22/2004 9:53:42 PM
I have the BOL...but I found it didn't answer my
questions.. for example, I never made the connection
between using Case in place of IIf. Would be nice if
there was a place that gave conversion options or
alternate commands for similar function.

I will continue to look there first of course..and, if
all else fails, at least I have a place to go. You've
been a great help to me on these problems (that have
plagued my for a week!). One more to go (watch out!)

Suzanne
[quoted text, click to view]
FamilyID=a6f79cb1-a420-445f-8a4b-
bd77a7da194b&DisplayLang=en
[quoted text, click to view]
Ray Higdon
2/22/2004 10:39:23 PM
I assume you will only pass one transID:

declare @pTransId varchar( 255 )
set @pTransId = ???
DELETE FROM tblApTransInvoiceTax
WHERE tblApTransInvoiceTax.TransId=@pTransId
--or create as proc

create proc deleterow
@ptransid varchar(255)
as
DELETE FROM tblApTransInvoiceTax
WHERE tblApTransInvoiceTax.TransId=@pTransId

exec deleterow 'pass your parameter'

You might benefit from using BOL, I know I do :)
http://www.microsoft.com/downloads/details.aspx?FamilyID=a6f79cb1-a420-445f-8a4b-bd77a7da194b&DisplayLang=en

HTH

--
Ray Higdon MCSE, MCDBA, CCNA
---
[quoted text, click to view]

Ray Higdon
2/22/2004 10:47:22 PM
What value do you want the param to have?

--
Ray Higdon MCSE, MCDBA, CCNA
---
[quoted text, click to view]

Ray Higdon
2/23/2004 6:15:30 AM
Then you might look at the proc in my other reply, it allows you to pass it
a value

--
Ray Higdon MCSE, MCDBA, CCNA
---
[quoted text, click to view]

AddThis Social Bookmark Button