Solved

Can keys be defined to a View

Posted on 2011-09-23
2
173 Views
Last Modified: 2012-05-12
Can keys be defined to a View?
0
Comment
Question by:HLRosenberger
2 Comments
 
LVL 21

Accepted Solution

by:
JestersGrind earned 500 total points
ID: 36588545
Sort of.  You can create an indexed view with a unique, clustered index on it which would be similar to a primary key.  You cannot however create any kind of foreign key constraints to a view.  If you need that, it should be a table.  Also, note that there are a lot of requirements/restrictions to creating indexed views.  Here is info from BOL.

http://msdn.microsoft.com/en-us/library/ms191432.aspx

Greg

0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 36598988
Thanks.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now