Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Is there anything that would cause a stored procedure NOT to return a column that is in it's select statement? I have this happening every so often with several different stored procedures. They all work most of the time though. Is there some kind of SQL error that would cause a column not to be returned but not cause the whole action to fail? I am just stumped on this.
Being smarter than you look is always better than looking smarter than you are.
  • *Experts*
Posted

I've never seen what you describe. Where exactly is the inconsistency? Is it that on some calls to ProcA, columnB isn't returned and sometimes it is? Or is it more that ProcA returns a column while ProcB doesn't - even though it's in the SELECT?

 

How are you checking that the column is or is not being returned? If you use XML, such as GetData, keep in mind that a column will not show in the XML if its value is NULL (database null, not .NET). For example, if you have only a first and last name but not a middle name, the XML might look like:

<Table1>
   <FirstName>Bob</FirstName>
   <LastName>Smith</LastName>
</Table1>

 

You won't see "<MiddleName></MiddleName>" as that would indicate that the middle name exists, but is an empty string. The lack of the element is how the XML represents null.

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

Not sure if this matters, but are you pulling the columns directly from a table, or from a view?

 

When you noticed the column is missing, is it in Enterprise Manager, Query Analyzer, or your program?

 

Is there anything that would cause a stored procedure NOT to return a column that is in it's select statement? I have this happening every so often with several different stored procedures. They all work most of the time though. Is there some kind of SQL error that would cause a column not to be returned but not cause the whole action to fail? I am just stumped on this.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...