Query Runs In QA but not VS

This is a discussion on Query Runs In QA but not VS within the sqlserver-datamining forums in Data Warehousing category; I've got a query that I use in Visual Studio. Recently, I added the replace() function to my SQL string, and now Visual Studio no longer pulls any records. While debugging, I can select the SQL string that returned 0 records in Visual Studio and paste that exact query into Query Analyzer (that way, I know QA is using the same date_time strings that VS is using). SQL Server 2000's Query Analyzer pulls up 7016 row(s)! In Visual Studio 2005 Professional, I fill my DataTable using the exact same string, and it returns '0' rows. Could someone ...

Go Back   Database Forum > Data Warehousing > sqlserver-datamining

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-15-2008, 04:39 PM
Default Query Runs In QA but not VS

I've got a query that I use in Visual Studio.

Recently, I added the "replace()" function to my SQL string, and now Visual
Studio no longer pulls any records.

While debugging, I can select the SQL string that returned 0 records in
Visual Studio and paste that exact query into Query Analyzer (that way, I
know QA is using the same date_time strings that VS is using).

SQL Server 2000's Query Analyzer pulls up 7016 row(s)!

In Visual Studio 2005 Professional, I fill my DataTable using the exact same
string, and it returns '0' rows.

Could someone enlighten me as to what I'm doing wrong? I've got several apps
that use the same SQL Server, and everything else works fine. Even this query
worked fine until I added the "replace()" function. Now, even if I remove the
"replace()" function, the query still returns 0 rows.

Here is the SQL Query:

SELECT replace(TR.[OP_ID], ' ', ' ') as OP_ID, EI.[NUM], TR.[Date_Time]
FROM Test_Results TR
LEFT JOIN EmployeeInfo EI
ON OP_ID=EI.[FIRSTNAME]+' '+EI.[LASTNAME]
WHERE
(TR.[System_ID] Like '%Decay%') AND
(EI.[JOBTITLE]='BRZ OPRTR') AND
(EI.[NUM] IS NOT NULL) AND
('7/1/2008' < TR.[Date_Time]) AND
(TR.[Date_Time] < '7/31/2008')
ORDER BY TR.OP_ID, TR.[Date_Time]

Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 02:42 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.