Viewing 15 posts - 1,411 through 1,425 (of 7,187 total)
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
If it's a simple data load then SSIS is probably overkill anyway. The Import/Export Wizard is good for one-off loads (and you can save it as well, but then we're...
June 14, 2017 at 4:11 am
In a relational database, you model many-to-many relationships with junction tables, each one with a foreign key relationship to each of the tables it joins.
-- Main...
June 14, 2017 at 4:01 am
Yes please, and expected results based on the sample data that you post. Seriously, though, if it's that urgent, you ought to pay for someone to come in and help...
June 14, 2017 at 2:22 am
Depends whether you're interested in how long a single execution of a query takes, or in its total load on the processor over time. What's worse, the report that takes...
June 13, 2017 at 7:26 am
Viewing 15 posts - 1,411 through 1,425 (of 7,187 total)