Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

How do I delete all the records in an SQL Table called ItemAnalysisDetail

How do I delete all the records in an SQL Table called ItemAnalysisDetail

Thanks
Kenny
0
kwh3856
Asked:
kwh3856
  • 9
  • 6
1 Solution
 
Javert93Commented:
Through SQL or .NET?
0
 
LindzKCommented:
DELETE * FROM ItemAnalysisDetail
0
 
kwh3856Author Commented:
SQL.......Query Analyzer????  Can I do it from there???

Thanks
Kenny
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LindzKCommented:
yes, just run that command :-

 DELETE * FROM ItemAnalysisDetail

make sure you have the right database selected in the drop down box
0
 
kwh3856Author Commented:
when I run the DELETE * FROM ItemAnalysisDetail
I get Incorrect syntax near '*'.
0
 
LindzKCommented:
for good examples of simple sql comands visit this site - it's pretty useful for starting off

http://www.w3schools.com/sql/default.asp
0
 
LindzKCommented:
try it without the *
0
 
kwh3856Author Commented:
neither one of those worked.  I read the tutorial and see what you are talking about.  These examples did not work for me.  I am using SQL 2000 Dev Edition and trying to use SQL Query Analyzer to delete the rows.  Is this the correct way????

Thanks
Kenny
0
 
LindzKCommented:
hmm, that should work and sql query analyzer is fine for doing what you need - one sec, i'll try and look into it :)
0
 
kwh3856Author Commented:
Here is what I typed into SQL Query Analyzer while the table was selected in the left view pane
DELETE * FROM ItemAnalysisDetail


Here is the exact error message

Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near '*'.


Thanks
Kenny

0
 
LindzKCommented:
as well as the left hand pane - there is usually a drop down box above the main text area - do you have one of them ? is you database selected ? and not northiwind or somethng similar
0
 
kwh3856Author Commented:
The master was selected in the drop down pane but I changed it to the database.  I still got the same error message with the *.  I will try it now without the *.

Thanks
Kenny
0
 
LindzKCommented:
just as a test try doing

delete from ItemAnalysisDetail where columnname = 'sometext'  for me, see if that runs through.

where columnname = a columnname in your database
 and sometext = some text you know exists in that column

keep the text in '  '   or if it's a numeric value , dont
0
 
kwh3856Author Commented:
You Win!!!!!!!!!!!!!!!!!


Thank you very much :)


Thanks
Kenny
0
 
LindzKCommented:
it worked with the db in the drop down ? :)
0
 
LindzKCommented:
thanks for teh points - glad we got to the bottom of it !
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 9
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now