Click here to Skip to main content
15,929,653 members
Home / Discussions / Database
   

Database

 
GeneralRe: Importing a Tab delimited report file Pin
Jack Fleet2-Aug-07 9:52
Jack Fleet2-Aug-07 9:52 
GeneralRe: Importing a Tab delimited report file Pin
pmarfleet2-Aug-07 12:39
pmarfleet2-Aug-07 12:39 
GeneralRe: Importing a Tab delimited report file Pin
Jack Fleet3-Aug-07 12:26
Jack Fleet3-Aug-07 12:26 
QuestionMySQL/ODBC Table will not Update from DataGrid [modified] Pin
][cecu3e2-Aug-07 6:52
][cecu3e2-Aug-07 6:52 
Questiondriver help Pin
boyindie2-Aug-07 4:56
boyindie2-Aug-07 4:56 
Questionreturning free numbers Pin
ArielR2-Aug-07 4:30
ArielR2-Aug-07 4:30 
AnswerRe: returning free numbers Pin
kubben2-Aug-07 7:22
kubben2-Aug-07 7:22 
AnswerRe: returning free numbers Pin
Michael Potter2-Aug-07 9:16
Michael Potter2-Aug-07 9:16 
Interesting Problem. Here is a solution to find the missing holes in your data. It will even find a leading hole if you know the expected start number. In this example the start number is set to ONE (t.[MyID] != 1 & the ISNULL result set to 0). This works with SQL Server 2000, there is more than likely an easier solution with SQL Server 2005.

Replace [MyId] with your id column name. Replace [MyTable] with your table name.
SELECT 
    ISNULL((SELECT MAX([MyID]) FROM [MyTable] WHERE [MyID] < t.[MyID]),0) + 1  AS FirstMissingNumber,
    t.[MyID] - 1 AS LastMissingNumber
FROM 
    [MyTable] t
WHERE 
    (t.[MyID] - 1) NOT IN (SELECT [MyID] FROM [MyTable]) AND
    t.[MyID] != 1

GeneralRe: returning free numbers Pin
ArielR2-Aug-07 13:06
ArielR2-Aug-07 13:06 
GeneralRe: returning free numbers Pin
Michael Potter3-Aug-07 10:13
Michael Potter3-Aug-07 10:13 
GeneralRe: returning free numbers Pin
DQNOK3-Aug-07 10:32
professionalDQNOK3-Aug-07 10:32 
GeneralRe: returning free numbers Pin
Michael Potter3-Aug-07 13:35
Michael Potter3-Aug-07 13:35 
QuestionSimple E-mail functionality Pin
Bonsta2-Aug-07 4:26
Bonsta2-Aug-07 4:26 
AnswerRe: Simple E-mail functionality Pin
Sunset Towers2-Aug-07 7:21
Sunset Towers2-Aug-07 7:21 
QuestionCounting the Records in a Database for a Insert Statement Pin
Sunset Towers2-Aug-07 3:25
Sunset Towers2-Aug-07 3:25 
AnswerRe: Counting the Records in a Database for a Insert Statement Pin
kubben2-Aug-07 3:29
kubben2-Aug-07 3:29 
GeneralRe: Counting the Records in a Database for a Insert Statement Pin
Sunset Towers2-Aug-07 3:37
Sunset Towers2-Aug-07 3:37 
GeneralRe: Counting the Records in a Database for a Insert Statement Pin
Sunset Towers2-Aug-07 5:10
Sunset Towers2-Aug-07 5:10 
GeneralRe: Counting the Records in a Database for a Insert Statement Pin
kubben2-Aug-07 5:22
kubben2-Aug-07 5:22 
GeneralRe: Counting the Records in a Database for a Insert Statement Pin
kubben2-Aug-07 5:43
kubben2-Aug-07 5:43 
GeneralRe: Counting the Records in a Database for a Insert Statement Pin
Sunset Towers2-Aug-07 6:01
Sunset Towers2-Aug-07 6:01 
GeneralRe: Counting the Records in a Database for a Insert Statement Pin
kubben2-Aug-07 6:29
kubben2-Aug-07 6:29 
GeneralRe: Counting the Records in a Database for a Insert Statement Pin
Sunset Towers2-Aug-07 7:18
Sunset Towers2-Aug-07 7:18 
GeneralRe: Counting the Records in a Database for a Insert Statement Pin
kubben2-Aug-07 7:20
kubben2-Aug-07 7:20 
GeneralRe: Counting the Records in a Database for a Insert Statement Pin
Sunset Towers2-Aug-07 7:22
Sunset Towers2-Aug-07 7:22 

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.