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 |
|
raysefo
Constraint Violating Yak Guru
260 Posts |
Posted - 2006-11-15 : 09:41:20
|
| Hi,i wanna know how can i check a table has datas inside, because i wanna use delete from table and if table is empty i dont wanna run this statement.thanks in advance |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-11-15 : 09:45:07
|
| If exists(select * from table)--Data existselse--doesnt existAlso why do you want to check this?You can apply delete on empty table alsoMadhivananFailing to plan is Planning to fail |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
raysefo
Constraint Violating Yak Guru
260 Posts |
Posted - 2006-11-15 : 10:01:21
|
| on ibm db2, when i use delete from table..., it gives error saying delete on an empty table.. |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-11-15 : 11:14:05
|
quote: Originally posted by raysefo on ibm db2, when i use delete from table..., it gives error saying delete on an empty table..
Are you working with DB2?CODO ERGO SUM |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|
|
|