|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
hello there,
what is the code to Delete all rows in a Table???? thanks in advance |
|
#2
|
|||
|
|||
|
DELETE FROM <tablename>;
COMMIT; You should get a good SQL manual ![]() |
|
#3
|
|||
|
|||
|
nah i expressed my self in the wrong way
i want to ask this: i got a table with has a column that is a FK of other tables... so delete from table1 doesn't work ![]() |
|
#4
|
|||
|
|||
|
Then you have to delete the referenced rows in the other table first...
Or you can drop/disable the FK constraint |
|
#5
|
|||
|
|||
|
Just a wonder - does using the TRUNCATE TABLE command override the foreign key constraints? And do you mean that the primary key of the table you're deleting is a foreign key of other tables, or that other table's primary keys are forign keys in this table? Because if it's the second case, I can't see why that constraint would affect you...
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Deleting all rows in a Table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|