У нас вы можете посмотреть бесплатно SQL Foreign Key Constraint - A Complete Tutorial или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Here we look at Foreign Keys in SQL Server and how to find them within SQL Server Management Studio, the video covers: How To Create Foreign Key Constraints We look at how to create Foreign keys along with why they are needed and what we need to check prior to creating them. Foreign keys can be created when we create the table, or alternatively they can be created afterward. In this tutorial I show you both. I find its very useful to know how to create Foreign Keys using code personally and as a DBA or a Data Analyst you should understand this. Foreign Key Error Very frequently we may find that we are getting Foreign Key errors in SQL Server, errors such as 'Violation of Foreign Key Constraint'. This is usually raised when inserting into a table and the the value the Foreign Key is referencing, isn't there - so the constraint is doing its job. Remember a Foreign Key is there to enforce integrity in a database. In this tutorial we recreate that error and explain why it happens and more importantly - how to fix it! Primary Key vs Foreign Key Although this tutorial isn't solely on Primary Key vs Foreign Key (I will probably do one shortly), I do reference the usage of Primary Keys in this video and explain the comparison between the two. Knowing what a Primary Key is this tutorial shows you everything about a Foreign Key so the difference is explained to you here too. How To Find Foreign keys in SQL Server Management Studio There are times when we may want to know how to find foreign keys within SQL Server management studio. In this video we cover how to locate these within tables and I run through scripting them out and re-adding them. The biggest problem that I found when creating Foreign keys are that the data may need to be 'cleansed' first because you may be trying to create a Foreign Key on a table but the existing data within it contradicts what you are trying to do - so you need to prep the table first. To explain the above example we look at how to remove a foreign key and then re-add it. As always, if there are any questions then let me know. Thanks Alan Lesson 00:00 Tutorial Overview 02:14 Inserting into table with Foreign key 03:05 Violation of Foreign Key Constraint 03:30 Remove Foreign Key Constraint 04:10 What is a foreign key 04:30 Create Foreign Key 06:54 How to Find Foreign Key Constraint References. The below links may also help you understand Foreign Keys Foreign Keys https://www.tutorialspoint.com/sql/sq... Difference Between Foreign Key and Primary Key https://www.geeksforgeeks.org/differe... Foreign Key Check Contstaint https://www.sqlshack.com/commonly-use...