.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

SQL2005 - for xml - an object or column name is missing or empty

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :

Hello - I am attempting to figure out how to output a sql2005 query into xml & starting with this example from the site - http://msdn.microsoft.com/en-us/library/ms345137(v=sql.90).aspx, but running into the error - An object or column name is missing or empty.

Can someone tell me what I'm missing?  Thanks!!

Here is what I have so far:

select campaign_name as '@Campaign_Name'

(select Campaign_ID as '@Campaign_ID'

from sfrefunds2

where sfrefunds2.activity_quuid = sfrefunds1.activity_quuid

for xml path ('xmlTest'), type),


(select distinct identifier as '@Identifier'

from sfrefunds3

join sfrefunds2 on sfrefunds2.activity_quuid = sfrefunds3.activity_quuid

where sfrefunds1.activity_quuid = sfrefunds2.activity_quuid

for xml path('xmlTest2'), type)

from sfrefunds

for xml path('xmlTest1')

View Complete Post

More Related Resource Links

Modified column missing when sorting


I resently updated few document libraries on my sharepoint site.  What I did I removed "Content approval" from those libraries and now my modified and created columns are missing from the columns of the list (appear to be hidden ).  So, I need to be able to sort by these columns and I have seen many people asking about this same question but I haven't found any answer to this issue.  The columns are still there but I they dont show up in the columns of the library.  I can still create a view with this columns but i cant sort by them.

Is this a bug or is there a reason why sharepoint does this? 


Hide grid view column if empty

 Hello All, I want to hide a grid view column if that column is empty. How do I do this? I dont have much exp. with grids. Please help me. Thanks in advance.

Display Null if Column is empty

is it possible to display Nullif my sql data is null while binding it with gridview in asp.net<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical" Height="185px" Width="244px"> <RowStyle BackColor="#EEEEEE" ForeColor="Black" /> <FooterStyle BackColor="#CCCCCC" ForeColor="Black" /> <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="Gainsboro" /> </asp:GridView> string command="select * from user1"; DataSet ds1 = new DataSet(); ds1 = ob.getall(command); GridView1.DataSource = ds1; GridView1.DataBind(); for example like this

Caml returns table with column, whose value is empty string always, but it's not

I wrote caml query   SPSiteDataQuery query = new SPSiteDataQuery(); query.ViewFields = @"<FieldRef Name='Title' /><FieldRef Name='cmAssignedTo' Nullable='TRUE' />" + "<FieldRef Name='cmDueDate' Nullable='TRUE' /><FieldRef Name='Author' /><FieldRef Name='cmStatus' />" + "<FieldRef Name='cmControler' Nullable='TRUE' /><FieldRef Name='cmControlers' Nullable='TRUE' />" + "<FieldRef Name='FileDirRef' /><FieldRef Name='File_x0020_Type' /><FieldRef Name='cmIcon' /><FieldRef Name='cmPackageGuid' />" ; query.Webs = string .Format("<Webs Scope='{0}' />" , searchScope); query.Lists = "<Lists ServerTemplate='10553'/>" ; Fields cmAssignedTo, cmControler and cmControles return always "", but they include users! Definition of these fields is similar:   <Field xmlns="http://schemas.microsoft.com/sharepoint/" DisplayName="cmAssignedTo" StaticName="cmAssignedTo" Name="cmAssignedTo" ID="{B4B52176-1961-4b06-B7B4-C7DBB751A53F}" Type="User" List="UserInfo" ShowField="ImnName" Mult="TRUE" />   List, where i'm looking for in, includes 2 contenttypes. First one contains these

Missing column statistics from default trace

I am seeing Missing statistics events on my default trace and was wondering whether I need to create statistics on the table. Missing Column Statistics Is this a good practice considering the advice on http://msdn.microsoft.com/en-us/library/ms190397.aspx

SQL2005 Express Install fails with advisory that .NET 2.0 is either corrupt or missing

I am trying to install SQLExpress 2005 adv on an XP Pro SP2 machine standalone and keep on getting the same error -- "SQL setup has detected a problem with Microsoft .Net Framework installation and cannot proceed. Microsoft .Net Framework 2.0 is either not installed on this system or is corrupt."I have uninstalled/reinstalled .Net 2.0 some many time that I think it come close to the population of China. Still the same message. I had no problems on a different machine so I cloned that Hard drive, re-activated the software and tried on this machine. Still the same problem. I know what you are thinking, it must be machine related. Both machine have identical hardware from motherboard, Bios, peripherals, memory, Hard drives, CDROM and DVD drives. I took the failed HD and put it in the machine that installed correctly and the same thing happened - the install failed with the same message.I used "installer" to check the install info -- Both .Net 1.1 and 2.0 show up properly.I ran MSIZAP !G to get rid of orphans.I uninstalled SQLExpress. Cleaned the registry. ran the clwireg-x86.exe, removed both .Net 1.1 and 2.0 several times. Blew the hard drive away sevral times and restarted from scratch.Still the same perfectly useless message.Any help would be appreciated at this stage.Motherboard is Asus P5QL/EPU, 2.5 gHz Intel P43 Quad core, 4 G DDR2, 160 SATA WD

How to manually update entity object in .edmx to reflect a new column in the DB?


Is there a way to manually update a single edmx entity to reflect a new column in a SQL db table? If yes, what would be the proper step- by-step procedure?  

I prefer not to use the "update model from db" template because this will update all the tables and wipe out all the customizations and name changes I have already made in the EF objects.  This seems a bit overkill for a single column change.   I went down this route once, and I prefer not to do it again.   I do not see any way to actually update a single table from the DB using VS2010 "update from db", but please enlighten me if this is not correct.  

What I have tried to do so far is manually add a new scalar property to the appropriate entity using the edmx designer, and this seems to work OK, but I cannot seem to find a way to map the new property back to the db through the mapping window.  Do I have to do this directly through the XML file?   Also is this sufficient to ensure the new column is correctly reflected in the edmx, or are there other steps that need to be done? 

Sorry if this has been covered before, but I could not find an exact match to my issue.

Advise on the best way to proceed would be greatly 

Delete object is empty


I have a view that gets populated via this code

public ActionResult Delete(int id)
            return View(_availableService.GetAvailable(id));

the view gets populated perfectly.  then i call this code below availableToDelete object is empty.  What is the reason for this?

        public ActionResult Delete(Available availableToDelete)
                // TODO: Add delete logic here
                if (_availableService.DeleteAvailable(availableToDelete))
                    return RedirectToAction("IndexByStaffEmail", new { email = Session["StaffEmail"] });
                    return View(_availableService.GetAvailable(availableToDelete.AvailableID));
                return View();

Server object missing properties


hi, I have the following code:

(New-Object "Microsoft.SqlServer.Management.SMO.Server" "SQLCLUST-LA08P\SQLPROD2" |Get-Member -MemberType Property).Count

if I run this on my local box I get 97, but if I run it in a different box I get 33.

the two servers have the same version of SMO:

# [Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo")

GAC    Version        Location
---    -------        --------
True   v2.0.50727     C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.Smo\9...

and I'm logged into both boxes with the same account:

# whoami

so what can the problem be?  I've googled a lot but can't find any help out there.  the list of properties returned in the "working" case is shown below:


FIMSynchronizationService starting error: Missing object from Sync DB?


Hi everyone,

I've been trying to solve some issues I've been having with the user profile service. I had it running great without problems. However I had to change a setting, then everything just stopped working and never came back alive. I wound up deleting the service profile then recreating it however now I'm just getting a whole different error. I tried searching the internet but couldn't find any solutions. Anyway here is the error I receive in the application log:


The server encountered an unexpected error and stopped.
 "ERR: MMS(4420): sql.cpp(5580): Query (select count(*) from [mms_management_agent]) performed with error
ERR: MMS(4420): sql.cpp(5633): Invalid object name 'mms_management_agent'.
ERR: MMS(4420): sql.cpp(5641): hrError: 0x80040e37, dwMinor: 208
ERR: MMS(4420): sql.cpp(5796): SQL error: 42S02, native: 208
BAIL: MMS(4420): sql.cpp(2897): 0x80040e37
BAIL: MMS(4420): sql.cpp(4114): 0x80040e37
ERR: MMS(4420): sql.cpp(5580): Query (select fixed_schema_version_number from [mms_server_configuration] ) performed with error
ERR: MMS(4420): sql.cpp(5633): Invalid object name 'mms_server_configuration'.
ERR: MMS(4420): sql.cpp(5641): hrError: 0x80040e37, dwMinor: 208
ERR: MMS(4420): sql.cpp(5796): SQL error: 42S02, native: 208
BAIL: MMS(4420): sql.cpp(2897): 0x80040e37
BAIL: MMS(4420): sql.cpp(2738): 0x80040e37

document library column header is missing


When I open any document libraries within a specified site collection, I found out they all missing column headers. I could not do sorting on the columns. Anyone knows why?

Thanks in advance,



Show column headers when gridview returns empty data set




I have in my code a gridview that I redirect to excel, it works fine when I have data in the data set. waht I want is to show column headers when there is no data right now what i get is empty sheet. 

Report Builder 3.0 renders empty page for Reports with Matrix (column group) in Landscape orientatio


I need some help.


If I create a Report with a Matrix Tablix (with row Groups and column groups) in landscape layout and preview it in print layout, the report generates me some extra empty page every 2nd page.

I don't understand the rule, why it's doing that.


My Report settings are:

  • PageSize: width: 29.7 cm, height: 21 cm
  • InteractiveSize: width: 29.7cm, height: 21 cm
  • Margins : 0cm,0cm,0cm,0cm
  • Report Body : widht: 25cm, height: 10cm

According my Report settings this shouldn't happen, should it. The width of my Tablix is max 22cm.

What I noticed is, that when I shrink the width of my Report Body to 21 cm (to the width of the portrait layout) or less, the emtpy pages disappear.

Or when I delete the column group, it also renders the report without some empty pages.

I think this problem has something to do with column groups.


Is this a bug or am I missing a setting?

Missing column in MSlogreader_history table in the distribution database

We recently built a new two node cluster on a Windows 2008 R2 64bit OS. We installed SQL 2005 64bit Enterprise with SP3 and CU7. We want to run replication from node 1 (1 instance - publisher) to node 2 ( 2 instances - distributor instance and a subscriber instance). We use scripts to build transactional replication (push). These scripts have been used before in an identical setup except it is CU3 instead of CU7. On our new setup, with CU7, the MSlogreader_history table in the distribution databse is missing the @updateable_row column. We only have 15 columns in this system table on our new CU7 setup. The older CU3 setup has 16 columns in the MSlogreader_history table including the updateable_row column.

Replication monitor shows an error stating that the sp_MSadd_logreader has too many arguments specified (Code 1007).

Why is our MSlogreader_history table missing the updateable_row column, and how can this be fixed?

Many Missing Column Statistics errors on full-text index fragments, even after reorganizing catalog


I seem to have a large number of full-text index fragments, even after reorganizing both full-text catalogs. (SQL 2008)

While reviewing the results of the default trace, I noticed many “Missing Column Statistics” errors.  Seeing as how there are over a thousand of these errors within a 12 hour period, I figure this is something I should take care of. 

From trace, text data column:

  NO STATS:([MyDBName].[sys].[ifts_comp_fragment_2014778570_51269].[colid], [MyDBName].[sys].[ifts_comp_fragment_2014778570_51269].[pid], [MyDBName].[sys].[ifts_comp_fragment_2014778570_51269].[docidmax], [MyDBName].[sys].[ifts_comp_fragment_2014778570_51269].[dupseq])

When I query sys . fulltext_index_fragments , I see about 15 different fragments for each catalog, all with a status of 4.  I expected to see many more fragments listed, with a status of 0 maybe?  I guess I’m misunderstanding something.

After reorganizing the catalogs, I’m still seeing these

DataGridView object column 'data type' assignment

How do I assign a 'data type' to an 'unbounded' datagridview object

SSIS import - Missing 1st column from Excel


Hi ,

I have gone through some of the materials posted on this topic. but didnot work out for me. I am trying to import the excel file using ssis. I have got the header details , I have to skip the header  while importing. I am using following sql commad: to import . I am able to skip the header row, but missing the 1st coumn from excel.I am not able to add the F1 column in the query . Can any know why it is not possible, because of this I am miisng the 1st column to import.

 SELECT F2, F3,F4, F5
from [Sheet1$]
where (f2is not null) and (f2<>'status')

Please help me out




ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend