select
round(
(cast(current_timestamp as date) - cast(<other_timestamp> as date))
* 24 * 60
) as diff_minutes
from <some_table>;
This is what I used to calculate the difference between the current timestamp and a heart beat table entry for latency monitoring.
I tested at sql-fiddle and casting to date does not cut off the time part (as I thought first).
So, it seems to be a valid way to solve the issue.
I will short my question. (SQL-Server 2008)
Is it a good idea , when crating a new table, to create an index for each column?
Why i'm saying this?
Today I was creating a database, and my boss was behind me, and he said:
"Oh, it's good to create an index, for every column" (and then he showed...
good grief, every time I look into our old pages and how they interact with the DB I get a few more gray hairs
I saw a stored proc I hadn't looked at before as the victim of a deadlock last night so I am digging into it
This procedure hits like 3 heavy transactional tables, several lookup tables that are still heavily hit, and uses several scalar udfs on some of its 30ish columns to do things like convert timezones and whatnot
I look into the web code and the ONLY thing we need from this procedure is a single Id
so like half the joined tables are completely unnecessary
What's your answer, even better what's the question? Right now this isn't really a question and more like a "do my homework for me" request. — bluefeet30 secs ago
Ok, I need to bitch about the disappointment that is the new power bi and I think you guys will understand... First they finally made the SSAS connector so we can talk to on-prem tabular models. This is great, but this first version, it keeps the permissions of the user who creates the data viz. So all of the permissions you build into the cube are worthless.
Then they publish how they are making it work. You have to connect the Power BI SSAS connector using a Windows account that has SSAS (instance) admin access. And it's actually storing your password, so when it expires you have to go in and update it. Then when a user connects it's just using effectiveusername in the connection string.
I get that we are supposed to be excited to get access to on prem data sources like this, but seriously? What company would use this?
I guess this is the new version of setting up PerformancePoint to use per user security through Kerberos. There was always a fight with the DBA because it required 5 services accounts and some of those needed admin access.
but at least that ended up actually using the permissions you set in the cube. This one just bypasses them.
Always hate fighting with security people about service accounts :/ Had a pre-packaged app that required the DBA role for its service account. Was no way around it, unless we paid for software certification (ie: pay them to re-test and fix anything that broke). Right pain in the arse
@swasheck Yes. The main claim to fame of cubes is that you can embed complex business logic in them. For example, you can embed context-sensitive F/X rate conversions (e.g. P/L and Balance sheet accounts using different F/X rates), running sum calculations, recursive queries to find the 'last' item of interest to measure times, 'percent of total' computations that skip around contexts, 'top n' sets with an automated 'and the rest' grouping and much, much more...
my question is some kind of extension to Erwin Brandstätter's excellent answer in this thread on the correct use of WITH.
My old query looks like this:
WITH x AS (
INSERT INTO d (dm_id)
SELECT dm_id
FROM dm, import
WHERE dm.dm_name = i.dm_name
RETURNING d_id
), y AS (
I...
i am lecturing some class, and now i decided to skip stored procedure and trigger curriculum because i know when some people word as programmer , stored procedure and trigger is not barely used, because its much better for programmer to put the SQL inside a program rather than put it as stored procedure or trigger, am i right?
What happens if one of your queries generated in the application starts behaving badly? As a DBA, i cant access the code directly as your app is generating it. That means YOU get a call at 2am to fix, recompile and redploy your app
@hilmanshini No. A good DBA is paying attention to several databases, large and small, to make sure the environment is running well and has room to grow, in addition to helping deploy code to environments.
seriously though, you seem to have a lot of misunderstandings about databases and SQL ("stored procedures are barely used", "better to use plain SQL", etc), that points to you really needing a DBA
i am lecturing some class, and now i decided to skip stored procedure and trigger curriculum because i know when some people word as programmer , stored procedure and trigger is not barely used, because its much better for programmer to put the SQL inside a program rather than put it as stored procedure or trigger, am i right?
yeah last project i cover is to make a CSV published and client want to publish based on date, saturday only , monday only , mon to sat, and also sat only and it has 4 sub categories , monthly, average, total, and each data, and it has categorized again with normal and big car
you realize you've wasted at least $30 of your time in this chat room asking us non-specific unanswerable questions that the book would address, right?
Part one:
Convert the object model found below to a set of normalized relations.
Rules:Individuals can share phone numbers.
Part Two:
Normalize the relation found on the document under Part Two.
1
We are developing a DW using SSIS. We are 4 people who are developer for SSIS code. Even though we have a seperate package for every table. We are still not able to work on same project solution. I thought until we are not working on same package we should be good. Can someone tell me whether it'...