Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 15th, 2004, 08:27 AM
Authorized User
 
Join Date: Mar 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to deyakhatib
Default SQL server partitions

Hi all,

I created 3 tables with constraints on numeric field and I created a union all view on these tables, when I select from the view specifying a condition using the constraint field the execution plan scans all the tables instead of the table that match the condition.

regards,

 
Old June 15th, 2004, 06:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Can you post the code that you used to create the view?

Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 16th, 2004, 03:41 AM
Authorized User
 
Join Date: Mar 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to deyakhatib
Default

Hi,
the code I used is:
"Create View View1
As
SELECT * from t1
UNION ALL
SELECT * from t2
UNION ALL
SELECT * from t3"

Regards,


Quote:
quote:Originally posted by happygv
 Can you post the code that you used to create the view?

Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 16th, 2004, 11:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

Instead of using *, try listing out the criteria. That may or may not solve your problem. If not, at least there is a performance gain with that.

Brian
 
Old June 16th, 2004, 02:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

What is the SELECT statement that you used to query from this VIEW?

Can you post that please?

_________________________
-Vijay G
Strive for Perfection
 
Old June 17th, 2004, 01:14 AM
Authorized User
 
Join Date: Mar 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to deyakhatib
Default

Hi All,
I solved the problem guys.
thanx for ur help

Quote:
quote:Originally posted by happygv
 What is the SELECT statement that you used to query from this VIEW?

Can you post that please?

_________________________
-Vijay G
Strive for Perfection
 
Old June 17th, 2004, 02:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

If you wish, can you post on how you solved it?

Cheers!

_________________________
-Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Conflict in SQL Server 2000 and SQL Server 2005 ayan.mukherjee SQL Language 0 June 30th, 2008 03:34 AM
SQL Server Reg. SQL Server does not exist error Arsi SQL Server 2000 1 June 11th, 2008 11:20 AM
migrating from sql server 2000 to sql server 2005 abinashpatra SQL Server 2005 2 December 1st, 2006 03:45 PM
SQL Server sync with net server and browser server ne SQL Server DTS 0 June 13th, 2005 06:29 PM
Diff b/w SQL Server 7 and SQL Server 2000 ashu_from_india SQL Server 2000 1 April 25th, 2005 01:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.