Viewing 15 posts - 6,991 through 7,005 (of 7,631 total)
You are probably going to have to use OPENQUERY or OPENROWSET for this.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 2, 2008 at 5:25 pm
Well the version of Matt's that you have actually seems to be comparing two queries: a static version (first half), vs. a Dynamic SQL version (second half) so it's really...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 2, 2008 at 3:07 pm
Matt: this is what I posted:
Create Proc spTableRows_Window(@startingRow int, @rows int)
AS
--NOTE: some stuff stolen from Jeff Moden and Matt Miller
Select * From ExampleTable
Where LookupCol IN(
...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 2, 2008 at 2:06 pm
If this is being run from an Agent Job, then I believe that each step is wrapped in its own transaction. You would have to use your own Explicit...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 2, 2008 at 1:43 pm
Less code too.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 2, 2008 at 1:27 pm
And how can we tell the difference between debits, credits and payments?
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 2, 2008 at 1:11 pm
Here is a version that gets all of the bonuses:
SELECT customerid, count (Distinct surname) AS count1
FROM tblcustomeraudit nolock
Where audituser is NULL-- bonus 3 (?)
GROUP BY customerid
Having...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 2, 2008 at 12:11 pm
Oops, I just noticed... my first one may not work on SQL 2000. Second one should be fine though.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 2, 2008 at 11:53 am
Etiher one of these should work:
SELECT customerid, count (Distinct surname) AS count1
FROM tblcustomeraudit nolock
GROUP BY customerid
Having count (Distinct surname) > 1
And count (Distinct forname) >...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 2, 2008 at 11:52 am
Jeff Moden (4/30/2008)
See the following URL... almost identical situation...http://www.sqlservercentral.com/Forums/Topic491969-149-1.aspx#bm492576
Jeff:
FYI, the "Post #" links like this do not seem to be working, they just take to the beginning of...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 2, 2008 at 10:32 am
matt6749 (5/2/2008)
However, I don't understand what @skip = 90000 is. Do I need this - can you help?
It's the number of rows to skip over and should normally...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 2, 2008 at 10:15 am
Try the following query:
[font="Courier New"]select tr.policy_expiration_date_key,ex.cal_date
from
tr
inner join
..datedim ex
on ex.date_key = tr.policy_expiration_date_key
where transaction_audit_key = 178
AND (EX.Cal_Date < Cast('1900-01-01' as datetime) OR EX.Cal_Date > Cast('2079-01-01' as datetime))
order...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 2, 2008 at 9:47 am
Post the trigger code.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 2, 2008 at 6:00 am
Yes, delete them all in one SQL statement instead of deleting one row per statement.
Unlike Oracle, SQL triggers fire per statement, and not per-row.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 1, 2008 at 10:21 pm
This is a SQL 2005 forum. There are SQL 2000 forums on this site also.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
May 1, 2008 at 9:59 pm
Viewing 15 posts - 6,991 through 7,005 (of 7,631 total)