HomeОбразованиеRelated VideosMore From: kudvenkat

Cascading referential integrity constraint - Part 5

1040 ratings | 468656 views
In this video, we will learn about Cascading referential integrity constraint Text version of the video http://csharp-video-tutorials.blogspot.com/2012/08/cascading-referential-integrity.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-5-cascading-referential-integrity.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Html code for embedding videos on your blog
Text Comments (108)
Bhakti Khot (21 days ago)
you didn't not show (setnull ,cascade )non graphical version????
funfor you## (1 month ago)
Hello sir can you create a video for how to install and download SQL server management studio for 32bit os windowa7
Awil Gedi (2 months ago)
Mr Venkat your one of the best instructors that I know easy to understand no accent .Please don't listen those haters for your work. Thank you SIR!
AN TYAGI (2 months ago)
in this u showed cascading by design if we have do ith with query then what should i do?
ashok kumar (3 months ago)
When If We set Default in Foreign key constraint if we delete GenderId=3 record What will happen?
SuperJV4x (5 months ago)
great teacher - crystal clear
Programme Seekho (6 months ago)
Thank You Sir Very Help full Video..Very Nice Sir
lata sati (7 months ago)
awesome videos, well explained everything. Sharing my sincere thanks!!
Afsan Gujarati (9 months ago)
I love more kudvenkat
chahak joshi (9 months ago)
Hello, amazing content !! i'm actually understanding logic behind everything. i have an issue , i'm not getting the error while deleting record. Its not rolled back , the record is deleted & yeah the delete rule is no action. Please help.
Trzbne (10 months ago)
I am not a native English speaker, so first i was afraid of this video, because I did not understand even the title of it, but now everything is clear and easy to understand! You are the Master of teachers, Venkat!
tabassum jahagirdar (11 months ago)
Hello Sir I have added default constraint to GenderId as shown in video When i am trying to execute this query "insert into tblPersons (Id,Name,Email) values (9,'do','[email protected]')" it is showing error as "The INSERT statement conflicted with the FOREIGN KEY constraint "tblPersons_GenderId_FK". The conflict occurred in database "test", table "dbo.tblGender", column 'Id'" Kindly suggest where i went wrong
junling chen (1 year ago)
Great video! Thank you so much for sharing!
Anand SG (1 year ago)
Hi Mr. Venkat It is really grateful of you making these tutorials, can you please make video tutorials on WPF and Power BI. Thank you.
Naruto Rahat (1 year ago)
thanks
Anshul Kumar (1 year ago)
What would be sql queries for that
soumyaranjan rath (1 year ago)
best tutorial for SQL learning..thank you sir
Raphael Bernard (1 year ago)
I had the same situation as Suresh I completed a IT degree which was when I se Kudvankats tutorials a rip off as they covered topics such as OOP, etc superficially.  Thank you Vankat for these videos.  I am working on Part 5 Cascading referential... and find this error when I choose Set Null...Cannot SET NULL referential action, because one or more referencing columns are not nullable.  Anyone have an idea how to solve this?
creative world (1 year ago)
How can I add delete/cascade/null default values through queries for deleteing the referenced values
JAMIRUL HOQUE (1 year ago)
I greatly fairly happy and fresh about sql thank u my dear sql guru
Saurabh Shukla (1 year ago)
Self explained videos for learning.....Great job.
yamdev11 (1 year ago)
In my Sql , Insert and update option arenot editable. what hsould i do?
Maths_kamlesh (1 year ago)
How to perform these actions using script and not doing it manually
Kamil (1 year ago)
I've seen numerous videos but these are the best be a large margin!
Anand raj (1 year ago)
Hi - i wont be able to change the update rule and delete rule " No action" i dont get the drop down option ?  when i try to set the default value if we delete tblgender id female data. help
dalila dali (1 year ago)
what a good tutorial,thank you sir
Yashveer Gurjar (1 year ago)
Hi Venkat, Would it be possible for you to add the SQL code related to the above material.Doing it through GUI is easy but one should know the code to do that.
Guram Kankava (1 year ago)
Thank you very much
Sri Ram (1 year ago)
Hello, Venkat. Your videos are really helpful. Can we set the Insert and Update constraints using commands rather than the GUI? If so, what are the commands. Thanks in advance.
Umer Farooq (1 year ago)
Venkat Sir, Can we have these slides please?
kudvenkat (1 year ago)
The image version of the slides are available on my blog at no cost. http://csharp-video-tutorials.blogspot.com However, if you want to download all the original PPTs, you can order them from the following link. Hope you will find them useful. http://www.pragimtech.com/download_kudvenkat_slides.aspx
Amiha Beri (1 year ago)
I really do Appreciate what you have done. Thank you!!
The Aviator (1 year ago)
thank you very much for sharing your knowledge..
Hussain Madarwala (1 year ago)
hi...i have applied a foreign key to tblPerson...... when i insert a invalid row it doesnt allow me to add ,but i in NOAction ,when i delete a gender id ,its get deleted.....why ?
Umer Farooq (1 year ago)
probably, you are trying to delete from gender table. it won't allow records to be deleted from tblGender because those records are being referenced from tblPerson table. if insatiable, please elaborate your question.
Alex Chan (2 years ago)
THANK YOU SO MUCH I HAVE MY FINALS IN 5 DAYS LOOOOL!!!
Aabel Tom (2 years ago)
Very good explanation!
Kris Maly (2 years ago)
Revisiting to refresh BASICS. I enjoyed watching this video and recommend others. Thanks for educating the community and appreciate your volunteership. Thanks a bunch
malhar jajoo (2 years ago)
So basically , this tutorial describes what happens to the Foreign key coloumn when a Update or Delete is done in the Primary Key coloumn
Imrose Reza Himel (2 years ago)
Can we have the link to download the PPT files that you are using in this tutorial? Off in free of cost. Thank you for your effort.
Mithilesh Naik (1 year ago)
How do i download it? its opening in a seperate web page
Abdul Wahab (2 years ago)
Here it is: http://csharp-video-tutorials.blogspot.com/p/sql-server.html You can download easily PPT files according to the sessions. :)
AJI CHACKO (2 years ago)
If it is Set to NULL and the FK column is NOT NULL then also it will convert and affect the row?
Sadhana Kalyanaraman (2 years ago)
I need to know if it is possible to do this through a query, instead of graphically? Because my SQL graphical interface is not woking
Jack X (2 years ago)
It seems that we simply cannot modify a constraint. We need to delete a constraint and recreate it with new ON Delete options.
Sadhana Kalyanaraman (2 years ago)
Cool. Thank you :D
Abdul Wahab (2 years ago)
ALTER TABLE tblPerson ADD CONSTRAINT FK_tblPerson_ID Foreign Key(GenderID) REFERENCES tblGender(ID) ON DELETE CASCADE/SET NULL/SET DEFAULT
ajinkya nalavade (2 years ago)
Thanks for this series. It cleared a lot of hidden concepts.
Plavanya Cme (2 years ago)
thank you so much sir.you are awesome.oh my god you are producing videos for c# and sql server and also for asp.net.how it is possible can u please tell me sir
Cain Liu (2 years ago)
Thank you, it is very helpful!
kudvenkat (2 years ago)
You are very welcome and thank you very much for taking time to give feedback. This means a lot. I am very glad you found the videos useful. I have organised all the Dot Net & SQL Server videos in to playlists, which could be useful to you https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd If you need DVDs or to download all the videos for offline viewing please visit http://www.pragimtech.com/kudvenkat_dvd.aspx Slides and Text Version of the videos can be found on my blog http://csharp-video-tutorials.blogspot.com Tips to effectively use my youtube channel. https://www.youtube.com/watch?v=y780MwhY70s If you want to receive email alerts, when new videos are uploaded, please subscribe to my youtube channel. http://www.youtube.com/subscription_center?add_user=kudvenkat If you like these videos, please click on the THUMBS UP button below the video. May I ask you for a favor. I want these tutorials to be helpful for as many people as possible. Please share the link with your friends and family who you think would also benefit from them. Good Luck Venkat
Piyasi Dey (2 years ago)
O my god..I have wasted so much time to understand this Cascading theory... its so simple!!
Piyasi Dey (2 years ago)
Thank You Very Much Sir..
Manjeet Ranga (2 years ago)
Sql command to perform the same action ALTER TABLE tblPerson ADD CONSTRAINT FK_tblPerson_ID Foreign Key(GenderID) REFERENCES tblGender(ID) ON DELETE CASCADE/SET NULL/SET DEFAULT
Johnson George (2 years ago)
Thanks Sir Geat work GOD Bless you.............................!
Orxan Babashov (2 years ago)
thanks so much!Your explanation is just awaresome....
lakkadi sampath (2 years ago)
its an awesome presentation you been producing to all learners...can you mail me the presentation slides to my email ID: [email protected] will be very helpful for future references..thank you
You have to buy them from his website. 50 bucks for the whole series.
Muhammad Rashid (2 years ago)
Thankyou sir those videos are much much butter i never seen anywhere i learn much Awesome videos great work for beginners your great sir :)) the way you teach Awesome (y) !!!
D Aspies CAN (2 years ago)
This is one of the best presentation I ever seen, Well done KUDOS!!!
Robert Roszkowski (2 years ago)
Thanks Venkat for producing such AWESOME subject matter!! You are da man!! By chance would you happen to have the power point notes for these videos?
Wasim Bader (2 years ago)
thank you again for such a great tutorial and helping me to learn SQL which will help me to get through for my Data Analytics. secondly I am not into Web developer. as you mentioned in ur email reply. Regards
Aziz Suhendra (3 years ago)
thank you.. this tutorial is really good. why when i delete the record in tblGender where gender is Female, the record in field GenderId in tblPerson doesnt got default as '3', even though i have made the default constraint for GenderId int tblPerson.
kinnaree patel (3 years ago)
Hi Venkat. Your videos are very informative. I am a beginner trying to learn SQL and your videos are helping me do that. Thanks for that. I have a question: If the Delete rule is set as default and if we try to delete the third row i.e. 3 Unknown. What will happen
Raphael Bernard (1 year ago)
I hope you saw that it was the first test case he did and it came up with an error?
Rv V (3 years ago)
How can we do this with a query?
Abhishek H (7 months ago)
Looks like you need to drop and re-create the constraint
munesh raj (3 years ago)
what will happen if i directly declare foreign key or primary key without using constraint........can u explain me please
Maneesha Reddy (3 years ago)
+munesh raj Just try and see what happens..
MMR- Saad (3 years ago)
:-D
sameer naqvi (3 years ago)
Thanks a lot Venkat , ur videos are really very helpful... this is the best tutorial on sql. Even beginner can become a master by learning through this tutorial  THANK YOU SIR........................................Excellent Tutorial..
Sathya Raj (3 years ago)
Awesome  explanation.Good work.
suresh rajput (3 years ago)
venkat sir i invested 15000 in a coaching for sql server but really belive me when i saw all of ur videos it seems that they didn't teach me anythng. ur videos are helping all IT students and espicly for those who dnt have money to join any coaching class. so thanku thanku thanku thanku sir for making this great tutorials.now i can say myslef i m a Sql MASTER :p
Ruth Burayu (9 months ago)
I just started and hoping to be a DBA, if you dont mind telling me..did you study only this (his videos )or did you use other resources and how did you do your studing? I could use your advice i want to be a master at it too :) thanks alot
FinalCounterStrike (3 years ago)
+suresh rajput I agree with you Suresh .... After seeing these videos nobody needs any kind of coaching classes.
Franklin Omoaghe (3 years ago)
Awesome videos and great instructing! Thanks, thanks and Thanks! God bless you!
Nick Farish (3 years ago)
thankyou so much .pple like u will save the world
Sayed Hossain (4 years ago)
Very Good job. Thank you sir
Ajay Grover (4 years ago)
Great Job. Very Useful tutorials!
Ramu mannem (4 years ago)
Hi Venkat, Your videos are really very helpful for SQL beginners. Thanks a lot for your time. I have a doubt that can I use Ms Access as a frontend to SQL Server?
Biswaranjan Rout (3 years ago)
People like you will destroy the world. MS Access is itself a database, sql server management studio is a tool.
Imran FM (4 years ago)
Hey Venkat ... You are doing a great Job for all beginners ... Long Live !!!!!
D Dev (4 years ago)
This video is short, understandable and very useful. Great job kudvenkat! Keep going on in the same way :)
Ab S (4 years ago)
Great man does great job. tens of thanks and respect. Thank you again
Kavitha Venugopal (4 years ago)
Nice Explanation sir..Can you upload videos based on unit testing
Manish Vasuki (4 years ago)
excellent explanation.....
kudvenkat (5 years ago)
Thank you very much for taking time to give feedback. In the description of this video, I have included the link for ASP .NET, C#, and SQL Server playlists. All the videos are arranged in logical sequence in these playlists, which could be useful to you. Please share the link with your friends who you think would also benefit from them. If you like these videos, please click on the THUMBS UP button below the video. For email alerts, when new videos are uploaded, you may subscribe to my channel.
ola Odusanya (5 years ago)
U are the man Venkat, clear and concise it is .IT Guru...../ Genius.Thanks so much for your tutorial videos.
Ruhi Goktas (5 years ago)
Hi Venkat!Thanks so much for this tutorial.I found what I had been looking for.Could you help me out with the following situation: 1-Let's say here a user tries deleting one of the genders from .NET interface. 2-We want users to see a warning message something like "This might affect some records." How do we warn a user before deleting a gender here?Is there anything like try &catch? Thanks.
Vishal Sherathiya (5 years ago)
- Unable to create relationship 'FK_tblRelationships_tblUsers1'. Introducing FOREIGN KEY constraint 'FK_tblRelationships_tblUsers1' on table 'tblRelationships' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or modify other FOREIGN KEY constraints. Could not create constraint. See previous errors.
Vishal Sherathiya (5 years ago)
Now I have added two foreign key constraints for relationships.requestSenderID ----Users.UserID and for relationships.requestReceiverID ---- Users.UserID.namely FK_tblRelationships_tblUsers and FK_tblRelationships_tblUsers1 Now I want to set cascade on delete for both the foreign key constraints but I am getting the following error : continued in next comment.....
Vishal Sherathiya (5 years ago)
Hello venkat sir, I have got some problems when I try to set referential integrity. Suppose I have created two tables as below : create table tblUsers ( UserID int NOT NULL Primary Key, Name int NOT NULL ) create table tblRelationships ( RelationshipID int NOT NULL Primary key, RequestSenderID int NOT NULL, RequestReceiverID int NOT NULL, [Status] nvarchar(30) NOT NULL ) contined in next comment.....
ahmed mastor (5 years ago)
clean and clear
Justin Garr (5 years ago)
Thank you For The Videos! Also,I would like to ask about duplicate entries in my data base. My program reports CPU % to my SQL database & I really have no care for it to list ?% 50 times. Any help on this would be great thank you.
kudvenkat (5 years ago)
Hey Namita, on the top left hand corner of SQL Server management studio, there should be a dropdownlist showing the name of the database. Can you please make sure you have selected the database, that contains your table. Hope this helps. Good Luck.
namita jain (5 years ago)
Hey venkat thank you so much for ur videos ...it's been a Big help. I am trying to add default constraint in tblperson n I used same syntax like you . but I am getting following error"can not find the object tblperson because it does not exist or you do not have pessimism ". Can you please tell me solution for that.thx
Gecse Catalin (5 years ago)
Very good and clear tutorials. Thank you SIR!
vaishali gajjar (5 years ago)
Respected sir,......your all videos..are very helpful us.....m gone..fan of yours now...amazing....videoo..keep it up sir....
Khaled Chikh (5 years ago)
THANK YOU SIR
krismaly (5 years ago)
I enjoyed watching this video. I recommend to watch if you want to learn database stuff. Thanks a lot
Abul Hasan Lakhani (5 years ago)
Hi. The video is gr8. But you did not mention what will happen if we delete the gender row which is set as default value for Gender and cascading option set as Set Default??
Ravi Kiran Polavarapu (5 years ago)
Thank you very much. These videos are very helpful.
Luke Harrington (5 years ago)
Very good! Am I right in thinking that if you set the constraint to "set default" and then you delete the default, the rows in the tblperson table that had the default value will be set to null?
Pavan Kumar (5 years ago)
your way of explanation is cool and i liked it a lot
madhuri j (5 years ago)
thanks sir.
Abdul Hannan (5 years ago)
thank you very much for these tutorials keep it up buddy you are my real teacher.....!!!!!! once again thankyou very much.....
Alkesh Dodia (5 years ago)
thanks your method of explaining is excellent.
Kalsang Dorjee (6 years ago)
Thank you for these wonderful Tutorials

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.