Delete Rows

Please support our MS SQL advertiser: Intel Parallel Studio Home
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
21 Days Ago
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; 14 Days Ago 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,215
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: 572
Sponsor
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast
 
0
  #2
21 Days Ago
  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: 217
Reputation: mail2saion is an unknown quantity at this point 
Solved Threads: 31
mail2saion's Avatar
mail2saion mail2saion is offline Offline
Posting Whiz in Training
 
0
  #3
19 Days Ago
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:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC