Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
abbikhan
Starting Member
26 Posts |
Posted - 2011-06-22 : 07:50:30
|
| Getting Error on statement:delete FROM [Test_DB].[dbo].[Type] , [Test_DB].dbo.[user] where [Test_DB].[dbo].[Type].type_id=[Test_DB].dbo.[user].type_iderror:Msg 102, Level 15, State 1, Line 1Incorrect syntax near ','.why is that so |
|
|
Sachin.Nand
2937 Posts |
Posted - 2011-06-22 : 08:36:39
|
| Because you cannot specify multiple tables in a delete query.PBUH |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
|
|
abbikhan
Starting Member
26 Posts |
Posted - 2011-06-22 : 09:42:15
|
| Then how can we use 'ON DELETE CASCADE' option |
 |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2011-06-22 : 10:10:45
|
| Please don't do that.Instead, first delete from the child table, then the parent. |
 |
|
|
abbikhan
Starting Member
26 Posts |
Posted - 2011-06-23 : 03:02:55
|
| why is that so this is not the right practice..?? or some other issues. |
 |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2011-06-23 : 10:03:44
|
| It creates difficult to track down bugs.It causes developers to unintentionally delete data.It is the lazy way out of actually knowing what one is doing.I don't allow them on my systems. |
 |
|
|
|
|
|