473,395 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Creating index on a view to prevent multiple not null values - Indexed view?

I am looking to create a constraint on a table that allows multiple
nulls but all non-nulls must be unique.
I found the following script

http://www.windowsitpro.com/Files/09...Listing_01.txt

that works fine, but the following line

CREATE UNIQUE CLUSTERED INDEX idx1 ON v_multinulls(a)

appears to use indexed views. I have run this on a version of SQL
Standard edition and this line works fine. I was of the understanding
that you could only create indexed views on SQL Enterprise Edition?

Jul 23 '05 #1
3 1796
You can create indexed views in any MSSQL edition, but the query
optimizer will ignore them unless you either have Enterprise Edition,
or you use the WITH (NOEXPAND) hint in your queries. See "Creating an
Indexed View" in Books Online.

Simon

Jul 23 '05 #2


Simon Hayes wrote:
You can create indexed views in any MSSQL edition, but the query
optimizer will ignore them unless you either have Enterprise Edition,
or you use the WITH (NOEXPAND) hint in your queries. See "Creating an
Indexed View" in Books Online.

Simon


Simon,
Thanks for this. I was confused as I'm sure I recall using SQL a few
Sp's ago that the "manage indexes" option wasn't available from the
standard edition enterprise manager when modifying a view. The BOL
states

"You can create indexed views only if you install Microsoft SQL Server
2000 Enterprise Edition or Microsoft SQL Server 2000 Developer
Edition."

However, I'm more than happy if it works

Cheers

Noel

Jul 23 '05 #3
I'd never noticed that, but I just checked and you're correct - if
you're using EM with a Standard Edition server the option isn't
available, however it is with Enterprise Edition. I didn't see that
quote in BOL, but is it possible you're using an older version? The
latest one is here:

http://www.microsoft.com/downloads/d...DisplayLang=en

Personally, I don't use EM much anyway - since all my DDL scripts are
under source control, a graphical tool isn't that useful, and I'd
rather not have EM hiding something from me. This article has more
information about using QA and EM:

http://www.aspfaq.com/show.asp?id=2455

Simon

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Indraneel Sheorey | last post by:
Hello, I want to set up a query in SQL Server that is "grouped by" a variable PRICE. Since PRICE takes on continuous decimal values, I want to create deciles based on this variable and then...
1
by: Robert Oschler | last post by:
I read a while back that MySQL will only use one index per query. (If this is not so, please tell me and point me to a doc that gives a good explanation of MySQL's current index usage policy). ...
6
by: christopher.secord | last post by:
Is there any advantage to doing this: ALTER TABLE testtable ADD CONSTRAINT PK_sysUser PRIMARY KEY NONCLUSTERED (UserID) WITH FILLFACTOR = 100, CONSTRAINT IX_sysUser UNIQUE NONCLUSTERED...
5
by: Gerard M. Operana | last post by:
unsubscribe
9
by: WalterR | last post by:
This is my first time here, so there may be earlier relevant threads of which I am unaware. Though my experience with DB2 is not extensive, such as it is was under OS/390 or equ. My main...
3
by: lauren quantrell | last post by:
In a table design, properties window there is the Indexes/Keys tab. I want to create a few indexes. Row myID is the PK. I also want indexes on rows myOne, myTwo, myThree. In the selected...
7
by: Cyberwolf | last post by:
Is there a way to set a primary index to ignore Nulls and if so how would I do it. I have already tried setting it so it is not a required field, but that does not work. It states that the field...
6
by: john | last post by:
Last week I posted about making a unique index on multiple fields to prevent importing identical records twice. I still have trouble with the nulls in the index. The only way that I can make it...
2
by: oswald.harry | last post by:
hi i am reading a set of jpeg files(RGB) and extracts the pixel values as longs.i want to create a 2d array with numof rows=numof images and numof cols=numof pixels in each image.ie each row of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.