473,386 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Getting 500 internal server error in asp.net enterprise manager while running the sto

Expand|Select|Wrap|Line Numbers
  1. CREATE PROCEDURE sp_Get_Member_xml
  2.     @MEMB_ID INT
  3. AS
  4. BEGIN
  5.     DECLARE @left_child_id INT,
  6.             @right_child_id INT,
  7.             @PARENT_MEMB_ID INT,
  8.             @MAIN_ID INT
  9.  
  10.     DECLARE @temp TABLE
  11.     (
  12.         id BIGINT IDENTITY,
  13.         member_id INT,
  14.         member_name VARCHAR(50),
  15.         left_child_id INT,
  16.         right_child_id INT,
  17.         left_child_updated INT,
  18.         right_child_updated INT,
  19.         open_tag VARCHAR(MAX) NULL,
  20.         close_tag VARCHAR(MAX) NULL
  21.     )
  22.  
  23.     SET @PARENT_MEMB_ID = @MEMB_ID;
  24.     SET @MAIN_ID = @MEMB_ID;
  25.  
  26.     INSERT INTO @temp
  27.     SELECT 
  28.         acc.memb_id,
  29.         mem.name,
  30.         acc.left_id,
  31.         acc.right_id,
  32.         0,
  33.         0,
  34.         '<M00' + CAST(mem.memb_id AS VARCHAR) + '_' + mem.name + '>',
  35.         '</M00' + CAST(mem.memb_id AS VARCHAR) + '_'  + mem.name + '>'
  36.     FROM account(NOLOCK) acc
  37.     INNER JOIN members(NOLOCK) mem
  38.     ON acc.memb_id = mem.memb_id
  39.     WHERE acc.memb_id = @MEMB_ID
  40.  
  41.     SET @MEMB_ID = 0
  42.     SELECT TOP 1 @MEMB_ID = member_id FROM @temp WHERE left_child_updated = 0 OR  right_child_updated = 0
  43.  
  44.     WHILE(@MEMB_ID != 0)
  45.     BEGIN
  46.         -- Left Child Logic
  47.  
  48.         SELECT @left_child_id = left_child_id FROM @temp WHERE member_id = @MEMB_ID AND left_child_updated = 0
  49.         SET @PARENT_MEMB_ID = @MEMB_ID;
  50.  
  51.         WHILE(@left_child_id != 0)
  52.         BEGIN
  53.             INSERT INTO @temp
  54.             SELECT 
  55.                 acc.memb_id,
  56.                 mem.name,
  57.                 acc.left_id,
  58.                 acc.right_id,
  59.                 0,
  60.                 0,
  61.                 '<M00' + CAST(mem.memb_id AS VARCHAR) + '_' + mem.name + '>',
  62.                 '</M00' + CAST(mem.memb_id AS VARCHAR) + '_'  + mem.name + '>'
  63.             FROM account(NOLOCK) acc
  64.             INNER JOIN members(NOLOCK) mem
  65.             ON acc.memb_id = mem.memb_id
  66.             WHERE acc.memb_id = @left_child_id
  67.  
  68.             UPDATE @temp SET left_child_updated = 1 WHERE member_id = @PARENT_MEMB_ID
  69.  
  70.             SET @PARENT_MEMB_ID = @left_child_id
  71.             SELECT @left_child_id = left_child_id FROM @temp WHERE member_id = @left_child_id AND left_child_updated = 0
  72.         END
  73.         UPDATE @temp SET left_child_updated = 1 WHERE member_id = @PARENT_MEMB_ID
  74.  
  75.         -- Right Child Logic
  76.  
  77.         SELECT @right_child_id = right_child_id FROM @temp WHERE member_id = @MEMB_ID AND right_child_updated = 0
  78.         SET @PARENT_MEMB_ID = @MEMB_ID;
  79.  
  80.         WHILE(@right_child_id != 0)
  81.         BEGIN
  82.             INSERT INTO @temp
  83.             SELECT 
  84.                 acc.memb_id,
  85.                 mem.name,
  86.                 acc.left_id,
  87.                 acc.right_id,
  88.                 0,
  89.                 0,
  90.                 '<M00' + CAST(mem.memb_id AS VARCHAR) + '_' + mem.name + '>',
  91.                 '</M00' + CAST(mem.memb_id AS VARCHAR) + '_'  + mem.name + '>'
  92.             FROM dbo.account(NOLOCK) acc
  93.             INNER JOIN dbo.members(NOLOCK) mem
  94.             ON acc.memb_id = mem.memb_id
  95.             WHERE acc.memb_id = @right_child_id
  96.  
  97.             UPDATE @temp SET right_child_updated = 1 WHERE member_id = @PARENT_MEMB_ID
  98.  
  99.             SET @PARENT_MEMB_ID = @right_child_id
  100.             SELECT @right_child_id = right_child_id FROM @temp WHERE member_id = @right_child_id AND right_child_updated = 0
  101.         END
  102.         UPDATE @temp SET right_child_updated = 1 WHERE member_id = @PARENT_MEMB_ID
  103.  
  104.         Print '2 - ' + CAST(@PARENT_MEMB_ID AS VARCHAR)
  105.  
  106.         SET @MEMB_ID = 0
  107.         SELECT TOP 1 @MEMB_ID = member_id FROM @temp WHERE left_child_updated = 0 OR  right_child_updated = 0    
  108.     END
  109.  
  110.     SELECT * FROM @temp
  111. END
Jul 18 '14 #1
0 1015

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ralph | last post by:
HTTP 500 - Internal server error ASP pages I am running Windows 2K with IIS 5.1 and I started having problems accessing ASP databases shortly after applying the MS patch Windows 2000 Hotfix...
10
by: | last post by:
I am accessing the same error-containing ASP page on an ISP server using w2k IE6 but with different effect. On the first computer I get several line of HTML outputed by ASP, shown correctly by...
0
by: quitaxe | last post by:
hi i have tomcat 3.3,jdk1.4 setup and running perfectly on my win 98 pc.i have tried to install apache cocoon on this but have failed.i'm getting the following error when i startup tomcat(after it...
1
by: Mike Ratliff | last post by:
When I try to create a new asp project, I get a 500 Internal Server Error trying to connect to my local IIS server. I am running xp and vb.net 2003. I added the msde database and I do not know if...
1
by: William F. Robertson, Jr. | last post by:
I am having problems with using the WebRequest object (or HttpWebRequest ). I have created the WebRequest and set the credentials, but when I call GetResponse() it is throwing an internal server...
6
by: AlanS | last post by:
I have used Visual Studio for about 8 months. I have developed some ASP solutions. I had to get on with some other things and have not worked with ASP.NET for a couple months. In the meantime, I...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
4
by: jf li | last post by:
I have a Asp.net web application and a Asp.net Web service application. The Web application is using HtmlInputFile to get a 50M size of file selected by end user, read the data of this file and...
3
by: guillaume.braux | last post by:
Hello, I am running WS2008 + IIS7 + FASTCGI + ZendCore. I have not modified the default ZendCore php.ini configuration file. Actualy, any kind of PHP error, warning or notice gives me...
1
by: saipavan | last post by:
Please go through the following fix this error. 1. Click on http://www.athensys.com/giorgio/search_gallery.php and enter any keyword (or) word in the main search bar " Search here for Google...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.