This is a discussion on how to create stored procedure for view to generate xml? within the ASP and ASP.NET Programming forums, part of the Web Development category; Hi, How to create stored procedure to generate xml for view not for table?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| View and table differs in only not affecting the data....so u can create SP / Query to retrieve the data in XML |
| |||
| Hi, See the following query.I want to retrieve data from more than one table. Select distinct Owner.Name,employee.Id,employee.Name from Owner,employee where Owner.Name=employee.OwnerName and employee.Id=Owner.employeeId for xml auto,root('xml') This can generate XML and successfully executed. But if u use the same query while creating view at that time itself it shows error as 'unable to parse the text' and View is not created in SqlServer.Could u tell me the way to use this query to create view |
| |||
| Hi, I found the solution for this. Through SqlServer we can create stored Procedure and include that in asp.net by using existing stored Procedure. If u want the set the node of ur own then the following should be used, CREATE procedure [dbo].[GetTestMenu] as SELECT 1 as Tag, 0 as Parent, MenuName as [MenuMapping!1!MenuName], NULL as [Category!2!Id], NULL as [Category!2!Name] FROM MenuMapping UNION SELECT 2 as tag, 1 as parent, MenuName, Id, [Name]from Category for xml explicit,root('menu') RETURN Here the xml will be in the following format, <menu> <MenuMapping MenuName="Book"/> <MenuMapping MenuName="CSE"/> <MenuMapping MenuName="EEE"> <Category Id="21" Name="ControlSystem"/> <Category Id ="22" Name="Architecture"/> </MenuMapping> </menu> |
![]() |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/asp-asp-net-programming/5198-how-create-stored-procedure-view-generate-xml.html | |||
| Posted By | For | Type | Date |
| DiscussWeb IT Community - Technical Support and Technology Discussions | This thread | Refback | 02-14-2008 10:43 PM |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| stored procedure | itbarota | Database Support | 3 | 03-10-2008 09:43 PM |
| Code-behind to create node dynamically using XML File or any Stored Procedure | poornima | ASP and ASP.NET Programming | 3 | 02-14-2008 09:46 PM |
| Stored procedure gets executed twice | chris | ASP and ASP.NET Programming | 4 | 11-01-2007 03:08 AM |
| Is it possible to create Stored Procedure in Dataset Using Distinct Key ? | KiruthikaSambandam | ASP and ASP.NET Programming | 1 | 08-08-2007 08:03 AM |
| Can a stored procedure call itself or recursive stored procedure? How many level SP n | H2o | Database Support | 1 | 08-03-2007 10:55 AM |