Forum Replies Created

Viewing 15 posts - 241 through 255 (of 7,429 total)

  • RE: Alternative for a cursor

    Unfortunately becuase of the variation of number of databases you may have a cursor will have to be used (but sp_MSForEachDB will do the trick)

    As for how to join to...

  • RE: Is it possible to join the result set of a stored proc with a table?

    Lynn Pettis (11/30/2007)


    Not directly, as SL Server does not allow you to use a stored procedure like a table. You will need to load the output of the stored...

  • RE: multiple nested select statments in 1 query

    Last one I think not knowing more about your design, but sometimes moving things from the where to the ON for an inner join can improve performance, so here is...

  • RE: multiple nested select statments in 1 query

    OK this might work a hair better and reduces code a bit

    SELECT DISTINCT

    Accounts.UID

    , Accounts.Fname + ' ' + Accounts.MI AS Fname

    , Accounts.Lname

    , Accounts.Addr

    , Accounts.Addr2

    , Accounts.City

    , Accounts.State

    , Accounts.Zip

    , Accounts.Phone

    , Accounts.DayPhone

    ,...

  • RE: job succeeded but maitenance plan not executed

    I would look at batch and statment for transaction, all you are looking for is the backup stuff being executed. Also, looks for errors.

  • RE: multiple nested select statments in 1 query

    This might work better if I understood the breakdown correctly, however might have a hair more room for improvement.

    SELECT DISTINCT

    Accounts.UID

    , Accounts.Fname + ' ' + Accounts.MI AS Fname

    , Accounts.Lname

    ,...

  • RE: Alternative for a cursor

    You say all servers did you mean databases?

    If so the present solution is still a cursor but may simplify for your needs. Otherwise I need to know what you are...

  • RE: job succeeded but maitenance plan not executed

    Was the job created by the maintenance plan and have you checked what the plan is doing in each step (I sometimes run it and watch in profiler)? But in...

  • RE: What DB are maped to what login?

    jahanz2003 (11/30/2007)


    I believe logins can be mapped to the DB, but, it is the DB / security / users that has the user mapping / securables. At that point you...

  • RE: A Welcome Delay

    Experience with RedHat, Abit, Madrake, Corel, and a couple of others I can't recall, some are more user friendly and some are a pain (RedHat 9 took 3 hours to...

  • RE: What DB are maped to what login?

    Don't have SQL 2K5 on hand or the BOL but in 200 you could do this

    SELECT

    SU.[Name],

    SL.[Name]

    FROM

    dbo.sysusers SU

    INNER JOIN

    master.dbo.syslogins SL

    ON

    SU.Sid = SL.SID

    might be sys.user and sys.logins but you will need to...

  • RE: How can I modify/add to this join statement

    Sorry had a typo and the edit feature never seems to work for me here.

    SELECT

    X.*,

    INVA.invoice_no

    FROM

    dbo.p21_view_invoice_hdr INVA

    INNER JOIN

    (

    SELECT

    CS.customer_id,

    CS.customer_name,

    CS.DATE_ACCT_OPENED,

    MAX(INVOICE_DATE) INVOICE_DATE

    FROM

    dbo.p21_view_customer CS

    INNER JOIN

    dbo.p21_view_invoice_hdr INV

    ON

    INV.customer_id = CS.customer_id

    WHERE

    CS.delete_flag = 'N'

    GROUP BY...

  • RE: How can I modify/add to this join statement

    OK then this might do the trick.

    SELECT

    X.*,

    INVA.invoice_no

    FROM

    dbo.p21_view_invoice_hdr INVA

    INNER JOIN

    (

    SELECT

    CS.customer_id,

    CS.customer_name,

    CS.DATE_ACCT_OPENED,

    ,MAX(INVOICE_DATE) INVOICE_DATE

    FROM

    dbo.p21_view_customer CS

    INNER JOIN

    dbo.p21_view_invoice_hdr INV

    ON

    INV.customer_id = CS.customer_id

    WHERE

    CS.delete_flag = 'N'

    GROUP BY

    CS.customer_id,

    CS.customer_name,

    CS.DATE_ACCT_OPENED

    ) X

    ON

    X.customer_id = INVA.customer_id AND

    X.INVOICE_DATE = INVA.INVOICE_DATE

  • RE: A Welcome Delay

    I generally don't address and place in draft for some time an email especially if it is something I am passionate about so I have time to reread it. Occasionally...

  • RE: How can I modify/add to this join statement

    Sorry just occurred to me you don't need to have the HAVIN clause if you use an INNER JOIN as that is the net affect of the inner join is...

Viewing 15 posts - 241 through 255 (of 7,429 total)