FOR XML Path is giving error [modified]
-
Hi All, Can anybody please help me in executing a query using For Xml Path. Because query with this if I put it in my SQL Server editor, and run it, its giving errors. Is there any specific way to use For Xml Path. Or should I have anything to use it in my SQL Server 2008. Because any query from any browser is giving errors. What should i do to get rid of it. One more thing I found in my SQL Server is when I open the "new query" window in my SQL Server and try to write the "FOR XML" I get the RAW and Auto in the intellisense and I dont find the Path mode coming in the intellisense. Am I miising any dll or any installation process. Because if I write any query using "For Xml Path" not at all compiling. Can anybody help me in getting this done. I need to use the "For Xml Path", please help me out. Any links or any kind of help is very very welcoming. Thanks in advance.
Thanks & Regards, Md. Abdul Aleem NIIT technologies
modified on Tuesday, June 29, 2010 9:13 PM
-
Hi All, Can anybody please help me in executing a query using For Xml Path. Because query with this if I put it in my SQL Server editor, and run it, its giving errors. Is there any specific way to use For Xml Path. Or should I have anything to use it in my SQL Server 2008. Because any query from any browser is giving errors. What should i do to get rid of it. One more thing I found in my SQL Server is when I open the "new query" window in my SQL Server and try to write the "FOR XML" I get the RAW and Auto in the intellisense and I dont find the Path mode coming in the intellisense. Am I miising any dll or any installation process. Because if I write any query using "For Xml Path" not at all compiling. Can anybody help me in getting this done. I need to use the "For Xml Path", please help me out. Any links or any kind of help is very very welcoming. Thanks in advance.
Thanks & Regards, Md. Abdul Aleem NIIT technologies
modified on Tuesday, June 29, 2010 9:13 PM
Could you give us the error detail, transact sql statement as well.
Thanks Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
-
Hi All, Can anybody please help me in executing a query using For Xml Path. Because query with this if I put it in my SQL Server editor, and run it, its giving errors. Is there any specific way to use For Xml Path. Or should I have anything to use it in my SQL Server 2008. Because any query from any browser is giving errors. What should i do to get rid of it. One more thing I found in my SQL Server is when I open the "new query" window in my SQL Server and try to write the "FOR XML" I get the RAW and Auto in the intellisense and I dont find the Path mode coming in the intellisense. Am I miising any dll or any installation process. Because if I write any query using "For Xml Path" not at all compiling. Can anybody help me in getting this done. I need to use the "For Xml Path", please help me out. Any links or any kind of help is very very welcoming. Thanks in advance.
Thanks & Regards, Md. Abdul Aleem NIIT technologies
modified on Tuesday, June 29, 2010 9:13 PM
Is your database in 2000 compatibility mode? FOR XML PATH was introduced in 2005.
-
Is your database in 2000 compatibility mode? FOR XML PATH was introduced in 2005.
I have run this exec to change the compatitbility "EXEC sp_dbcmptlevel Ppsapp, 90". But it is not accepting 90 the "SQL Server 2005" compatibility level. It is giving following error "Msg 15416, Level 16, State 1, Procedure sp_dbcmptlevel, Line 92 Usage: sp_dbcmptlevel [dbname [, compatibilitylevel]] Valid values of database compatibility level are 60, 65, 70, or 80.". Please give me your idea for changing the compatibility level. May be thats why the query is not working.
Thanks & Regards, Md. Abdul Aleem NIIT technologies
-
I have run this exec to change the compatitbility "EXEC sp_dbcmptlevel Ppsapp, 90". But it is not accepting 90 the "SQL Server 2005" compatibility level. It is giving following error "Msg 15416, Level 16, State 1, Procedure sp_dbcmptlevel, Line 92 Usage: sp_dbcmptlevel [dbname [, compatibilitylevel]] Valid values of database compatibility level are 60, 65, 70, or 80.". Please give me your idea for changing the compatibility level. May be thats why the query is not working.
Thanks & Regards, Md. Abdul Aleem NIIT technologies
80 is Sql Server 2000, 70 is Sql Server 7 etc. You are connecting to a Sql Server 2000 instance not 2008. You cannot use FOR XML PATH. I suggest that you search google for "sql aggregate string concatenation". You may also find this link helps http://www.projectdmx.com/tsql/rowconcatenate.aspx[^]