Re: max sp, func, trig, or view nesting level...
From: Alex (Alex_at_discussions.microsoft.com)
Date: 07/02/04
- Next message: Alex: "Re: max sp, func, trig, or view nesting level..."
- Previous message: Mingqing Cheng [MSFT]: "RE: Triggers - Inserted and Deleted tables cross join?"
- In reply to: Steve Kass: "Re: max sp, func, trig, or view nesting level..."
- Next in thread: Steve Kass: "Re: max sp, func, trig, or view nesting level..."
- Reply: Steve Kass: "Re: max sp, func, trig, or view nesting level..."
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 1 Jul 2004 19:01:02 -0700
No triggers - anywhere...
"Steve Kass" wrote:
> Did you look for triggers?
>
> SK
>
> Alex wrote:
>
> >None. That's the strange part....
> >Does the Proc code seem good to you?
> >
> >All I'm doing is checking if record exists in the Donor table that matches that of sys_load. If it does, create a new record in DonorDonations, if it doesn't create a new record in the Donor table....
> >
> >I'm stumped. Thanks for your help, Steve.
> >
> >
> >"Steve Kass" wrote:
> >
> >
> >
> >>Alex,
> >>
> >> Is there a trigger on dbo.Donor, dbo.DonorDonation, or dbo.sys_load?
> >>I suspect the problem is not with the code you've posted here, since it
> >>doesn't seem to be recursive.
> >>
> >>Steve Kass
> >>Drew University
> >>
> >>Alex wrote:
> >>
> >>
> >>
> >>>Hi,
> >>>I have created the following procedure, which is returning the Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32) error message.
> >>>
> >>>Your assistance is appreciated....
> >>>
> >>>BEGIN
> >>> SET nocount on
> >>> TRUNCATE TABLE sys_load -- load the sys_load table initially
> >>> insert into dbo.sys_load (FirstName, LastName, Address, City, State, Zip, Phone, Prayer, DateEntered, Station)
> >>> select "First Name", "Last Name", "Address", "City", "State", "Zip", "Phone", "Prayer", "Date Entered", "Station"
> >>> from OpenRowset('Microsoft.Jet.OLEDB.4.0',
> >>> 'Excel 8.0;Database=C:\MyExcelog.xls',
> >>> 'select * from [Excel Export File$]')
> >>> -- see if a record already exists for the new Donor
> >>> declare @intId int, @FirstName nvarchar(64), @LastName nvarchar(64),@Country nvarchar(64), @Email nvarchar(64)
> >>> declare donor cursor for
> >>> select a.intId, a.FirstName, a.LastName, (case when Country='Canada' then 'TN' else 'TU' end) Country, a.Email
> >>> from dbo.Donor a, dbo.sys_load b
> >>> where a.FirstName = b.FirstName
> >>> and a.LastName = b.LastName
> >>> open donor
> >>> fetch next from donor into @intId, @FirstName, @LastName, @Country, @Email
> >>> while (@@FETCH_STATUS != -1)
> >>> begin
> >>> -- NO Donor Found with that FirstName, LastName
> >>> if (@@FETCH_STATUS = -2)
> >>> begin
> >>> insert into dbo.Donor (FirstName, LastName, City, State, Zip, Phone,CompanyID, DateAdded)
> >>> select a.FirstName, a.LastName, a.City, a.State, a.Zip, a.Phone, 1,getdate()
> >>> from dbo.sys_load a
> >>> fetch next from donor into @intId, @FirstName, @LastName, @Country, @Email
> >>> print 'Record created in the Donor table'
> >>> end
> >>> else
> >>> -- if donor record found, insert a new record into DonorDonations
> >>> begin
> >>> while (@@FETCH_STATUS = 0)
> >>> begin
> >>> insert into dbo.DonorDonations (intId, OrderTerms, CreditCardType,Amount, DateReceived, Source, Operator, LetterId, Status)
> >>> values (@intId, 1, 0, 0, getdate(), @Country, @Email, @Country, 1)
> >>> fetch next from donor into @intId, @FirstName, @LastName, @Country, @Email
> >>> end
> >>> end
> >>> end
> >>> close donor
> >>> deallocate donor
> >>>END
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
>
>
- Next message: Alex: "Re: max sp, func, trig, or view nesting level..."
- Previous message: Mingqing Cheng [MSFT]: "RE: Triggers - Inserted and Deleted tables cross join?"
- In reply to: Steve Kass: "Re: max sp, func, trig, or view nesting level..."
- Next in thread: Steve Kass: "Re: max sp, func, trig, or view nesting level..."
- Reply: Steve Kass: "Re: max sp, func, trig, or view nesting level..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|