本文介绍了为什么存储过程运行我的Quary不止一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 SELECT CI.ImageId , CI.CombinationId , C.Id FROMProduction.Product PINNER JOINProduction.Combination CONP.Id = C.Product_IdAND P.Id = 11INNER JOINProduction.Combination_Image CI ONC.Id = CI.CombinationIdINNER JOINProduction.[Image] ION CI.ImageId = I.IdANDI.Id = 18 和我的结果是对的 and here my Result is right RESULT :181212 很好,这是我的真实结果但是! :| 现在我将该查询作为存储过程 就像在这里一样 Its fine and that's my real Result BUT !!! :|NOW I make that query as a stored procedurelike under hereCREATE PROC GetCombinationAndCombinationImageByProductIdAndImageId@ProductId INT,@ImageId INTASBEGINSELECT CI.ImageId , CI.CombinationId , C.Id FROMProduction.Product PINNER JOINProduction.Combination CONP.Id = C.Product_IdAND P.Id = @ProductIdINNER JOINProduction.Combination_Image CI ONC.Id = CI.CombinationIdINNER JOINProduction.[Image] ION CI.ImageId = I.IdANDI.Id = @ImageIdEND-- and here EXECUTE my procEXEC GetCombinationAndCombinationImageByProductIdAndImageId @ProductId = 11 , @ImageId=18 AND ...结果:| AND ... RESULT :|(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 GetCombinationAndCombinationImageByProductIdAndImageId, Line 55Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32). 请帮助我:) 关心Please Help Me :)Regards推荐答案 ALTER PROC GetCombinationAndCombinationImageByProductIdAndImageId@ProductId INT,@ImageId INTASBEGINSELECT CI.ImageId , CI.CombinationIdFROMProduction.Product PINNER JOINProduction.Combination CONP.Id = C.Product_IdAND P.Id = @ProductIdINNER JOINProduction.Combination_Image CI ONC.Id = CI.CombinationIdINNER JOINProduction.[Image] ION CI.ImageId = I.IdANDI.Id = @ImageIdENDGOEXEC GetCombinationAndCombinationImageByProductIdAndImageId @ProductId = 11 , @ImageId=17GO 这篇关于为什么存储过程运行我的Quary不止一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-15 21:28