Viewing 15 posts - 241 through 255 (of 7,429 total)
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...
November 30, 2007 at 12:43 pm
Lynn Pettis (11/30/2007)
November 30, 2007 at 12:28 pm
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...
November 30, 2007 at 12:26 pm
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
,...
November 30, 2007 at 12:22 pm
I would look at batch and statment for transaction, all you are looking for is the backup stuff being executed. Also, looks for errors.
November 30, 2007 at 12:16 pm
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
,...
November 30, 2007 at 12:15 pm
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...
November 30, 2007 at 11:57 am
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...
November 30, 2007 at 11:55 am
jahanz2003 (11/30/2007)
November 30, 2007 at 10:18 am
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...
November 30, 2007 at 9:57 am
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...
November 30, 2007 at 9:51 am
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...
November 30, 2007 at 8:48 am
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
November 30, 2007 at 8:46 am
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...
November 30, 2007 at 8:42 am
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...
November 30, 2007 at 8:27 am
Viewing 15 posts - 241 through 255 (of 7,429 total)