Solved

Can keys be defined to a View

Posted on 2011-09-23
2
174 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 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