« first day (1094 days earlier)      last day (3775 days later) » 
06:00 - 21:0021:00 - 00:00

6:16 AM
Is there a way to iterate through all mysql.users and show grants as one statement using JOIN?
 
@DwightSpencer Is it "one statement using JOIN" or "show grants ... using JOIN" or "iterate ... using JOIN"?
 
not sure, I'm only familar with simple sql statements so any help here would be apprecated
 
6:44 AM
@DwightSpencer Would something like SHOW GRANTS FOR '%'@'%'; work for you?
 
idk, does it show all the user's grants?
 
@DwightSpencer All I know is that when I tried it at sqlfiddle.com, it complained about access to the mysql database, not about syntax. I don't have a MySQL instance handy to verify whether it actually works.
 
2
Q: mysql: Show GRANTs for all users

Adam MatanMySQL's SHOW GRANTS shows the permissions of the current user. Is there a way to log in as root and show the permissions of all users?

 
@andriy-m looks like their db user that's on the web app doesn't have grant privs but from what I know of mysql it would be looking for an anonymous-equis user
@SimonRigharts Thanks, thought that's not much different from the script I posted on pastebin and I'm looking to do this in pure sql
 
7:16 AM
@MaxVernon I dunno either. On one hand sure if you're just regurgitating what a comment said word-for-word then yeah that's not a good answer. This answer though adds a bit more context than the comment and if there wasn't a comment there I'd say it was a decent answer. PS: To recant something means "take it back" (esp. a belief), so you're probably looking for recount or regurgitate or something :)
@DwightSpencer You could try INFORMATION_SCHEMA then - but I don't know if that'll give you all users or just the current one again (and you'll need some joins to cope with the fact that privileges are stored in three tables)
 
gbn
8:14 AM
Morning all
 
9:13 AM
morning and Happy New Year!
 
 
6 hours later…
Kin
2:58 PM
Greetings All
 
ahoy
 
hi there
 
Anyone know of a way on Window Server 2003 to trace applications that are using or calling the .NET SqlClient?
 
shot in the dark here, but what if you use procmon and filter it to something that is the sqlclient?
 
@billinkc I had thought about that one but this is a process that I don't know when it will run next.
 
3:10 PM
Rename the folder and watch for error messages ;)
 
gbn
@ShawnMelton Do you know what SQL Server these will be connecting to?
 
@billinkc I don't know what application is calling it, or where it is. All I know is what I happened to capture on a trace.
 
order by 4 - yuck
 
@gbn Yes I happened to verify the source and the application name is ".NET SqlClient Data Provider".
 
0
A: (ROW_NUMBER) ORDER BY, not indexing correct column

Shoaib ShaikhTry SELECT COL_A, COL_B, COL_C, ROW_NUMBER() OVER(ORDER BY COL_C) ROW FROM A_TABLE order by 4 asc

 
gbn
3:14 PM
so you want to trace which app is using it
not which machine?
 
@gbn Yeah
 
gbn
well, I suggets trying Process Monitor technet.microsoft.com/en-gb/sysinternals/bb896645
 
@ShawnMelton would client process id in the sql trace give that?
 
gbn
this should show which processes are using the DLL
@EdwardDortland good idea
 
@EdwardDortland The process does not stay active long enough for me to pull the process id
 
3:19 PM
I can give you some queries to slow your server down...
 
@billinkc Ha, this is a SQL 2000 instance so I am sure anything will slow this down
 
You poor man. My 2014 resolution for you is a fireman's axe to the box and all installation media
 
The process puts a timestamp in the table to show when it last imported, based on those I thought I had the "schedule" but it stopped running on 12/30 8:20 and did not run again until 12/31 6:20 PM. I don't know what made it run or why it stopped. Previously it looked like it ran every hour.
@billinkc it's....a....virtual....machine :/
 
Probably some gawdawful DTS package that monitors someone inbox to kick off an import once a file's received
 
@billinkc I do have some of those from the previous vendor that supported it, put a password on them and didn't leave it
 
3:30 PM
@ShawnMelton try running netstat -n -v -b 5 > c:\temp\network.log for a while
 
son of a biscuit it is running right now
 
well, better start then. :-)
 
Got process mon open
Ah COM'ON, it shows it runs as my account. All I did was logon to the server. The process on the server that is.
 
dopplegangers. Every gdamn time you turn around, they're mucking about in your system
 
does the process name show up as nsa.exe?
2
 
3:38 PM
Are my suggestion/comments totally wrong here?
@MichaelD I agree. This is one of the situations which I'd expect to fall in the "almost" case. And I don't mean that UNION is 100% the best approach here. But any way that can force the optimizer to use the 2 indexes might yield a more efficient plan. — ypercube 4 hours ago
The query has basically a condition similar to: WHERE (col1=@X OR col2=@Y)
 
500 line CTE from coworkers that works. Oh wait, no there's something wrong in there and I can't find what's broken. fix plz
One of the dates is off but I can't tell you which one. Did I mention I recalculate the dates in each derived table?
I need something stronger than tea this morning
 
3:51 PM
pls vtc
0
Q: ORA-03291: Invalid truncate option - missing STORAGE keyword

santhoshai have to execute two statements in a sequence. My Statement is as below. I get the above error when i run this. TRUNCATE TABLE MANUAL_LIST_BACKUP INSERT INTO MANUAL_LIST_BACKUP AS SELECT * FROM MANUAL_TRANSACTIONS

 
4:12 PM
Can't wait until next week when I get rid of AT&T DSL, finally getting cable broadband...moving up in the world one step at a time.
 
@ShawnMelton Be weary I have yet to deal witha broadband company that wasn't a complete nightmare. Local municipalities have driven all competition out of that market so they have no reason to be decent to you.
 
geez I haven't even heard the term DSL in a few years.
We have FiOS, love it - if it's available in your neighborhood I highly recommend it.
 
@AaronBertrand I'm in the far South ain't much of anything available around here.
@Zane I would love to get broadband through the other company in the area but they don't have contract to provide service to the community I live in.
 
@ShawnMelton Lol yup that's exactly what I mean.
@AaronBertrand MSP has a contract with Comcast.
 
@Zane so in MSP you can't get Internet service from anyone else?
Monopolies should not exist in 2014
 
4:19 PM
@Zane I have to deal with Charter service for now, which came close a few years back of loosing the contract with the City to provide service...would have pretty much put them out of business. I was so disappointed when it was resolved at the last minute
 
The Vast majority of the state of Minnesota(at least the populated areas) have to use Comcast.
 
@AaronBertrand Wow, it actually shows available on Verizon's site for my zip code.
 
@AaronBertrand The way out work out here is they sign a contract to build the lines with the state and pay an "exclusivity fee" to gain an artificial monopoly.
 
I don't have FioS service available here in Denver either.
I don't know if there's a contract with the city or not, but I have Comcast as well. It's not bad, fairly reliable.
 
@MikeFal The worst thing about comcast is trying to get a straight answer out of them.
 
4:24 PM
@Zane Yes. I like Comcast as long as I don't have to talk with their awful customer service. That being said, most large companies have awful customer service.
 
I recall when I had broadband in another city I lived in, called support because I was not getting speed I paid for...the help desk tech told me it was because I had Windows XP SP2 running.
 
The simple question of can I get ESPN web or whatever it's called without having a Television package was impossible to get an answer.
@MikeFal I always just say I work in IT skip to the last page on your script where you send out a technician.
 
Apparently my hood is going to be in the March 2014 rollout of google fiber. What that actually means, I have no idea. I suspect it's just you can sign up and wait a year for us to actually wire you up but I can hope
 
@billinkc That's looking than MSP's date of TBD maybe...
@billinkc I have to imagine other companies are going to start pushing cable companies into faster internet.
 
4:43 PM
Or they'll push politicians into legislating the faster ones out of business
 
@billinkc lol probably
@billinkc I mean Companies like Microsoft, Sony, Netflix, and anyone else who's business requires their customer to have fat pipes.
Valve.
If companies want people to accept digital distribution they are going to need a game to download in less than 20 hours.
 
do we want to kick this to SO?
0
Q: Difficult sellect from DB

nazar_artThe database scheme consists of four tables: Product(maker, model, type) PC(code, model, speed, ram, hd, cd, price) Laptop(code, model, speed, ram, hd, screen, price) Printer(code, model, color, type, price) The table "Product" includes information about the maker, model number, and type ...

not sure why it was vtc as a shopping question
 
@bluefeet I edited the title.
 
@bluefeet Yeah. It's homework, from the russian site with SQL stuff.
 
4:59 PM
Do people on math.stackexchange.com have to deal with this sort of thing as often as we do? — Zane 10 secs ago
 
@ypercube I just did a test. Adding the two compound indexes gives be an nice execution plan with a merge join operator, combining the two indexes and then a nested loop and a book mark lookup since the indexes are not covering. So need to rewrite the query with a union to mitigate the OR. However, if I do rewrite to use a UNION I get a hidious plan where each compound index is used with a nested loop operator doing a bookmark lookup and at the end a sort, for the union..
@ypercube so need = so NO need
 
@EdwardDortland thanks for the correction TF1117 vs. 1118. it was late and i was obviously not able to comprehend the differences
 
@Zane I was between editing your edit to either "difficult query" or "simple query"
 
@Zane my approach is a bit different :)
Did you try writing this difficult query? It would be extremely helpful if you edited your question showing any/all attempts you made at solving this. — bluefeet 1 min ago
who is voting to close that as a shopping question?
 
I just noticed we don't have a "must demonstrate a minimal understanding" reason
2
 
5:06 PM
@swasheck, no problem. I'm wondering though, everybody in that Q seems to agree that t1118 will solve the problem. However, I believe that t1118 will only solve SGAM contention and not PFS contention... Wondering if I should open my own question on that.
 
@EdwardDortland Ah thnx for the time you spent on this. How big is the table? (i.e. do you notice different plans as the table grows?)
 
I tried with 10k 100k and 500k. Plans stay the same. However, I have no idea about the selectifity of the actual data. I created the test table with 50 distinct resellers, and 1000 distinct SKU and 1000 distinct Modelnumbers.
 
Hi Experts, I'm having a problem with my SSIS package file, I posted my question over 2 days ago, hoping anyone can help me please:
0
Q: SQL server agent job built on SSIS package not working

Shayma AhmadI transferred a job from the old SQL Server 2005 to an upgraded SQL Server 2008R2 instance, and I scripted out everything, changed the data source and other details... "This job should copy some files automatically from stage locations to active directories" but its not doing that like it was in ...

 
@bluefeet He's shopping for a tutor :)
@AaronBertrand If only we had some Moderator who could correct that problem :)
 
> "Shopping list question - questions about which tool, library, product or resource you should use are off-topic here because they quickly become obsolete and often are just about the preferences of the answerer. If you have an issue with or a question about a specific tool, please revise your question to conform to that scope." – Kin, Phil, swasheck
 
5:15 PM
Well I can't do that on my own
 
But there's this question that might change things for the better:
5
Q: Shall we add a new 'off-topic' reason for questions that are 'too basic'?

Jack DouglasWe get questions from time to time like this one or the odd 'how do I join two tables' SQL question, which fall short of our 'expert-level'. Some are best migrated to SO, but for the rest, would it help to have a custom close reason of 'too basic'? It could link to our 'what can I ask here' pag...

 
@ShaymaAhmad I'm not entirely sure I follow the question. What's in the package?
 
@ypercube I saw that after it was closed...bad heapers :)
 
@Zane its seems I cannot open the package when I open it in SQL Server 2008, I just copied a job that I see in the old SOL server 2005 job agents
 
@ShaymaAhmad Does the new server have a file located at C:\SSIS\Packages\elfcopy.dtsx
 
5:19 PM
yes
I copied it there as I created the folder paths
changed the connection details to the new server
 
If you rdc into the box and open a command prompt and type
> dtexec.exe /FILE "C:\SSIS\Packages\elfcopy.dtsx" /CONNECTION "BRORPORAP3.WDDocumentManagement";"Data Source=BRORPORAP3;Initial Catalog=WDDocumentManagement;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;" /CONNECTION RCSMTP;"SmtpServer=brutmurex3.bio.ri.redcross.net;UseWindowsAuthentication=True;‌​EnableSsl=False;" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING EWI
 
dangit. i hate coming back from vacation and all of my settings are jacked. bluetooth profiles and all wigglewaggled
 
@billinkc it still gives me the same error "Registration inof for this application needs to be updated"
 
Afternoon all.
 
then I type the path that it reccomends, still waiting for it
 
5:23 PM
@ShaymaAhmad Unless there's more error information generated, that's going to be an error message generated by the package itself. It's not a native SSIS error message (at least that I've seen)
 
@Scott maybe for you ... for me it's still morning :)
 
@Zane nice
 
@billinkc the command prompt says: "The package excution reuturned DTSER_FAILURE (1)"?
 
Ah, you know what, it's not afternoon for another 30 minutes for me either. :)
 
5:26 PM
hahahahahaha
 
@ShaymaAhmad Is that all of the error message?
 
"There werer errors during task validation", adn another one "The script task is corrupted"... although I copied the same infor between instances
I'm trying to read through the prompt, it seems there are others too
 
@EdwardDortland i think that the general guidance that it should (almost) always be on is what people are keying in on ... also, it should ease a bit of PFS pressure as well, no?
 
@ShaymaAhmad To be able to really help, you'll want to copy all of those messages and edit your original question to reflect that. This will give us a fighting chance of figuring out what is happening
 
@billinkc how can I copy everything from the prompt screen
excuse my basic question
as its not allowing me to select, I will try to print screen
 
5:34 PM
there are so many things wrong here
0
Q: DATE_FORMAT displays NULL

d3xSQL: SELECT MAX(ansprechpartner.timestamp), MAX(gallery.timestamp), MAX(instrument.timestamp), MAX(kurs.timestamp), DATE_FORMAT('maxDate', '%d. %M %Y') as MaxDateFormat, CASE WHEN MAX(ansprechpartner.timestamp) > MAX(gallery.timestamp) AND MA...

 
@ShaymaAhmad I would use a redirect operator (>) after your command so dtexec.exe ... > MyOutput.txt
The > is overwrite the file. >> is append to file
 
I attempted to be nice
@d3x There are so many issues with your query, no GROUP BY, referencing an alias in the same SELECT, no joins on your tables. What exactly are you trying to do here? Possibly, start from scratch and try writing this from the beginning. — bluefeet 40 secs ago
but I'm about to vtc it
 
Other option is to right click on the title bar of the command window, change the sizing to fill the screen (something in the neighborhood of 120 x 60) and then re-run the dtexec command. Right click on title bar again and Edit, Select All then hit Enter to copy to clipboard
 
@ShaymaAhmad The more of that info you can add the more likely someone can help you. The first error in an SSIS package failure is typically not very useful.
@bluefeet I wish you hadn't formatted that question.
 
@Zane why?
 
5:42 PM
@bluefeet Because it allowed be to read that god awful mess.
:)
 
Yep, still hate SO
 
@Zane my bad, I can roll it back :)
 
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

F:\>dtexec.exe /FILE "C:\SSIS\Packages\elfcopy.dtsx" /CONNECTION "BRORPORAP3.WDD
ocumentManagement";"Data Source=BRORPORAP3;Initial Catalog=WDDocumentManagement;
Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;" /CONNECTION R
CSMTP;"SmtpServer=brutmurex3.bio.ri.redcross.net;UseWindowsAuthentication=True;?
?EnableSsl=False;" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING E
Microsoft (R) SQL Server Execute Package Utility
 
I love that there is an accepted answer. With no Join Condition.
 
yay, I did it
You guys must hate me by now! sorry
 
5:46 PM
@ShaymaAhmad I would recomend adding that to your question.
 
@Zane yup, it's the best
 
yes thats what im doing, thanks
 
@Zane Well it works for me... I just tested it. — d3x 2 mins ago
That's not very comforting.
 
6:04 PM
ooops
0
Q: How to return back in SQL statement

Ahmed HamoudaI have run SQL server command (update command) is there any way to take back in that command ? note: no backup taken

 
@ShaymaAhmad What do you know about that script task?
 
@zane it should move some files from one internal/staging folder to an active life folder automatically so all can see it on Mondays
But the script doesnt show the X: drive (stage location) and the Q: drive the destination
so I assumed the .dtsx file will have it?
But when I open it from its path on the C: drive ..> elfcopy.dtsx it takes me to the Excution Package Utility
 
@swasheck We agree on that T1118 should always be on. However, it's the PFS thingy that I doubt. I believe that T1118 only relieves SGAM contention and I see no reason why it should help with PFS contention. But, somebody copied a comment and submitted it as an answer, I asked him to give an example. lets see. grin >-|
 
 
@ShaymaAhmad you need to open the Project in SSIS.
@Phil SELECT DATEPART(YEAR,GETDATE())
 
6:17 PM
@zane the properties of this file says its openning with SQL Server 2008 Integration Services
and its says underneath it: "Package Excution Utility" which is the same as the older server
 
@EdwardDortland (i'm not speaking as an expert but as someone who's genuinely trying to learn here) ... based on what i've been reading, though, it seems as though uniform allocations would reduce contention on PFS by reducing PFS scans for which extents are free
 
@Phil Also I can't answer.
 
@zane then when I connect to the Integration Services from the Management Studio, I go down to the folder that imported the package into, I see the "elfcopy" folder but when i right click on it, i have the options of only Import package, export.. run.. but not open!
 
@Zane I can't either
 
@ShaymaAhmad Do you have Business Intelligence studio installed?
Wow I think people may like the snarkiness of my rollback answer as it's in all honesty not that great.
 
6:22 PM
@zane I think so as I see the "Integration Servies" from the drop down list when I connect to Database Engine
 
@ShaymaAhmad This is an application.
It's where SSIS packages are made.
LOL the OP however did not appreciate my snarkiness and therefore chose the other answer.
-1
Q: How to return back in SQL statement

Ahmed HamoudaI have run SQL server command (update command). the command has been performed successfully and the table has been updated is there any way to take back in that command ? note: no backup taken

@billinkc you there?
 
I'm back
 
@zane yes I see it under the start menu--> SQL Server Business Intelligence Dev. Studio
 
@ShaymaAhmad Excellent you want to open the package with that. There should be some sort of project file for that package as well as the others in that project.
 
@ShaymaAhmad So this process copies files from X drive to the Q drive via script task. Are those drives mapped on the new server?
Part of what I expect you're seeing is that the package is currently in 2005 format. When it runs under the 2008 dtexec, it attempts to run in backwards compatible mode. Further complicating matters is that pre-2008 and maybe a SP for 2005, the script tasks could be in an uncompiled state but running on servers didn't allow for compilation.
Much fun was had with that feature
 
6:29 PM
@billinkc He he opens the package with BIDS he should be able to upgrade the package right?
 
@zane let me try it as I think i tried to open it in the past but when I choose open project , i dont see the file at all
@billinkc I will check those drives in both servers
 
@ShaymaAhmad Do you have a DEV copy somewhere?
 
@ShaymaAhmad Be advised that drive mappings are a per user thing so your mapped drive may or may not match with the SQL Agent account which may vary yet from the stored credentials a package may use
 
Ugh
1
A: Error converting nvarchar to int inside a dynamic ORDER BY

Paul HuntAll routes through a case statement must output the same data type. Try casting the ID to a string like this and it will work. DECLARE @SortOrder nvarchar(max); SET @SortOrder = 'name'; SELECT * FROM [database_name].[schema_name].[table_name] ORDER BY CASE @SortOrder WHEN 'id' THEN cast(id...

 
@Zane Maybe. Moving from 2005 to 2008 had rough spots. Specifics of which elude me beyond the big CF of application of configurations
 
6:32 PM
@billinkc I've never actually done it before I just know it's a thing that can be done.
@AaronBertrand Not sure how big this needs to be. Better bust out NVARCHAR(MAX)
 
@Billinkc I can log in as the main user account (not my personal) to see the mapped drives, but where is these info are hidden to see the SQL agent account/ for that job or the credentials you are referring to?
@zane I have a dev copy that I keep restoring a backup into to check it and for my practice
 
I prefer option 1 because of: SET @SortOrder =N'1; DROP TABLE tblname;'; — Edward Dortland 2 mins ago
No mention of this being a web command if I'm not mistaken.
 
I can't seem to get an answer box to show on the codegolf one but a SQL approach could be sqlfiddle.com/#!6/d41d8/13505
 
@billinkc I see the same drives mapped in both servers when I log in as the main owner of that package
 
@billinkc you have to have 10 rep points gained on the site
@billinkc why not select year(getdate())?
 
6:44 PM
Just added that thought sqlfiddle.com/#!6/d41d8/13506
 
@zane, correct, however, I doubt if the code truly setting @sortorder in that script, I mean what would be the point.
 
I had linked accounts and thought that would be sufficient but apparently not
 
@billinkc nope, I checked meta - they require 10 rep on the site
 
@EdwardDortland Well of course, I don't think we need to scope creep an entire dynamic SQL conversation into this. These inputs may be guarded enough where performance is more important. Anyway, QUOTENAME() should help. — Aaron Bertrand 3 mins ago
 
Gentlefolk, I have a question. I have a table that is comprised of a policy number, a name, a date of birth, and blank address, state, zip, fields. I have a second table that has the policy number, and a user id associated with it. I have a third table that has the user id, the address, state, zip, etc that I need to populate back into the first table. The first table has 4000+ rows that each need to be iterated through...
I'm trying to think of the most efficient way to iterate through the first table, join the policy number to the second table containing the user id, then join to the third table and grab the zip, state, address to populate back into the original table
I
Any thoughts?
 
6:56 PM
Please ask technical questions on the site, this is a chat room, not the place for Q & A, thanks
Show what you tried and why you think it could be more efficient
 
I'm trying to avoid iterating through each row. I'm asking if there is a more viable option. The moment I post that question to stack exchange, it will be closed as "not fitting the format" as it will generate a discussion based on viable alternatives and not a specific question
If I knew what other, more efficient alternatives were available, I wouldn't be posing the question in the first place.
 
@zane and @billinkc I finally was able to open the elfcopy.dtsx in SQL Server BI \ Microsoft Visual Studio and its showing me the pretty boxes in the "Control Flow" for Execution Flow and Error Handling Flow
 
Well you need to not think about "iterating through each row" in the first place. RDBMS are optimized to work in sets. You can update a table based on a join, see stackoverflow.com/questions/1604091/… for example syntax for SQL Server.
 
It seems that I need to open each and match them in both servers.
 
Yes, but the problem with a set based solution is that I literally have to update every row in this table.
The set is all rows.
 
7:02 PM
@Scott why wouldn't be able to use a JOIN or a WHERE clause to limit the amount of rows you are updating.
Whatever logic you are doing on a row by row basis can probably be one using proper set based operation.
 
I am attempting to denormalize a table for reporting purposes
So I literally have to update three columns on every row in the table.
 
@Scott completely irrelevant how many rows are touched; a single statement is still going to be universes more efficient than a row-by-row loop, I promise.
 
I understand that Aaron, hence the reason I was asking the question in the first place.
I am trying to satisfy the requirements of the task without iteration.
 
You lost me at Nested Loops. — Zane 1 min ago
 
@Scott yes, and to do that, you use an UPDATE with a JOIN. Have you tried that? If you have, did you come across difficulties? If so, what are they? Not sure what else you want folks in a chat room to do...
Not trying to be abrasive here, but you haven't even mentioned which database platform you're using, and not sure what you're trying to get us to do. We can't write the query for you with such vague requirements (a question on the site will make that much easier to do).
 
7:11 PM
This query is weird to me.
0
Q: Why does this subquery result in different rows returned than the direct query?

kbensonHere's the relevant data SELECT item_group_id ,item_id ,invoice_id FROM item WHERE item_group_id = 92480 # Results 92480 215342 88902 92480 215343 88902 92480 215344 88902 92480 215345 88902 92480 215346 90690 92480 215347 90690 92480 215348 NULL 92480 215349 ...

Is there a reason to group by the same column you're aggregating?
 
0
Q: default value with select case on xml

Qroshselect case 'NULL' when 'NULL' then 'f' end as out output: 1 but select case (select (SELECT LEFT(l.list,LEN(l.list)-1) FROM (SELECT o.Reciting_Path + '|' + o.Declaimer +',' AS [text()] FROM Poetry_Reciting AS o where o.Poetry_I...

 
Aaron, you're right. I apologize.
 
This question isn't very meta. — Zane 10 secs ago
 
I was having a bit of a scatterbrain moment anyways.
Sorry, too little sleep, not enough caffeine. I've managed to resolve my issue. Gracias.
 
The query is weird and the answer is probably wrong.
Or correct but the OP has not shown the correct query/results
 
7:22 PM
uhhhhh
0
A: UNION is slow but both queries are fast in separate

ahmd_AbdAllahTHE MEANING OF LIFE http://safeshare.tv/w/OkKZmtFOEa Influential section - Yusuf Estes with a young Christian http://safeshare.tv/w/hcmjDAYrop ((( O mankind! Say No God But Allah, Achieve Eternal Salvation ))) " Laa ilaaha illallah " ( There is none worthy of worship except Allah ) ( Introd...

 
@swasheck spam, spam spam
 
@bluefeet no doubt. also, my almost alma mater was in tempe beating down the Baylor Bears last night
 
@swasheck I often pray that the lord fixes my query plan.
 
@swasheck i didn't watch the fiesta bowl
 
@Zane you dont chant with the correct inflection, therefore Allah is unmoved by your pitiful please for plan refinement
 
7:28 PM
What would you guys say is the % of questions asked on this site are using pre ansi 92 join syntax.
 
@Zane data.stackexchange.com ... you can figure it yourself
@bluefeet no. of course you wouldnt
 
too many blas in this
0
Q: SQL Condition With Multiple Rows

Ariel AharonsonI have a table which shows me my users' downloads reports. The table looks like this: ╔═══╦════════════╦═════════════╗ ║ ║ url ║ user ║ ╠═══╬════════════╬═════════════╣ ║ 1 ║ Bla ║ 1 ║ ║ 2 ║ Bla Bla ║ 1 ║ ║ 3 ║ Bla Bla Bla║ 1 ║ ║ 4 ║ Bla2 ...

 
@swasheck I always just assume I'm not praying to the correct coordinates. Mecca is long ways away it's hard to get it right.
Ugh!
1
Q: SQL Server wildcard search on json

frostyI have a json stored in SQL NVARCHAR(MAX) column something like this: { "field1":"value1", "field2":"value2" ...}. I want to do wildcard search on any of the fields. A sample query can be: Give me all rows that contains substring ax in field2. The query should return records with fax, axe, et...

 
@Zane good point
 
Oh sweet I never noticed there was ignore tags.
I'm turning off json questions.
@bluefeet I must steal an answer. That pirate hat is awesome.
Counting a string and grouping by a string.
 
7:45 PM
Am I missing something in what they need? Or wouldn't my answer work?
2
Q: Is there a way to round an Oracle crosstab PIVOT?

wweickerI want to pivot data using the AVG() function, but I want to round the results to prevent repeating decimals from displaying. When I try something like this: PIVOT( ROUND( AVG(column_name), 2) FOR ...) I get an error: ORA-56902: expect aggregate function inside pivot operation Here is a very...

possibly I am missing something in the question, since my brain is still in vacation mode
 
@bluefeet Seems simple enough.
 
What DBMS are you using? (I type that a lot.) — Zane 17 secs ago
@Zane get the auto comments user script
@Zane install this
206
Q: AutoReviewComments - Pro-forma comments for SE

Benjol No more re-typing the same comments over and over! This script adds a little 'auto' link next to all comments boxes. When you click the link, you see a popup with 6 configurable auto-comments (canned responses), which you can easily click to insert. This script was inspired by answers to thi...

 
@bluefeet lol I was just about to say. The first comment on 30% of the questions today is you and I asking for bare bones information.
 
How many misconceptions could exist in one question?
0
Q: Why is this using a table variable?

Greg HollywoodI have the following existing SQL. I would like to rewrite this to NOT use the table variable. But I don't understand this well enough to write a replacement. It seems overly complex to me for just inserting into a table. declare @FullOrderHeaderTable TABLE ( OrderId int, UpdatedTime DateTime)...

 
so you're saying you still still hate so
 
7:58 PM
@swasheck i think he already stated that today
possibly a few times
 
@bluefeet just confirming that he still still hates so :)
 
@AaronBertrand I re-edited that. Hope you don't mind. I don't like scrolling code.
 
Yeah that's fine, I usually fix that stuff too but since it's irrelevant to the question I didn't bother
 
@AaronBertrand you preparing for your 2 feet of snow?
 
@Zane the pirate hat was the one I really wanted
 
8:00 PM
also ... i hate that weather channel is naming these storms - it's dumb
 
@swasheck We call them Snownami's in Minnesota and name them based on silly local things. It's done to poke fun at the weather people make it sound like the world will end everytime we get snow.
 
Seriously....what?
0
Q: Why do I need Transaction logs at all

user32336We use Microsoft SQL as a repository of images and data about those images. We record in real time and never care about recovery. If the database slows down and can't handle the number of images, we report this event to the user. So why do I need to use Transactions. Even if the user deletes the...

 
off-topic but this is cool - today.com/moms/…
 
I want to VtC that....I mean, basic understanding of how an RDBMS works.....
 
@MikeFal so why dont you?
 
8:03 PM
@swasheck I just did
Off topic
 
Wait wait I just re-read this. So you want to store data just not retain any of it? Why store it in the first place? — Zane 43 secs ago
 
@MikeFal i just dont understand why people think a feature is bad simply because they dont "need" it
 
@swasheck meh, let it snow. I don't have to go anywhere until Saturday
 
Tempted to roll this back out of spite
2
 
@AaronBertrand our business continuity folks in NYC are getting all antsy for the next snowpocalypse. seems like a tempest in a teapot
@billinkc agreed. c'mon @ypercube
 
8:09 PM
My prediction is this will be the most popular close reason for questions in 2014: This question appears to be off-topic because the core of the question ignores how RDBMS systems work
 
I accidentally all the data. Le sigh
 
@swasheck religion edit wars at dba.se ;)
 
@ypercube no kidding. are you in london now?
 
@billinkc do it!
 
@swasheck Not now now. But in a week, yes.
 
8:12 PM
@ypercube nice. that's pretty exciting
 
too broad?
0
Q: What is the difference between a star schema compared to a snowflake schema?

Jay TaylorWhat are the defining characteristics of star schemas and snowflake schemas, and what are the different practical tradeoffs of using either one?

 
I VtC'd as opinion-based
 
when I typed in google "star v" it gave me star vs snowflake schema. I only had to type 5 characters and a space to get a massive amount of results.
 
interesting or frightening?
 
8:18 PM
How do these simpleton RTFM questions get so many up-votes?
8
Q: What is the meaning of !# (bang-pound) in a sh / Bash shell script?

Jay TaylorI want to understand how this Scala script works: #!/usr/bin/env bash exec scala "$0" "$@" !# object HelloWorld { def main(args: Array[String]) { println("Hello, world! " + args.toList) } } HelloWorld main args On line 3, what is "!#" doing? Is the remainder of the file then...

(Same guy as the star schema)
 
@AaronBertrand was going to say, "i don't know, but the same simpleton asked them both"
victory. now i shall get lunch
-1
Q: Why do I need Transaction logs at all

user32336We use Microsoft SQL as a repository of images and data about those images. We record in real time and never care about recovery. If the database slows down and can't handle the number of images, we report this event to the user. So why do I need to use Transactions. Even if the user deletes the...

 
Does anyone know a free alternative to ApexSQL Diff? I need to be able to compare a snapshot of a database to another database.
 
@AaronBertrand Behold Minimal effort man. The perfect SO user.
 
sigh I overly simplified the problem when I asked it
Sorry, I over simplified my example! This is a good idea, and I'll see if I can run with it to modify my inner query, but in my real world situation the dynamically generated query has already been wrapped a few times and we're cross tabbing on the outside of some existing large SQL mess. It's an architecture constraint that's difficult to sum up here. Basically there are other fields being selected which can't be aggregated like this. For example if you add ROWNUM to the above you'll see the results are no longer cross tabbed. Updated SQL Fiddle demowweicker 7 mins ago
 
@Snuffleupagus Schema comparison or data comparison? If the former (and SQL Server), grab SQL Server Data Tools (SSDT)
 
8:23 PM
@billinkc Both, preferably. I'll take a look at SSDT for the schema comparison though, thank you
 
Technically, it lists data comparison but I've never used it. Thought I saw others barking that it doesn't work
 
@bluefeet So you were missing something.
It was the mystery info.
 
@Zane obviously. My psychic powers are failing me
 
@bluefeet Don't worry, I found their reputation overly inflated and via an architectural constraint decremented them
 
I have a table that has 129 columns in it, I only need 16 of them - should I write a script to drop 113 or just drop and recreate the table.... I think I'll be lazy and drop and recreate the table
 
8:30 PM
laziness is always the right approach
 
@billinkc Ya
 
sad thing is that we actually have a table with 129 columns but we only use 16 of them
and we populate all 129 columns daily
my lord this answer has over 10k upvotes
10105
A: Why is processing a sorted array faster than an unsorted array?

MysticialYou are the victim of branch prediction fail. What is Branch Prediction? Consider a railroad junction: Image by Mecanismo, from Wikimedia Commons: http://commons.wikimedia.org/wiki/File:Entroncamento_do_Transpraia.JPG Now for the sake of argument, suppose this is back in the 1800s - before...

 
SELECT 'alter table ' + schema_name(T.schema_id) + '.' + T.name + ' drop column ' + quotename(SC.name) AS DO_IT FROM sys.tables AS T INNER JOIN sys.columns AS SC ON SC.object_id = T.object_id WHERE T.name = 'MyUglyTable';
 
One for @JackDouglas - Drawing Fractals with Postgres explainextended.com/2013/12/31/happy-new-year-5
 
@billinkc Initially it was absent. I think it's there, but also haven't tried it, so can't vouch for whether it works at all, and if so, how well. I know that Red Gate's works quite well, but it's not free. Few good things are.
 
8:39 PM
@Phil awesome :)
 
06:00 - 21:0021:00 - 00:00

« first day (1094 days earlier)      last day (3775 days later) »