Forum Replies Created

Viewing 15 posts - 10,096 through 10,110 (of 26,489 total)

  • RE: Retrieve records with (more than one row of same type)

    Evil Kraig F (8/14/2012)


    I personally usually just do them in a single build, like so:

    SELECT

    s.[databaseid]

    ,s.[databasename]

    ,s.[filename]

    ,s.[filetype]

    FROM

    #stuff AS s

    JOIN

    (SELECT DatabaseID FROM #stuff GROUP BY DatabaseID HAVING COUNT(*) > 1) AS drv

    ONs.DatabaseID =...

  • RE: Are the posted questions getting worse?

    L' Eomot Inversé (8/14/2012)


    Off to Sri Lanka tomorrow, to attend eldest son's wedding. The evil child has insisted I be kilted for the event, and I can no longer...

  • RE: Retrieve records with (more than one row of same type)

    Here is another query:

    CREATE TABLE #stuff (

    [databaseid]TINYINT,

    [databasename]VARCHAR(50) NOT NULL,

    [filename]VARCHAR(50) NOT NULL UNIQUE,

    [filetype]VARCHAR(50) NOT NULL

    )

    INSERT INTO #stuff VALUES (1, 'games', 'game.mdf', 'data')

    INSERT INTO #stuff VALUES (1, 'games', 'game.ldf', 'log')

    INSERT INTO #stuff...

  • RE: Calculate days

    Here is the updated code:

    CREATE TABLE dbo.PatientInfo (

    MEMBID CHAR(8),

    ADMDATE DATE,

    DSCHDATE DATE

    );

    go

    INSERT INTO dbo.PatientInfo

    VALUES ('06000248','08/02/2010','08/04/2010'),

    ('06000248','08/10/2010','08/12/2010'),

    ('06000248','08/20/2010','08/22/2010'),

    ('06000348','08/02/2011','08/04/2011'),

    ('06000348','08/10/2011','08/12/2011'),

    ...

  • RE: Calculate days

    adonetok (8/14/2012)


    Thank you. I almost get there.

    But, if I inserted more values, the duplicate result will displays.

    How to fix it?

    INSERT INTO dbo.PatientInfo

    VALUES ('06000248','08/02/2010','08/04/2010'),

    ('06000248','08/10/2010','08/12/2010'),

    ...

  • RE: Milk

    TravisDBA (8/14/2012)


    jay-h (8/14/2012)


    I'm a firm believer in 'if you can't explain it in plain English (or other), you don't understand it". While technical terminology may be necessary when addressing...

  • RE: Passing larger string in variable

    Luis Cazares (8/14/2012)


    I might have answered too quickly and missed some points.

    SQL Server doesn't manage arrays, just sets of data (tables or results from queries).

    SQL Server won't allow you to...

  • RE: Passing larger string in variable

    First, start with the following, and be sure to read the comments, the article referenced in the comments, and the discussion that follows the article.

    /****** Object: UserDefinedFunction [dbo].[DelimitedSplit8K] ...

  • RE: Calculate days

    Not difficult. One thing you need to do is to look carefully at my code below. You notice I am creating the table, populating it with sample data,...

  • RE: OVER PARTITION BY

    Yep, just need an ORDER BY on the select statement.

  • RE: OVER PARTITION BY

    asm1212 (8/14/2012)


    So here is what I want the finished result set to look like:

    invoice_id rank subscriberid create date ...

  • RE: corruption of writing log buffer

    Oracle_91 (8/14/2012)


    Hi All,

    What is this error ? any idea why do we see such kind of errors?

    LogWriter: Operating system error 170(The requested resource is in use.) encountered.

    Error: 17053, Severity:...

  • RE: Are the posted questions getting worse?

    I really, really, REALLY want to ask some of these people if they even know how to think.

  • RE: OVER PARTITION BY

    This?

    CREATE TABLE [dbo].[tst_Invoices](

    [invoice_id] [int] NULL,

    [grouo_id] [int] NULL,

    [subscriber_id] [int] NULL,

    [createdate] [datetime] NULL,

    [duedate] [datetime] NULL

    ) ON [PRIMARY]

    INSERT INTO dbo.tst_Invoices

    ( invoice_id ,

    grouo_id ,

    subscriber_id ,

    createdate...

  • RE: OVER PARTITION BY

    asm1212 (8/14/2012)


    I was wrong...That does not work for me...

    Try this code:

    CREATE TABLE [dbo].[tst_Invoices](

    [invoice_id] [int] NULL,

    [grouo_id] [int] NULL,

    [subscriber_id] [int] NULL,

    [createdate] [datetime] NULL,

    [duedate] [datetime] NULL

    ) ON [PRIMARY]

    INSERT INTO dbo.tst_Invoices

    ...

Viewing 15 posts - 10,096 through 10,110 (of 26,489 total)