hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : How do I delete a MSSQL record
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

How do I delete a MSSQL record

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 04-29-2005, 05:23 PM
Atomic Haven Atomic Haven is offline
WHT Addict
 
Join Date: Feb 2005
Posts: 114
Angry

How do I delete a MSSQL record


Okay, I'm in enterprise manager, and ASP is giving me an error that looks like this:

Code:
Response object error 'ASP 0251 : 80004005' 

Response Buffer Limit Exceeded 

/CorpAdmin/POList/PO_search.asp, line 0 

Execution of the ASP page caused the Response Buffer to exceed its configured limit.
Now I believe this has to do with ASP's default buffer. But, my database is extremely full, so instead of upping the buffer, I'd rather delete some records. ONly problem is, I didn't build this site, and I don't know anything about MSSQL can some one give me a SQL Query to run in Enterprise manager that will delete all records that have the value DateUpdated < 4/20/2004
in other words, I want all records that haven't been updated for about a year to be deleted. Can anyone help me?

__________________
fraudservers.com - for sale!

Reply With Quote


Sponsored Links
  #2  
Old 04-29-2005, 10:14 PM
shawn_t shawn_t is offline
New Member
 
Join Date: Apr 2005
Posts: 2
Do you have a way to enter mySQL queries?
If so, then you first want to determine the name of the table:

Quote:
show tables;
should give you a list of the tables in your database. If the records are in a single table then you can probably risk deleting them, but be careful as you can break things if you delete something that another table references. I would strongly advise backing up the mySQL database first. You can use something like:

Quote:
mysqldump -u<user> -p<passwd> <dbname> > <backupFileName>
Anyway, to answer your question, let's assume the table name is myTable. Use the following command:

Quote:
DELETE FROM myTable WHERE DateUpdated<yourDate;
To be safe, you can check your query syntax by using:

Quote:
SELECT * FROM myTable WHERE DateUpdated<yourDate;
you should see a list of the records that match your date query. If this is correct, then do the DELETE.

Reply With Quote
  #3  
Old 04-30-2005, 01:01 PM
rackgeek rackgeek is offline
WHT Addict
 
Join Date: Jan 2004
Location: Dallas / Fort Worth Texas
Posts: 115
shawn_t:

If you look closely, he mentioned Microsoft SQL Server. NOT MySQL.

Thanks!

Reply With Quote
Sponsored Links
  #4  
Old 04-30-2005, 07:15 PM
error404 error404 is offline
Web Hosting Master
 
Join Date: Dec 2004
Location: Canada
Posts: 1,076
This should just be standard SQL. DELETE FROM table WHERE DateUpdate < 2004-04-20; (god I hate USA only date formats and the problems they cause).

It sounds to me that your problems are with the code, however. I don't know a lot about ASP, but you should never have a result set large enough to overflow a buffer (this shouldn't even be *possible*, but that's MS for yah). As you said though, the code is not your own.

__________________
>> Keenan Tims
█▓▒░ I am currently looking for full-time work in the Vancouver area. Resume ░▒▓█
http://www.gotroot.ca/ | ktims@gotroot.ca | skype: keenan.tims

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Netflix Open Sources Janitor Monkey Tool that Cleans Up Unused AWS Cloud Resources Web Hosting News 2013-01-04 15:32:44
Are You Already Hosting the Next Megaupload? with David Snead - HostingCon 2012 Web Hosting News 2012-07-16 14:51:49
Jakarta Web Hosting Introduces MSSQL Server 2012 Hosting Services Web Hosting News 2012-04-23 11:18:07
Web Host Carpathia May Have to Delete Megaupload Data, Asks Federal Government to Pay Bill Web Hosting News 2012-03-26 11:31:29
Web Host iomart Wins UK Office Supply Provider Office2Office Virtualization Contract Web Hosting News 2012-02-10 13:45:11


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?