Thursday, March 22, 2012
Data returned in QA is different than EM
Something strange is going on: When I do a select * from table some of the
data appears to be in the wrong field. However, when I look at the table
contents in the EM, they are all correct. When I do select statement in the
QA based on criteria, the correct rows are not returned.
Any one know what this is all about?
Thanks for your guidance,
SeanWhat version of SQL Server / Query Analyzer? Have you applied the latest
(SQL Server) service pack to the server and client?
How is Query Analyzer set to display data (grid or text)?
By "wrong field" I assume that you mean it appears that the data that is
displayed appears to be in the wrong <ahem> "field" because it appears in
the wrong area of the [text] display of the results. Do you store <carriage
return> and <line feed> (char(13) char(10)) within your data? If so perhaps
those characters along with results in text mode are causing the display to
look incorrect.
Keith
"sean sobey" <Sobey@.yahoo.com> wrote in message
news:%23iVjrebSFHA.508@.TK2MSFTNGP12.phx.gbl...
> Hi all,
> Something strange is going on: When I do a select * from table some of
> the
> data appears to be in the wrong field. However, when I look at the table
> contents in the EM, they are all correct. When I do select statement in
> the
> QA based on criteria, the correct rows are not returned.
> Any one know what this is all about?
> Thanks for your guidance,
> Sean
>|||How can we reproduce the problem?
AMB
"sean sobey" wrote:
> Hi all,
> Something strange is going on: When I do a select * from table some of th
e
> data appears to be in the wrong field. However, when I look at the table
> contents in the EM, they are all correct. When I do select statement in t
he
> QA based on criteria, the correct rows are not returned.
> Any one know what this is all about?
> Thanks for your guidance,
> Sean
>
>|||Hi, Sean
See:
http://groups-beta.google.com/group...ea781f3bc49bf23
Razvan
Data returned from .WriteXML is different than what is returned in query analyzer.
I have a strange problem. I have some code that executes a sql query. If I run the query in SQL server query analyzer, I get a set of data returned for me as expected. This is the query listed on lines 3 and 4. I just manually type it into query analyzer.
Yet when I run the same query in my code, the result set is slightly different because it is missing some data. I am confused as to what is going on here. Basically to examine the sql result set returned, I write it out to an XML file. (See line 16).
Why the data returned is different, I have no idea. Also writing it out to an XML file is the only way I can look at the data. Otherwise looking at it in the debugger is impossible, with the hundreds of tree nodes returned.
If someone is able to help me figure this out, I would appreciate it.
1. public DataSet GetMarketList(string region, string marketRegion)
2. {
3. string sql = @."SELECT a.RealEstMarket FROM MarketMap a, RegionMap b " + 4."WHERE a.RegionCode = b.RegionCode";
5. DataSet dsMarketList = new DataSet();
6. SqlConnection sqlConn = new SqlConnection(intranetConnStr);
7. SqlCommand cmd = new SqlCommand(sql,sqlConn);
8. sqlConn.Open();
9. SqlDataAdapter adapter = new SqlDataAdapter(cmd);
10. try
11. {
12. adapter.Fill(dsMarketList);
13. String bling = adapter.SelectCommand.CommandText;//BRG
14. dsMarketList.DataSetName="RegionMarket";
15. dsMarketList.Tables[0].TableName = "MarketList";
16. dsMarketList.WriteXml(Server.MapPath ("myXMLFile.xml" )); // The data written to 17. myXMLFile.xml is not the same data that is returned when I run the query on line 3&4
18. // from the SQL query
19. }
20. catch(Exception e)
21. {
22. // Handle the exception (Code not shown)
I think that you need to look at what data isn't being returned in your app. Can you load the XML file into Excel? You could then paste the SQL Analyzer results into Excel and look at the difference.
Also, there isn't an order by clause in your SQL, so SQL Server is free to return the results in a different order between invocations of the same SQL. (It rarely happens, but it does occasionally.)
|||Ugh !!! I figured out what the problem is. Thanks !sql
Tuesday, March 20, 2012
data provider or other service returned an E_Fail status in sql server 2005
after converting database from sql server 2000 to sql server 2005. my program on vb6 is facing runtime error. i.e.data provider or other service returned an E_Fail status .
how can i get rid this problem
Could you please post your connection string and the exact error message that you are getting.
Jag
|||Main_Module.STRCNNN1 = "driver={SQL Server};server=" & Main_Module.Server_Name & ";" & _
"uid=SA;pwd=;database=" & Main_Module.Common_Database
error msg is
runtime error
data provider or other service returned an E_Fail status in sql server 2005
when i am fetching record from view using order by clause in select statement then error is coming
as
select * from vew_emp where grade='C' order empno
at the first time it fetching record with order by
but when i am using recordset.Requiry
it cud not fetch the record
i think when the recordset is open with the record of view
i am deleting ,inserting record in the view base table then the main recordset is not working
without using order by it is running and working well
plz reply me quickly
data provider or other service returned an E_Fail status in sql server 2005
Main_Module.STRCNNN1 = "driver={SQL Server};server=" & Main_Module.Server_Name & ";" & _
"uid=SA;pwd=;database=" & Main_Module.Common_Database
error msg is
runtime error
data provider or other service returned an E_Fail status in sql server 2005
when i am fetching record from view using order by clause in select statement then error is coming
as
select * from vew_emp where grade='C' order empno
at the first time it fetching record with order by
but when i am using recordset.Requiry
it cud not fetch the record
i think when the recordset is open with the record of view
i am deleting ,inserting record in the view base table then the main recordset is not working
without using order by it is running and working well
plz reply me quickly
Move the thread from Visual Basic Language in order to get better and satisfied answers.
|||Take a look at this - http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=3778
Hope this helps