Viewing 15 posts - 3,421 through 3,435 (of 7,191 total)
Adam
A SQL Agent job is intended to run unattended, so you can't pass parameters to it. You could create a table with date column(s) that contain the dates to...
August 15, 2014 at 9:51 am
There's all sorts of things. You're trying to use a stored procedure (OH_Message) as a function. You're trying to assign a value to a variable (@status) without a...
August 15, 2014 at 9:46 am
August 15, 2014 at 7:20 am
WITH Starts AS (
SELECT
CUSTOMERID
,TIER
,STARTDATE
,RECORDSTATUS
FROM
TEMPHISTORY
WHERE
RECORDSTATUS = 1
)
, Ends AS (
SELECT
CUSTOMERID
,TIER
,STARTDATE ENDDATE
,RECORDSTATUS
FROM
TEMPHISTORY
WHERE
RECORDSTATUS = 0
)
SELECT
s.CUSTOMERID
,s.TIER
,s.STARTDATE
,DATEADD(dd,-1,e.ENDDATE) ENDDATE
FROM
Starts s
LEFT JOIN
Ends e
ON
s.CUSTOMERID = e.CUSTOMERID AND s.TIER = e.TIER
AND
e.ENDDATE > s.STARTDATE
John
Edit: - this may not be the...
August 14, 2014 at 9:29 am
No, COPY_ONLY only breaks the differential "chain".
Managers and users shouldn't need to worry about warmth and fuzziness - that's why they pay you to administer their databases. Although if...
August 13, 2014 at 9:48 am
You could deny the application account whatever permission it needs to run backups, assuming that doesn't break anything else.
John
August 13, 2014 at 9:34 am
Use ROW_NUMBER() over that first column, and just select the one where the row number is 1.
John
August 12, 2014 at 8:19 am
What was that - sample data, expected results, or actual results?
Anway, if I understand correctly, your question is why the SELECT statement returns more than one row? The answer...
August 12, 2014 at 7:26 am
Chris
Please will you post the whole query, along with some sample data? What results do you get, and what results are you expecting?
Thanks
John
August 12, 2014 at 5:48 am
I can't see anything there that would obviously run differently under different settings. What I advise you to do is to capture each event with a trace, and capture...
August 12, 2014 at 5:14 am
There are some things you can check. Do any batch processes, backups or database maintenance run during the slow period? You can query your plan cache for the...
August 12, 2014 at 5:01 am
Be careful when you do this, because if someone has already compensated for the collation difference by putting COLLATE Latin1_General_CI_AS clauses throughout the code, then things may start breaking.
John
August 12, 2014 at 4:54 am
Andre 425568 (8/12/2014)
August 12, 2014 at 4:46 am
Yes, that'll work if you want to run it interactively. If you want to automate it, you'll need to centralise using SSIS or similar.
John
August 12, 2014 at 3:23 am
For SSMS, go to Tools -> Options -> Query Execution -> SQL Server -> Advanced. For SSIS, it depends on the properties of the network library you're using to connect...
August 12, 2014 at 2:43 am
Viewing 15 posts - 3,421 through 3,435 (of 7,191 total)