Click here to Skip to main content
16,005,473 members
Home / Discussions / Database
   

Database

 
AnswerRe: Creation of table Pin
SHatchard9-Jul-07 2:02
SHatchard9-Jul-07 2:02 
AnswerRe: Creation of table Pin
sam#9-Jul-07 2:05
sam#9-Jul-07 2:05 
AnswerRe: Creation of table Pin
Krish - KP9-Jul-07 2:11
Krish - KP9-Jul-07 2:11 
QuestionBackup or restore Pin
jaics2629-Jul-07 0:46
jaics2629-Jul-07 0:46 
AnswerRe: Backup or restore Pin
Paul Conrad13-Jul-07 11:54
professionalPaul Conrad13-Jul-07 11:54 
QuestionProblem inserting data in SQL Server 2000 Pin
Mubashir Javaid8-Jul-07 22:12
Mubashir Javaid8-Jul-07 22:12 
AnswerRe: Problem inserting data in SQL Server 2000 Pin
Rajesh Mascon8-Jul-07 23:22
Rajesh Mascon8-Jul-07 23:22 
Questionhousekeeping Blobs. [modified] Pin
gloffa8-Jul-07 21:39
gloffa8-Jul-07 21:39 
Hi,

MSSQL 2005, I want to delete blobs on a regular basisto preserve diskspace.
The blobs has various meta-data but I want to delete them based on time of
creation (date-time) and type. My concern is to equally disperse the deletion
so no type ends up being empty, but rather delete a few of this type and some
in that type ... and so on.

Any kind of help regarding this would be appriciated.

This CTE takes 100 from every Category

WITH tempdata AS (SELECT ROW_NUMBER() OVER (PARTITION BY Category<br />
ORDER BY Age DESC) AS rownum, ID FROM Imageblob)<br />
DELETE FROM tempdata WHERE rownum > 1000;


But how do i use it with a grouping selection so I can choose
to delete from the category with the most rows.

Select count(Age)<br />
From imageblobs<br />
Group by Catebogry


that gives me each row per category but I want to use it with the first CTE
and also order them.

Any suggestions/code/help/hints are much appritiated´
My t-sql knowledge is rubbish

Cheers,

/Andreas





-- modified at 12:27 Monday 9th July, 2007
QuestionSQL Server 2000 connection problem Pin
Deteroc8-Jul-07 21:31
Deteroc8-Jul-07 21:31 
AnswerRe: SQL Server 2000 connection problem Pin
Nouman Bhatti8-Jul-07 21:57
Nouman Bhatti8-Jul-07 21:57 
Questiondisplay stored procedure format..........., Pin
Member 38798818-Jul-07 21:16
Member 38798818-Jul-07 21:16 
AnswerRe: display stored procedure format..........., Pin
Pete O'Hanlon8-Jul-07 23:06
mvePete O'Hanlon8-Jul-07 23:06 
GeneralRe: display stored procedure format..........., Pin
Member 38798819-Jul-07 0:05
Member 38798819-Jul-07 0:05 
GeneralRe: display stored procedure format..........., Pin
Pete O'Hanlon9-Jul-07 0:28
mvePete O'Hanlon9-Jul-07 0:28 
QuestionExporting and Importing Pin
M. J. Jaya Chitra8-Jul-07 21:04
M. J. Jaya Chitra8-Jul-07 21:04 
AnswerRe: Exporting and Importing Pin
Harini N K9-Jul-07 19:21
Harini N K9-Jul-07 19:21 
QuestionProblem Insert data into MySQL using ASP.NET Pin
drexler_kk8-Jul-07 17:24
drexler_kk8-Jul-07 17:24 
AnswerRe: Problem Insert data into MySQL using ASP.NET Pin
N a v a n e e t h8-Jul-07 21:33
N a v a n e e t h8-Jul-07 21:33 
GeneralRe: Problem Insert data into MySQL using ASP.NET Pin
drexler_kk8-Jul-07 22:21
drexler_kk8-Jul-07 22:21 
QuestionBinding a datagridview to a binding source Pin
steve_rm8-Jul-07 12:13
steve_rm8-Jul-07 12:13 
QuestionSelect by date Pin
Sam Heller8-Jul-07 5:39
Sam Heller8-Jul-07 5:39 
AnswerRe: Select by date Pin
Mike Dimmick8-Jul-07 11:49
Mike Dimmick8-Jul-07 11:49 
GeneralRe: Select by date Pin
Sam Heller8-Jul-07 11:51
Sam Heller8-Jul-07 11:51 
AnswerRe: Select by date Pin
Thomas Chester9-Jul-07 7:53
Thomas Chester9-Jul-07 7:53 
QuestionUse ' one quotation make error with sql statmetn .. Pin
kindman_nb8-Jul-07 3:47
kindman_nb8-Jul-07 3:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.