Viewing 15 posts - 1,411 through 1,425 (of 7,191 total)
Albert
There are several different settings that can very depending on which user runs the query, or what provider you use to connect to the database and hence what's...
June 19, 2017 at 2:19 am
WITH NowandNext AS (
SELECT
H_SystemCustomer_Seq_ID
, RateDate
, Grade
, LAG(RateDate) OVER (ORDER BY RateDate) AS OldDate
, LAG(Grade) OVER (ORDER BY RateDate)...
June 16, 2017 at 9:31 am
Just because, really. You can't restore master unless you're in single user mode. That's how the product works. Probably is something to do with master always being in use, though.
June 16, 2017 at 5:14 am
Vivek
Restoring the master database is one.
John
June 16, 2017 at 4:23 am
It's not the user that's running the job in whose context the commands run. If the user is a sysadmin, it'll run in the context of the SQL Server Agent...
June 15, 2017 at 10:00 am
No DDL, sample data or expected results, so this is just a guess.
WITH ActiveInactive AS (
SELECT
CASE E.active
WHEN 'no' THEN 'inv'
WHEN 'yes' THEN...
June 15, 2017 at 8:21 am
WITH DateDiffs AS (
SELECT *, DENSE_RANK() OVER ORDER BY(ABS(DATEDIFF(day,TargetDate,CompletedDate))) AS RowNo
FROM Mytable
)
SELECT * FROM DateDiffs
WHERE RowNo =...
June 15, 2017 at 8:10 am
From, memory, this, so look up the syntax yourself if it's not quite correct. Change n for the length of your string, and remove the NOT if your column is...
June 15, 2017 at 7:39 am
Vivek
The main problem is that the Local System account is an admin on the server, which means that SQL Server will, in effect, have access to the whole...
June 15, 2017 at 4:33 am
June 15, 2017 at 2:14 am
Jason
Yes, with AND constraints, the task will only execute if all precedents were successful. But do test it for yourself by engineering one of them to fail!
June 14, 2017 at 9:19 am
Redundancy is indeed not ideal. Not only does it take up more space on disk, but it also doesn't stop someone from adding a row to the ParentWarehouse table with...
June 14, 2017 at 8:31 am
WarehouseStock is the wrong place for it, since it breaks one of the rules of normalisation by introducing redundancy. If you know that WH01 is the parent of SC02, you...
June 14, 2017 at 7:22 am
Yikes! Now we're into hierarchies, which makes things a whole lot more complicated. Let me have a think. There may not be an easy way to do this. I think...
June 14, 2017 at 5:57 am
I'm not sure I understand the business logic behind that requirement. Would the 50 pears be stashed in somebody's spare room? Possibly the best way to model this is to...
June 14, 2017 at 5:31 am
Viewing 15 posts - 1,411 through 1,425 (of 7,191 total)