> -----Original Message-----
> From: Spencer Read [mailto:[EMAIL PROTECTED]
> Subject: RE: -  SQL 2005 Trigger variable problem????
> 
> I never thought of that, but I changed it and it still doesn't work -
> exactly the same result

Have you used SQL Server Profiler to see what is going on?


Webster

> -----Original Message-----
> From: Webster [mailto:[EMAIL PROTECTED]
> Subject: RE: -  SQL 2005 Trigger variable problem????
> 
> > -----Original Message-----
> > From: Spencer Read [mailto:[EMAIL PROTECTED]
> > Subject: OT:-  SQL 2005 Trigger variable problem????
> >
> > I'm trying to build a trigger in SQL 2005 SP2 - code is at the bottom
> > The trouble is that in a query window with an order number fed in
> > manually (set @order_no = '086534' for example) the code works fine,
> > but as a trigger @pcode1 and @pcode2 are not getting populated and
> the
> > code fails
> 
> 
> > It does actually send an email but the debug text I have put to send
> me
> > in the email comes back as @ser_test = '0', @order_no is correct as
> > inserted, but @pcode1 and 2 are either empty or null
> 
> > set @pcode1 = (select replace(upper(address5),' ','') as address5
> from
> > scheme.opheadm with (nolock) where order_no = @order_no)
> > set @pcode2 = (select replace(upper(post_code),' ','') as post_code
> > from scheme.ophdrpcm with (nolock) where order_no = @order_no)
> 
> As someone who is learning SQL, aren't you using an Alias that is the
> same
> name as a column?  Adddress5 is a column and an alias.  Same with
> post_code.
> Since I am just learning this SQL stuff try:
> 
> set @pcode1 = (select replace(upper(address5),' ','') as [addressfive]
> from
> scheme.opheadm with (nolock) where order_no = @order_no)
> 
> set @pcode2 = (select replace(upper(post_code),' ','') as [postal_code]
> from scheme.ophdrpcm with (nolock) where order_no = @order_no)
> 
> Just a thought from a SQL Beginner.



~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

Reply via email to