Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic, Enterprise
Expertise: Beginner
Oct 22, 2002

Find the Cause of Query Malfunctions


This tip is for SQL Server 6.5 and up. When debugging a SELECT query, add an absolute true condition as the first condition of the WHERE clause:
 
SELECT
	au_lname,
	au_fname
FROM
	authors
WHERE
	1=1 --absolute true condition
	and state = 'CA'
	and contract = 1

That way, you can comment out one or more of the real conditions in the WHERE clause using the "- -" comment character sequence to narrow down which condition(s) cause the query to malfunction. When you
Jonathan Goodyear
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date