« first day (2015 days earlier)      last day (2303 days later) » 
05:00 - 11:0011:00 - 18:00

11:00 AM
looking to do more soon
hold on
here's an old broken one, but it's basically the same thing
 
awesome
yeah looks good!
that get-date cmdlet - it took me aaages to get it to spit out just the month name
 
@Ricky cheers man
@Ricky tell me about it!
 
for ages I could only get it to say the number
 
I spent 10 minutes yesterday trying to figure out reverting back to midnight
 
trying to get it to createa new folder to move backups about
 
11:05 AM
realised I could just do (Get-Date).Date
 
haha :-D
$date = get-date
$date = $Date.ToString("MMMM")
that gives you just the month if you ever need it
 
@Ricky thanks man, I'll use that no worries
 
porridge and coffee time...
 
insiste on coffee
 
@Sami is right, coffee is needed
 
11:21 AM
proper filtered coffee is my favourite
don't really like all the fancy latte and frappachino stuff
 
went into a meeting, 102 messages fml
@Sami ive been in SOCVR a few times
 
11:37 AM
I know this has pretty much nothing to do with SQL, but I FINALLY F*CKING FINISHED THE GOD DAMN GPS BINARY FILE AND ITS GOD DAMN RETARDED ARRAY OF INLINE PRECALCULATED GOD DAMN CRAPPY POINTERS SH*T! Jesus I vented like I ate 2Kg of beans in one bite.
 
@HéctorÁlvarez take a page out of @AndyK's book and go for a walk
 
Oh no no, I'm not burnt
or pissed
 
you seem stressed
 
I had estimated 150 hours on this task, and guess what I have spent exactly 149.5 hours
and I knew the task was going to be tiresome
 
at least its on time :D
 
11:41 AM
If I keep getting assigned shit like this often, I'll be pissed, but right now I feel like I just finished watching an episode of Electric dreams
 
@HéctorÁlvarez congrats at least
 
Thank you @Shaneis
@WhatsThePoint I'm usually less than a day off in previsions even if it's like 500 hours, including first-instance V&V and assuming I don't pull some hacks to fix problems
but this one was glorious, half an hour positive :O
 
yeah under time is always great
 
Calm down on the vocab :p
 
i finished a project two weeks early a few months ago, with some new requirements added at a very late stage, (got them done in 2 days)
 
11:47 AM
@Shaneis How to format the query in ssms 17.3?
 
@Sami Don't think ssms has a built in formatter
Operations studio does
otherwise you need an external formatter
 
:(
 
like SQL Prompt or Poor Man's Formatter
 
free?
 
11:49 AM
Please can somone help out here
https://stackoverflow.com/questions/47454844/sql-group-concat-and-left-join-return-only-one-result-from-database
 
@Sami you have to download DBeaver or SQuirreL
and only use SSMS for the built-in features
 
use that link i sent you
 
@PhilipJems I provided an answer, I don't see clearly what you want to achieve, although I assume what I wrote as the answer fits what you need. Cheers!
let me know if you still don't get the result you need :)
do you need those WHERE conditions?
 
12:25 PM
@HéctorÁlvarez can you help me add a union select on that query?
 
12:41 PM
@PhilipJems sure, what do you need?
first of all, give me the scripts for those 3 tables please
 
philip are you familiar with what union does? cause union is imo very very easy ( I am also new to sql ) and it would be great if you knew what was being done for you instead of hector doing it for you
 
@Tomm yes i do understand it, i used union in my old sql query now i have changed i am trying to add union but is giving me errors
 
what are the errors
 
@HéctorÁlvarez let me add another table that i want to union then i will post it for you to answer
 
1:04 PM
most usecases union isnt required but its great for the odd occasions its needed
 
@WhatsThePoint In my experience, 90% of those cases are 2 tables referring to the same object in 2 different states, need to be added up because they were actually one single object, but at design time they thought 5 minutes were enough to draw a decent model and now... consequences
e.g. put a table named car and another one called truck and then realize they were both a single vehicle table, but it's impossible to undo the mess, so you master the art of union all
 
@HéctorÁlvarez i used a union two return data from from 2 tables as they were both similar, say i had table A, table B was a history table for each row of table A and if the data for a row in A had never been updated it didnt exist in table B
 
@WhatsThePoint oh right, the ideal way would be either auditing the table through SQL Server's own auditing features, use a framework like Embers, or actually keep ALL the rows in the history table, including the current ones because, you know, the present is still part of the history
 
and there were a few extra columns on table B, so couldnt do a standard join as it wouldnt retrieve any data that was in A but not in B
 
but oh well, I'm still here dealing with a 1-N relationship that magically turned into a new entity, because someone was retarded and didn't know how to do that properly
 
1:13 PM
thats just part of the job :D
 
Indeed
fix those pieces of shit and people look at you in awe
a couple of months ago I was asked how to speed up queries, so we ran through a series of things
so I picked one of the "faster" ones that took 2 seconds
 
exactly make yourself look better than you are
 
they told me "but that's fast, you can't make it much faster"
perform some tricks, reticulate splines, calculate moebius layer bounds... boom, down to 0 seconds
silence for 5 straight seconds, I felt weird
 
what was it before?
 
2 seconds
they expected those 2 seconds were the bare minimum
 
1:16 PM
2 secs is slow for sql
 
that 0.03 seconds were impossible
indeed
 
what query was it? select, DDL or DML?
 
@HéctorÁlvarez rant. it is the place for ranting
 
@AndyK I wouldn't get it done by today if I started
 
@Tomm no worries mate
 
1:21 PM
3 months after agreeing on a checklist policy, i.e. the project manager must elaborate a checklist (because he's the only one who knows the full system), the developer runs test cases on the code they released, send that to Jenkins, validation personnel run the checklist, once validated you many release and deploy the new version... well, there are no checklists for over 15 projects I've touched
(apparently someone thinks it's a good idea to assign a single person to that many projects, what a twat) and I'm tasked with elaborating those checklists. Bitch, I barely know how MY changes to ONE SUBSYSTEM works, how am I suppose to do that!?
The best part is "We need it by friday"
GL
 
@HéctorÁlvarez this one of the aim of the chat, to allow you to vent
 
Thank you guys :)
I'll go have lunch now
before I omae wa mo shindeiru someone
@PhilipJems I'll try to answer your problem afterwards, if you manage to get your scripts together
 
@HéctorÁlvarez here is my question stackoverflow.com/questions/47456771/…
 
 
1 hour later…
2:32 PM
@HéctorÁlvarez please see demo here sqlfiddle.com/#!9/e7ce30/5
 
I'm back
 
@HéctorÁlvarez welcome please take a look at my working demo
 
so your expected result should be as described on the question, shouldn't it?
@PhilipJems please format accordingly
 
@HéctorÁlvarez okay i will update you soon
 
Your question was closed, because you asked the same thing twice
I'll add the answer to your first question
 
2:55 PM
@HéctorÁlvarez Some people don't have a clue. Some of these people have no business working in IT
Especially so called project managers
 
abr
Question, One can create a View from 2 tables. Is it possible to create a View from 2 Views?
if so, is it a legit thing to do if required or 'bad planning'?
 
I think you can do it - its just a bit messy
 
@abr Why not just make another view? It's going to slow you down big time if you have to query 3 times every time you need one data set
Rather than bad planning, I think the problem is you guys haven't stopped to think for a while how much data you might need, instead you create views as soon as the need arises
 
abr
What I'm planning is, a user has one or more roles, which has certain ammount of permissions. however, I want a specific user to have a certain permission that no other role has for example
let's ignore the action table for now
Let's say in practice, I want to view if a certain user has access. Should I have a view to relate this or somehow I can work it out with a Union or something? I'm quite green at designing database structures
 
3:21 PM
you know you're bored in work when you're playing battleships via facebook messenger with your colleague sat next to each you xD
 
@abr you are the guy who wanted to implement his own version of roles to users, but was actually trying to reinvent MS SQL permissions and roles?
or was that a different one
 
abr
@HéctorÁlvarez same guy, I've read the post you've left about the ms sql permissions but I didn't find practical to what I'm looking for, as it would create as many roles/users on a database layer as there are in the users table, I don't believe it would be practical, or I should I re-think it?
For example, I want to have a user called admin, with role admin, that can create roles, for example, it works as it is
Then I'd want, for example, a user called PP with X role that can't do such things (so far so good). But I want this specific user PP to be able to create roles
 
I don't think we are talking about the same thing
 
abr
My question in the end is, whenever he enters a page related to roles, for example, how should I query to see if he has indeed permissions or not
 
short-circuit check for permission denied, granted, revoked, group permission denied,granted,revoked
that is, if hh's been denied access, but his group has access, then he can't have access. If it has been revoked (i.e. he still doesn't have access, but it's not denied) and his group can access, he can access then, inherited by group
 
abr
3:35 PM
just to clarify, we're talking about users in sql, not records in the table users correct?
 
if his permission level is equivalent to MS SQL's ` WITH GRANT ` he can access that resource, and can grant other users that permission. In this case a WITH GRANT ROLE_SETTINGS would give him access to role settings, plus he can give other users permission to set roles up and manage them
@abr yes, that's for users
here's another article on permissions that might give you a deeper insight into this
 
@HéctorÁlvarez from the sample demo here sqlfiddle.com/#!9/bac3d8/1/0 you can copy the schema to create an answer for me. The demo is working but it only return one result
 
abr
I'm talking about a user (a record in table users) has permission to something according to his record role or record user_permission exception. Should a record user be related to a user in sql?
I was a bit confused but now I understand what you're trying to reach, don't know if I expressed myself as I wanted, it's not such deep of access inside sql but more of a regular query working against a regular table
 
4:22 PM
@PhilipJems I believe I already copied the answer
maybe I copied the wrong URL?
it was showing 6 results
I did and it worked
 
@HéctorÁlvarez please am almost close to it but something is still missing just take a look at this DEMO sqlfiddle.com/#!9/894922/12 it returned all result but excpt the post with image it only showed one record
 
@abr I'm not telling you to access a SQL server user list, I'm telling you that user-role security already exists, and what you are describing is exactly how SQL Server handles logins. Users are stored in the database in tables, just like you should do.
run this on your SQL Server instance and see what happens
select * from sys.syslogins
sys.syslogins is still a table inside your database
@PhilipJems the fiddle I gave you already gives you all 6 results
 
@HéctorÁlvarez please is possible i missed the message where you past the fiddle can you resend it back?
 
You want me to scroll up for you? You sure are lazy lol
 
@HéctorÁlvarez sorry i found it thank you is working
 
4:46 PM
May I add, I also added that fiddle to your first question about this. I can guess you didn't even check, always glad to help
I'm out for today, have a nice day guys
 
5:29 PM
see ya
 
05:00 - 11:0011:00 - 18:00

« first day (2015 days earlier)      last day (2303 days later) »