Delete Rows

Reply

Join Date: Nov 2009
Posts: 1
Reputation: Kaddolas is an unknown quantity at this point 
Solved Threads: 0
Kaddolas Kaddolas is offline Offline
Newbie Poster

Delete Rows

 
0
  #1
Nov 8th, 2009
Hi

I wonder how I do to remove usersid from 1915 to 1945 for example in MS Sql?

  1. DELETE FROM [dbo].[user] WHERE user ID = 1915 to userID 1945

When i add that i get this message:

Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'to'.
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'to'.

Can someone please tell me what is wrong?
Last edited by peter_budo; Nov 15th, 2009 at 4:39 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,464
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 629
Sponsor
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast
 
0
  #2
Nov 8th, 2009
  1. DELETE FROM User WHERE UserId >= 1915 AND UserId <= 1945

There is also a BETWEEN operator you could use.
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 229
Reputation: mail2saion is an unknown quantity at this point 
Solved Threads: 36
mail2saion's Avatar
mail2saion mail2saion is offline Offline
Posting Whiz in Training
 
0
  #3
Nov 10th, 2009
Also you can write:
  1. DELETE FROM User WHERE UserId BETWEEN 1915 AND 1945
MARK AS SOLVED if its help you.

REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
Reply With Quote Quick reply to this message  
Reply

Message:




Views: 573 | Replies: 2
Thread Tools Search this Thread



Tag cloud for MS SQL
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC