Konuyu Oyla:
  • Derecelendirme: 0/5 - 0 oy
  • 1
  • 2
  • 3
  • 4
  • 5
Maximum stored procedure, nesting level exceeded (limit 32) hatası
#1
Öncelikle herkese hayırlı günler diliyorum , 

sonrasında da bir sorunumu sizinle paylaşmak istedim.

CREATE PROC LogEkle
(
 @tip as int
 @adet as int ,
 @durum as int , 
 @sonuc int Output
)
AS
BEGIN
 INSERT INTO LogA (Tarih,  tip , adet, durum) Values (getdate(),@tip,@adet, @durum)
 SET @Sonuc= @@ERROR
END


sonrasında kullanmak için

EXEC logEkle 1,2,0
Şöyle bir hata veriyor.
"Procedure or function 'AktarimLog_Ekle' expects parameter '@sonuc', which was not supplied."

sonuc parametresinide gönderirsem 
EXEC logEkle 1,2,0,0

yazdığım zaman çalışıyor fakat bu seferde birkez çalışmasına rağmen

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)
Msg 217, Level 16, State 1, Procedure LogEkle, Line 18
Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32).


sonuç yukarıdaki gibi.


Teşekkürler.
Cevapla
#2
Output olarak proc içinde declare ettiğin değişkeni, procu çağırırken output yapacağın değişkeni declare ederek execute etmen lazım.
Declare @snc
EXEC logEkle 1,2,0,@snc output
Select @snc
İmam Süleyman Yakub <--> Molla Mustafa Mansur
Evlatlarım!
Cismanımız TÜRK ruhumuz ise İSLAM.
Bu yolda daim olalım her an.
Cevapla
#3
bu çoklu kayıt ve tekrarlı çalışma bundan mıdır ?

çünkü  Procedure değilde  "INSERT INTO LogA (Tarih,  tip , adet, durum) Values (getdate(),@tip,@adet, @durum)"

bu şekilde çalıştırdığımda sorun yok kodları o şekilde değiştirdim ama birkaç yerde kullanmam gerekecek o yüzden eğer olabiliyorsa procedure şeklinde olması daha iyi tabi birde sorunu öğrenmek hepsinden iyi.

cevabınız için teşekkürler bu arada.

Declare @snc
EXEC  LogEkle 1,2,0,@snc output
SELECT @snc

Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'EXEC'.
Msg 137, Level 15, State 2, Line 2
Must declare the scalar variable "@snc".
Msg 137, Level 15, State 2, Line 3
Must declare the scalar variable "@snc".

kodu bu şekilde çağırdığımda da yukarıdaki gibi hata verdi.
Cevapla
#4
Declare @snc int
EXEC LogEkle 1,2,0,@snc output
SELECT @snc
@snc tipini vermemişiz. yukardaki gibi yaparsan çalışacaktır.
İmam Süleyman Yakub <--> Molla Mustafa Mansur
Evlatlarım!
Cismanımız TÜRK ruhumuz ise İSLAM.
Bu yolda daim olalım her an.
Cevapla
#5
teşekkürler , kusura bakmayın dikkatsizlik ettim. Doğru bu şekilde çalışıyor fakat yien çoklu çalışıyor ve 32 den sonra yukarıdaki gibi hata veriyor.
Cevapla
#6
Bu sp'yi nerden çağırıyorsun?
Yukardaki gibi bir hata durumuyla karşılaşmadım önceden.
Aynı yapıyı test ettim.

Query opened in 0,008s [0,004s exec, 0,004s fetch]
1 records selected

oluyor bende. LogA tablo structure'ını paylaşabilirsen (trigger vs.. dahil) bir daha test edeyim.
İmam Süleyman Yakub <--> Molla Mustafa Mansur
Evlatlarım!
Cismanımız TÜRK ruhumuz ise İSLAM.
Bu yolda daim olalım her an.
Cevapla
#7
Çok büyük olasılıkla LogA tablosunun insert trigger'ında aynı Log metoduna bir çağrım vardır. Bana kalırsa trigger'ı bir kontrol edin.
Mal sahibi, mülk sahibi
Hani bunun ilk sahibi ?
Mal da yalan mülk de yalan
Var biraz da sen oyalan...
WWW
Cevapla


Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Son Yorum
  DBNETLIB Hatası hakkında adelphiforumz 5 1.777 02-06-2023, Saat: 14:18
Son Yorum: Misc-2
  Stored Procedure barissagir 1 698 07-12-2022, Saat: 16:59
Son Yorum: yhackup
  Stored Procedure Önceki gün devir. smokie 7 4.803 27-09-2020, Saat: 22:00
Son Yorum: anemos
  [ ÇÖZÜLDÜ ]MSSQL VeriTabanına Tarih Kaydetme Hatası theSinan 7 7.907 04-09-2019, Saat: 10:57
Son Yorum: theSinan
  Arama hatasi gonulali 8 5.483 27-08-2019, Saat: 09:25
Son Yorum: adelphiforumz



Konuyu Okuyanlar: 1 Ziyaretçi