Link to home
Start Free TrialLog in
Avatar of Anne Troy
Anne TroyFlag for United States of America

asked on

SQL Syntax for Delete Entire Rows Mgmt Studio

Delete from Skus Where Sku > '" & Sku.ToString(399999) & "'

Open in new window


I need to delete only those records that are numbered 399999 and up. Looks like the field isn't an integer, so I can't get it to work right. I found the line above online, but it deletes ALL the records.

If it's easier, I can just delete all BUT the records where SKU <= 2000

I'll be trying to find an online solution while I wait.

Thanks in advance!!
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Anne Troy

ASKER

Hmmm... Seemed to work for a bit, then...

Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to numeric.

Now, I'm checking what it DID delete.
Okay. It didn't delete any. Still looking.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, guys. I've had to pass this on, but I appreciate your help!
Thanks for the split.  Good luck with your project.  -Jim