December 13, 2010 at 8:15 am
Please help me in creating delete stored proc with dependencies. I created one for Delete Table but couldn't get it done for dependencies. Syntax would be fine.
Thanks in advance
December 13, 2010 at 9:14 am
Your description is not clear about what you are looking for. What dependencies? What are you expecting the stored procedure to do?
December 13, 2010 at 9:59 am
I believe they are trying to create a sproc that will delete tableA when there are foreign keys????
To do this you would have to either update the children table to a NULL or some other valid value, or delete the child record first.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
December 13, 2010 at 10:13 am
Thank you. I was trying to delete parent first. It works now.
December 13, 2010 at 11:41 pm
wannalearn (12/13/2010)
Thank you. I was trying to delete parent first. It works now.
May be syntactically it works but from business perspective child table should contains any records associated or dependent on parent table BUT yes again it depends on your business requirement.i am putting just a small thought 🙂
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply