Delete all the records

0 votes
How to delete all the records in SQL Server 2008?
Sep 19 in Database by Kithuzzz
• 12,240 points
17 views

1 answer to this question.

0 votes

You can use this if you have no foreign keys to other tables:

truncate table TableName

or

delete TableName

If you want all tables:

sp_msforeachtable 'delete ?'
answered Sep 20 by narikkadan
• 20,880 points

Related Questions In Database

0 votes
2 answers

What are the ways to get the count of records in a table

With the help of the SQL count ...READ MORE

answered Aug 20, 2020 in Database by Okugbe
• 280 points
2,260 views
0 votes
1 answer

List all the types of user-defined functions

There are three types of user-defined functions, ...READ MORE

answered Oct 29, 2018 in Database by Sahiti
• 6,380 points
805 views
0 votes
1 answer

How will I get all the rows from my table where name starts with 's' and ending with 'I'?

Hi Santanu, I understand your problem, You can try ...READ MORE

answered May 28, 2019 in Database by sampriti
• 1,120 points
650 views
0 votes
1 answer

How do I kill all the processes in Mysql “show processlist”?

Hello kartik, Mass killing operation saves time. Do it ...READ MORE

answered May 4, 2020 in Database by Niroj
• 82,780 points
1,092 views
0 votes
1 answer

How to delete duplicate rows in SQL Server?

To answer your query, note that CTEs ...READ MORE

answered Feb 10 in Others by Soham
• 9,330 points
192 views
0 votes
0 answers

How to update Identity Column in SQL Server?

With 200 records currently, I want to ...READ MORE

Aug 9 in Database by Kithuzzz
• 12,240 points
167 views
0 votes
0 answers

Simple DateTime sql query

How do I query the DateTime database ...READ MORE

Aug 12 in Database by Kithuzzz
• 12,240 points
23 views
0 votes
0 answers

How can I select the first day of a month in SQL?

I only need to choose the given ...READ MORE

Aug 14 in Database by Kithuzzz
• 12,240 points
26 views
0 votes
1 answer

Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452) in sql 2008

Solution Go to Start > Programs > Microsoft SQL Server > Enterprise Manager. Right-click the SQL ...READ MORE

answered Sep 12 in Database by narikkadan
• 20,880 points
37 views
0 votes
1 answer

What's the difference between VARCHAR and CHAR?

Any Unicode data can be stored in ...READ MORE

answered Sep 12 in Database by narikkadan
• 20,880 points
18 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP