deals2buy Posted October 16, 2012 Report Posted October 16, 2012 [quote name='cherlapalli_jailer' timestamp='1350425734' post='1302639654'] @Ghazani did u get clue or do u need further info So that i will provide sample example ....for further info [/quote] naaku telvaka adugutunna..unless referenced by PK & FK how will u delete rows from multiple tables?
mtkr Posted October 16, 2012 Report Posted October 16, 2012 [quote name='cherlapalli_jailer' timestamp='1350425734' post='1302639654'] @Ghazani did u get clue or do u need further info So that i will provide sample example ....for further info [/quote] Eg plzz..... might akkada tbls lo date n city s match avvatled emooo!!!
cherlapalli_jailer Posted October 16, 2012 Report Posted October 16, 2012 DELETE FROM Persons INNER JOIN Orders ON Persons.P_Id=Orders.P_Id ORDER BY Persons.LastName
cherlapalli_jailer Posted October 16, 2012 Report Posted October 16, 2012 The "Persons" table: P_Id LastName FirstName Address City 1 Hansen Ola Timoteivn 10 Sandnes 2 Svendson Tove Borgvn 23 Sandnes 3 Pettersen Kari Storgt 20 Stavanger The "Orders" table: O_Id OrderNo P_Id 1 77895 3 2 44678 3 3 22456 1 4 24562 1 5 34764 15
mtkr Posted October 16, 2012 Report Posted October 16, 2012 [quote name='deals2buy' timestamp='1350425805' post='1302639661'] naaku telvaka adugutunna..unless referenced by PK & FK how will u delete rows from multiple tables? [/quote] naak telisindhi cheptunnaaa.... PK n FK s lekunda 2 r 3 tbls lo same column names petti data ni load cheyyochu ga!!!
cherlapalli_jailer Posted October 16, 2012 Report Posted October 16, 2012 Data shoul be deleted from both the tables took example from the below URL to hide his office content [url="http://www.w3schools.com/sql/sql_join_inner.asp"]http://www.w3schools.com/sql/sql_join_inner.asp[/url]
Josh Posted October 16, 2012 Report Posted October 16, 2012 [quote name='cherlapalli_jailer' timestamp='1350425734' post='1302639654'] @Ghazani did u get clue or do u need further info So that i will provide sample example ....for further info [/quote]
deals2buy Posted October 16, 2012 Report Posted October 16, 2012 [quote name='cherlapalli_jailer' timestamp='1350426039' post='1302639686'] The "Persons" table: P_Id LastName FirstName Address City 1 Hansen Ola Timoteivn 10 Sandnes 2 Svendson Tove Borgvn 23 Sandnes 3 Pettersen Kari Storgt 20 Stavanger The "Orders" table: O_Id OrderNo P_Id 1 77895 3 2 44678 3 3 22456 1 4 24562 1 5 34764 15 [/quote] nuvvu oka table ne delete cheyyadam cheptunnav ga ee example lo [quote name='mtkr' timestamp='1350426085' post='1302639693'] naak telisindhi cheptunnaaa.... PK n FK s lekunda 2 r 3 tbls lo same column names petti data ni load cheyyochu ga!!! [/quote] load cheyyochu...but anni okate statement lo aithe cheyyav ga? and anni tables lo same columns petti data load cheyyochu..daaniki Key references avasaram ledu...but when u got to delete everything in a single statement then thats not possible ani chpetunna..as far as i know
mtkr Posted October 16, 2012 Report Posted October 16, 2012 [quote name='cherlapalli_jailer' timestamp='1350426104' post='1302639695'] Data shoul be deleted from both the tables took example from the below URL to hide his office content [url="http://www.w3schools.com/sql/sql_join_inner.asp"]http://www.w3schools..._join_inner.asp[/url] [/quote] ya mama delete stmt lo tbls em mention cheyyakapothe 2 tbls nundi del avuthaiii... if case manam oka tbl mention chesthe only aa tbl nundi del avuthaiii... crrrsttt e gaaa!!!!
deals2buy Posted October 16, 2012 Report Posted October 16, 2012 If you gonna delete records from multiple tables at a time refernced with each other, its not possible to delete them in a single statement check this: http://blog.sqlauthority.com/2012/09/27/sql-server-not-possible-delete-from-multiple-table-update-multiple-table-in-single-statement/
cherlapalli_jailer Posted October 16, 2012 Report Posted October 16, 2012 [quote name='deals2buy' timestamp='1350426218' post='1302639708'] nuvvu oka table ne delete cheyyadam cheptunnav ga ee example lo load cheyyochu...but anni okate statement lo aithe cheyyav ga? and anni tables lo same columns petti data load cheyyochu..daaniki Key references avasaram ledu...but when u got to delete everything in a single statement then thats not possible ani chpetunna..as far as i know [/quote] that is what i told to Ghzini He is deleting fron only one tbl I just wrote sample SQL exactly the way @ghazini's SQL looks like First look i find the issue is he is calling delete from only one tbl So i suggested it...if he confirms then we need not discuss further...if not ...then we can use the eample provided by me to find a sol
cherlapalli_jailer Posted October 16, 2012 Report Posted October 16, 2012 [quote name='mtkr' timestamp='1350426342' post='1302639719'] ya mama delete stmt lo tbls em mention cheyyakapothe 2 tbls nundi del avuthaiii... if case manam oka tbl mention chesthe only aa tbl nundi del avuthaiii... crrrsttt e gaaa!!!! [/quote] My point is also same so he has to confirm ....
deals2buy Posted October 16, 2012 Report Posted October 16, 2012 [quote name='cherlapalli_jailer' timestamp='1350426394' post='1302639724'] that is what i told to Ghzini He is deleting fron only one tbl I just wrote sample SQL exactly the way @ghazini's SQL looks like First look i find the issue is he is calling delete from only one tbl So i suggested it...if he confirms then we need not discuss further...if not ...then we can use the eample provided by me to find a sol [/quote] oka table nundi delete cheyyochu..but daaniki reference lu scene lo ki teesuku raavakkarledu anukuntunna oka vela techina we can delete it..asalu manodi exact req ento chuddam vachaka
mtkr Posted October 16, 2012 Report Posted October 16, 2012 [quote name='deals2buy' timestamp='1350426218' post='1302639708'] nuvvu oka table ne delete cheyyadam cheptunnav ga ee example lo load cheyyochu...but anni okate statement lo aithe cheyyav ga? and anni tables lo same columns petti data load cheyyochu..daaniki Key references avasaram ledu...but when u got to delete everything in a single statement then thats not possible ani chpetunna..as far as i know [/quote] okate statement??
deals2buy Posted October 16, 2012 Report Posted October 16, 2012 [quote name='mtkr' timestamp='1350426506' post='1302639738'] okate statement?? [/quote] ippudu multiple tables nundi data teesukochi oka table ki ela delete cheyyocho single statement use chesi ala delete cheyyalevu antunna single statement lo
Recommended Posts