Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Search Forums
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Showing results 1 to 25 of 500
Search took 0.05 seconds.
Search: Posts Made By: Jeff Mason
Forum: SQL Language April 16th, 2009, 10:46 AM
Replies: 2
Views: 860
Posted By Jeff Mason
For simple scalar expressions, nothing, though...

For simple scalar expressions, nothing, though the IN clause is usually less typing. A WHERE clause like:

WHERE somecolumn = 1 OR somecolumn = 2will result in a query plan that is identical to:
...
Forum: SQL Server 2000 March 24th, 2009, 07:34 PM
Replies: 10
Views: 1,544
Posted By Jeff Mason
Not to be picky here (OK, maybe a little [:D]),...

Not to be picky here (OK, maybe a little [:D]), but this isn't quite right.

Varchar columns are stored in a data row after all the fixed length columns. The length of a given varchar column's...
Forum: SQL Language February 11th, 2009, 10:22 PM
Replies: 5
Views: 761
Posted By Jeff Mason
Adding conditions to a cartesian product (not an...

Adding conditions to a cartesian product (not an OUTER JOIN) reduces it to an INNER JOIN. That is, in fact, how you 'do' an INNER JOIN: construct the cartesian product of the two tables, then select...
Forum: SQL Language February 11th, 2009, 06:48 PM
Replies: 5
Views: 761
Posted By Jeff Mason
Without JOIN conditions on your query, you are...

Without JOIN conditions on your query, you are saying that constructing a cartesian product between two tables is commutative: A X B is the same as B X A.

Which of course it is.

Adding JOIN...
Forum: SQL Language February 11th, 2009, 08:50 AM
Replies: 5
Views: 761
Posted By Jeff Mason
It is possible if the two tables are in a...

It is possible if the two tables are in a one-to-one correspondence with respect to the JOIN condition.
Forum: SQL Server 2000 September 18th, 2008, 03:59 PM
Replies: 12
Views: 246,713
Posted By Jeff Mason
:D Jeff Mason je.mason@comcast.net

:D

Jeff Mason
je.mason@comcast.net
Forum: SQL Server 2000 September 18th, 2008, 03:31 PM
Replies: 12
Views: 246,713
Posted By Jeff Mason
Well... I did say they were "...a couple of ugly...

Well... I did say they were "...a couple of ugly alternatives..." ;)

(Any idea why we're responding to a 5 year old original post? :D )

Jeff Mason
je.mason@comcast.net
Forum: .NET Framework 2.0 July 4th, 2008, 02:13 PM
Replies: 2
Views: 1,658
Posted By Jeff Mason
I have verified that the FileSystemWatcher is...

I have verified that the FileSystemWatcher is doing what I want it to do. The Changed event is in fact firing when I, for example, modify the .config file via notepad.

In the Changed event...
Forum: .NET Framework 2.0 July 4th, 2008, 10:44 AM
Replies: 2
Views: 1,658
Posted By Jeff Mason
Detecting changes to <app>.config

I'm trying to write some code that will detect changes in a Windows Service app's .config file and reflect the modified appSetting entry in my code.

We have a windows Service we've written and...
Forum: SQL Language May 2nd, 2008, 09:45 AM
Replies: 4
Views: 1,225
Posted By Jeff Mason
You are right; the grouping you show above is...

You are right; the grouping you show above is more efficient than using the IN clause for the specific two column result the OP requested. But, if there were other columns in the table that needed...
Forum: SQL Language May 2nd, 2008, 06:29 AM
Replies: 4
Views: 1,225
Posted By Jeff Mason
The way approach things like this is to break it...

The way approach things like this is to break it down into steps, usually from the "inside out". First, you want to find the set of ref_no where it is a maximum for each name:

SELECT MAX(ref_no)...
Forum: SQL Server 2000 March 14th, 2008, 07:42 AM
Replies: 4
Views: 779
Posted By Jeff Mason
The INFORMATION_SCHEMA.COLUMNS view has a column...

The INFORMATION_SCHEMA.COLUMNS view has a column in it named COLUMN_DEFAULT which contains the DEFAULT expression assigned to a table columnn, if any.

Jeff Mason
je.mason@comcast.net
Forum: SQL Server 2000 March 10th, 2008, 03:57 PM
Replies: 2
Views: 587
Posted By Jeff Mason
Sure. A query is a derived table, so it can...

Sure.

A query is a derived table, so it can be used anywhere where a table can be used. This is usually in a FROM clause or subquery. The only 'trick' is that you must give a name to the derived...
Forum: SQL Server 2000 January 28th, 2008, 01:59 PM
Replies: 7
Views: 1,274
Posted By Jeff Mason
You are right. I totally blew that. I...

You are right. I totally blew that.

I should have looked closer at the UNION query and noticed that there were OUTER joins in there, so the number of columns would be the same in either case. My...
Forum: SQL Server 2000 January 28th, 2008, 01:22 PM
Replies: 7
Views: 1,274
Posted By Jeff Mason
Although, now that I think about it, the two...

Although, now that I think about it, the two alternatives aren't equivalent.

The UNION query would return one set of rows for the "left" side followed by another set for the "right".

The FULL...
Forum: SQL Server 2000 January 28th, 2008, 12:21 PM
Replies: 7
Views: 1,274
Posted By Jeff Mason
A FULL OUTER JOIN would also work, and avoid the...

A FULL OUTER JOIN would also work, and avoid the UNION operation.

Jeff Mason
je.mason@comcast.net
Forum: SQL Server 2000 January 21st, 2008, 04:06 PM
Replies: 2
Views: 660
Posted By Jeff Mason
The CASE expression will do what you want: ...

The CASE expression will do what you want:

select case when LAST_NAME = 'SMITH' then 'JONES' else LAST_NAME end as LastName, PHONE_NUMBER, ZIPCODE from T_ADDRESS

Jeff Mason
je.mason@comcast.net
Forum: SQL Server 2000 January 10th, 2008, 01:41 PM
Replies: 13
Views: 1,520
Posted By Jeff Mason
Therein lies the rub. It isn't always that simple...

Therein lies the rub. It isn't always that simple to correctly construct a query.

Just to contrive an example, let's say you have a table of Person rows with a DateOfBirth column with an index on...
Forum: SQL Server 2000 January 10th, 2008, 12:58 PM
Replies: 13
Views: 1,520
Posted By Jeff Mason
...and if your queries are correctly constructed...

...and if your queries are correctly constructed to utilize those indexes ... :)

Jeff Mason
je.mason@comcast.net
Forum: SQL Server 2000 December 31st, 2007, 12:42 PM
Replies: 1
Views: 976
Posted By Jeff Mason
Not to be flip here, but you should have as many...

Not to be flip here, but you should have as many indexes as you need, and no more. Indexes must be maintained whenever you add, delete, or update a row, so this overhead must be taken into account...
Forum: SQL Server 2000 December 17th, 2007, 01:22 PM
Replies: 2
Views: 619
Posted By Jeff Mason
A correlated subquery is probably the simplest: ...

A correlated subquery is probably the simplest:

SELECT A.NAME, (SELECT Count(*) FROM B WHERE A.ID = B.A_ID) as BCount
FROM A;

This could also be done by JOINing the tables and GROUPing by ID...
Forum: SQL Server 2000 December 6th, 2007, 07:59 AM
Replies: 3
Views: 856
Posted By Jeff Mason
Actually, If EXISTS (SELECT * FROM...

Actually,

If EXISTS (SELECT * FROM ProductShipped WHERE customerId = 10)

is in general more efficient.

The EXISTS predicate returns TRUE when the subquery given as its argument has any rows...
Forum: SQL Server 2000 December 3rd, 2007, 03:31 PM
Replies: 6
Views: 1,083
Posted By Jeff Mason
Don't throw out your laptop. Get rid of Access....

Don't throw out your laptop. Get rid of Access. [}:)]

I think I see the problem. Your database table definitions have the int_RegID in the tbl_RegistrationInfo table defined as an autonumber. ...
Forum: SQL Server 2000 December 3rd, 2007, 02:28 PM
Replies: 6
Views: 1,083
Posted By Jeff Mason
There's no such thing as a 'plain join'. You...

There's no such thing as a 'plain join'.

You said you tried the inner join and got an error. What error did you get, and what was the query?

This ought to work:

SELECT *
from...
Forum: SQL Server 2000 December 2nd, 2007, 08:59 PM
Replies: 6
Views: 1,083
Posted By Jeff Mason
That second JOIN in your FROM clause, which kind...

That second JOIN in your FROM clause, which kind is it?

A FROM clause needs to specify what <join type> the tables are being, er, JOINed on...

Jeff Mason
je.mason@comcast.net
Showing results 1 to 25 of 500

 


All times are GMT -4. The time now is 04:05 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.