bhp patel

bhp patel

  • NA
  • 4
  • 1.6k

Delete Multipal Record Query ?

Apr 6 2011 7:24 AM

I am try to this things,


 When i delete state also delete this state city delete.


my query


DELETE FROM ab
FROM         City AS ab INNER JOIN
                      State AS b ON ab.state_id = b.state_id CROSS JOIN
                      ab
WHERE     (ab.state_id =
                          (SELECT     state_id
                            FROM          State
                            WHERE      (state_name = @state_name)))


        My state table
        city_id,city_name

11Rajasthan
12Gujarat
13Maharastra


My city table

city_id,city_name,state_id

12Ahmedabad12
14Borivali13
16Surat12
19Udaypur11
20Mumbai13
21Pune10
22Vadodara12
25Anand12


Error Message : Invalid object name 'ab'



Answers (1)