« first day (748 days earlier)      last day (4417 days later) » 

08:26
If there is an abandoned and incomplete question, which close flag is the most appropriate? Not a real Q?
1
Q: Computer restarted and Postgres 9.2 service cannot be started?

Carl CarlsonMy firewall is down and when I tried to start the Postgres service it gave me an error that said: the service started and then stopped. Some services stop automatically if they are not in use by other services or programs. I need to start postgres for pgadmin and when I tried to connect to pgad...

 
3 hours later…
11:12
Yawn
 
4 hours later…
15:24
@Phil I certainly would've been yawning 4 hours ago
@dezso can we get some cleanup on this, so we can send it over to Stack Overflow? I'm thinking "How do I perform this insert conditionally, here's what I'm doing now" would be a good start. I saw you were already trying to chat the user up, so let's see if we can continue that.
0
Q: Does codeigniter support conditional insert?

AnuI need to check a condition before inserting a row into the table. Is it possible in codeigniter?

@gbn i think so
I got to diagnose a misbehaving tempDB today. I feel like a real boy.
@EugeneM blue fairy?
@swasheck Every production environment has a blue fairy right?
@EugeneM yes ... we call ours Baan
16:26
@gbn migrated.
This seems like a lame self-answered question
-1
Q: Invalid column name cause by "

ManuWhy does this request generate an "" error ? The request is : SELECT * FROM table WHERE colname1 = 'N' AND colname2 like "%azer%";

I voted this to be migrated here, but other voters closed as off-topic
-1
Q: How to Speed Up MySQL Group By Query Within Date Range

jeffersiiAm having trouble reducing response time on a query we were hoping to provide for a customer-facing web application. The table structure is as so: delimiter $$ CREATE TABLE `test_table` ( `CustomerId` int(11) DEFAULT NULL, `EventType` int(11) DEFAULT NULL, `DateAndTime` datetime DEFA...

@bluefeet lame, he even used single quotes on the first filter, why is it a question?
@Lamak It shouldn't be a question. If they even performed a search they would have found the duplicate
@ypercube voted to reopen. Now vote to close to migrate?
16:33
I can't vote now ("You have already voted to close this question")
@ypercube I voted to migrate it here
So this question.....
2
Q: Can I manually reset the internal status flag for a full database backup?

RachelWe recently switched to the FULL recovery model, with full backups being done every weekend, and differentials being taken every day. This worked last weekend, however this weekend the differential backup failed saying that Message Executed as user: username. ... 9.00.3042.00 for 32-bit...

I can recommend that she backup to a NULL device, which resets things, but that's REALLY bad practice 'cause it will destroy the backup chain. I want to provide the NULL device answer with that caveat, but I feel like I could create a bigger mess by even suggesting that.
@MikeFal there's so much more that's going on here. i do wonder why she doesn't just run another full and then debug her job. it reported success when there was no success
16:48
@swasheck I did follow the KB and MSDN links she provided, it's an actual bug. Not sure which SP release of 2005 she's on, but she needs to get current on to at least 2005 SP4 (I believe)
I'm redacting the stuff about NULL device backup. Last thing I want to do is provide an answer that destroys a backup chain.
I'm simply saying "as long as you have your log backups, your diff errors are just an annoyance, just get a full done ASAP"
@MikeFal i agree. the NULL device seems a bit like a nuclear option.
so ... about clustering ...
What about it?
@bluefeet it's also an RTFM question that won't be very helpful to future readers.
Gah, where's a good list of which KBs are included in each service pack?
@MikeFal just thinking that it'd be nice to have in her case ... failover, install update, burn in
@MikeFal @AaronBertrand usually does a good job on his blog with that
16:55
@MikeFal there isn't one list. You find the KB for the service pack you're talking about, then it has a list of fixes.
@AaronBertrand YEah, I want to recommend that she upgrade to 2k5 SP4 at least, but I wanted to make sure her specific hotfix was included.
Unfortunately, I'm looking at the SP download page and can't find a link to the contents of the SP.
@MikeFal but then you also have to remember that many KBs are fixed with cumulative updates, not with service packs. And if a fix is in an RTM CU before SP1 comes out, for example, it might not be documented in the SP1 release notes.
Many more listed in SP3, more likely it's there:
@AaronBertrand Thanks, not sure why I couldn't find that
Your google-fu is superior to mine
Not listed in either of those, probably in an earlier CU/SP. So she should get up to SP4 and be done with it.
@MikeFal KB link is on the download page for each SP:
@AaronBertrand Doh. Well I feel dumb. :)
17:02
The big problem is that many fixes are not documented - by accident, intentionally (e.g. security-related fixes aren't always documented depending on context), or because they were documented in an earlier build.
MVPs get periodic breakdowns of bugs fixed per build and the number is always higher than the number we see shown publicly on the KB.
EF drive me crazy. It can't handle synonyms either?
0
Q: Entity Framework Code First with SQL Server Synonyms

Matt WilsonI have the situation where I will have multiple companies accessing a single instance of my application, but I need to segregate their data to avoid accidentally loading data for another company, and to ease per-company database backups. Ideally, I'd like to split the data up into different data...

i'm going to change my screen name to Manti Te'o ... too soon?
@AaronBertrand "Code First" takes a bad thing and makes it worse
There's already a thing called "Te'oing" (similar to "Tebowing"). A picture of you hugging, kissing or putting your arm around the air (a fictional person beside you).
@AaronBertrand yeah ... saw that through the weekend
7
Q: Why don't SQL Server queries use more than 7MB/sec of disk I/O

Dean MacGregorI have an SSD that, using IOmeter test, shows performance over 200MB/s. However when I run any SQL query from local machine the windows resource monitor never shows disk IO above 7MB/sec. This holds true even for queries that take over 2 minutes to run. What could the bottleneck be that it is ...

Could the reason he not be seeing high I/O simply be because he's hitting the cache?
@MikeFal have you considered asking it nicely?
17:07
Nevermind, looks like someone already asked that. Missed it in the comment spam.
@MikeFal martin smith is on the case
@MikeFal Its SSMS/app consuming the results, resulting in async_network_io waits which he's interpreting to mean "network"
@Mark are you no longer a storysmith? :-)
@AaronBertrand SE oddity I guess... you're just 'Aaron' today also :)
weird
I hadn't noticed mine until you said that, but yours really stood out for some reason
17:14
probably some css padding/margins/spacing html voodoo
@swasheck Well spotted. Dragged the window to the laptop screen and its full names all round :)
.username { capitalize-first-word:true; obliterate-last-name:true }
@AaronBertrand Agreed
@AaronBertrand make it so
Well I kind of had to:
From what I can tell, this is not the last EF/CF limitation you'll come across if your project does not fit into the strict parameters of that model. Is EF/CF something you have to use, or are you using it because it's "all the rage"? I suspect if you want to do anything moderately complex you'll quickly get frustrated with all of its boundaries and seek other alternatives. — Aaron Bertrand 39 secs ago
@CadeRoux - your T-SQL string splitter is just about to go into production across the pond. One of the first results on a google search.
@ConcernedOfTunbridgeWells There are some much newer (and faster) options knocking about
Yes I'd check out the three articles I wrote last year:
@MarkStorey-Smith If I recall correctly, @AaronBertrand has a blog post about it
18:18
@MarkStorey-Smith Does T-SQL have any builtins for it yet?
I couldn't see any evidence of such with a quick google search.
@ConcernedOfTunbridgeWells no ... but XML with XPath query
@ConcernedOfTunbridgeWells what @swasheck said :)
@ConcernedOfTunbridgeWells and what @AaronBertrand said
@ConcernedOfTunbridgeWells no, nothing built in.
@MarkStorey-Smith more what @AaronBertrand said than what I said :)
@MarkStorey-Smith Can I have a show of hands of people who have actually developed a significant body of T-SQL code using Xpath queries on XML documents?
(Apart from me)
18:21
@ConcernedOfTunbridgeWells Close to none. I was trying to do something last year that was causing me to bring the desk and my head into close contact frequently, which @MartinCairns kindly helped me out with in the end.
@ConcernedOfTunbridgeWells using xml path is a hack, and doesn't require authoritative knowledge of xml path. But until there is a built-in, they're all hacks.
Much like regular expressions, xpath is probably very easy to grasp once you've cracked it. I have yet too.
you just need to pick the most efficient and/or least disruptive hack.
@MarkStorey-Smith I've experienced the joy of picking stuff out of policy documents in Duck Creek with xpath queries. It wasn't fun.
(regex causes me grief also)
18:22
@MarkStorey-Smith regex was the original subject of the 'Now you have two problems' quote.
Although it's also quite applicable to XML ;-}
@AaronBertrand All I'm doing is picking apart qualified object names, so I don't to need to process large strings at speed. The CTE one from @CadeRoux will be fine for that as it's short and sweet. Having said that, the Xpath one you linked to is no longer.
@ConcernedOfTunbridgeWells And by the magic of google... regex.info/blog/2006-09-15/247
if you're just picking apart object names, use parsename()
I like the observations on Perl further down the page
@ConcernedOfTunbridgeWells Maybe @MikaelEriksson can help you
It combines the power of C with the readability of PostScript.
18:26
@AaronBertrand That will do nicely. It might explain why I had the vague notion there ought to be a builtin for this but couldn't find any evidence of it on a google search.
@ConcernedOfTunbridgeWells it is a very narrow use case as a built-in, but "parsing object names" is a very narrow subset of the broader "splitting strings"
@AaronBertrand Does it have a mode where it will fill in defaults like 'dbo' where appropriate, or does it really just pick apart the string?
Doesn't look like it does from the docs, but it does automagically strip [ and ] from the names.
@ConcernedOfTunbridgeWells you have to specify all 4 parts, so you can fill in dbo with coalesce.
to be safe, though, you should worry about the user's default schema - their version of that object might not be in dbo.
Am I the only one that finds 2 space indentation a PITA. Maybe my eyes are failing me but it seems harder to read than good old 4 space.
@MarkStorey-Smith Might have been relevant on a 40 column mode on a BBC ca. 1985 where it actually packed the spaces into the code. Not relevant on a modern C${foo} system.
18:38
@MarkStorey-Smith I agree but sometimes I reduce it to keep a code sample in an answer from forcing horizontal scrollbars. That is more of a PITA to me.
@AaronBertrand That's the main beef I have with HWND_OverlyLongIdentifiers (looking at you Java).
But I really want to use SELECT * and none of your warnings will every apply to me!
0
Q: Select * from table vs Select col1,col2,col3 from table

Manish RawatI was just having a discussion with one of my colleague on the SQL Server performance on specifying the query command in the stored procedure. So I want to know which one is preferred over another and whats the concrete reason behind that. Suppose, We do have one table called Employees(EmpNam...

18:52
Wondering if I should post the final comment on the "7MB IO" question as an answer? Borderline on VtC the question as too localised :/
@AaronBertrand Some (most) people are beyond redemption.
A little mean maybe, but holy crap, what is this kid's end game?
@Manish let's see, I've been working with SQL Server since version 6.5. I think I am pretty sure. There are tons of tools for benchmarking SQL Server performance. Did you google benchmark SQL Server performance? — Aaron Bertrand 3 mins ago
@AaronBertrand meep
@AaronBertrand I think that this is one of your less meaner comments ever ;-)
Please make it stop
0
Q: how to get a single column data(one by one) from a database using c# and how to add it to a list

nintoantonyi am using c#.net with sql server 2008.now iam craeting a project.in that i want to read a number of dates from a database.these dates are stored in a single column as one by one.and the retreived data should be added to a list. my code is given below public List<DateTime> getholidays() ...

19:16
Should this question remain closed or should it be reopened?
272
Q: XKCD SQL injection — please explain

BlankmanJust looking at: (Source: http://xkcd.com/327/) What does this SQL do: Robert'); DROP TABLE STUDENTS; -- I know both ' and -- are for comments, but doesn't the word DROP get commented as well since it is part of the same line?

@Lamak reopen
It's important to have a quality explanation on the internet. It is not Too Localized given the notoriety of the XKCD webcomic
@jcolebrand I think the same, I'm surprised that it even got a delete vote
@Lamak reopen, definitely
protect yes, close no
@MarkStorey-Smith this I go with
@MarkStorey-Smith Yeah, it should be protected
19:47
0
Q: Convert String to Timestamp SQL Server

Jeremy1026I am having issues converting a string in dd/mm/yy h:i:s to yyyy-mm-dd hh:mi:ss format using SQL Sever. I have tried using CONVERT() as follows: select CONVERT(VARCHAR, '11/10/11 10:56:58', 120) But that returns no change: 11/10/11 10:56:58

@AaronBertrand don't bother, they don't want to understand
About the varchar without length, or about the invalid interpretation of m/d/y vs. d/m/y, or both?
@AaronBertrand both
the only part that bothers me is that they were upvoted being wrong
And the oldest one is not even an answer.
19:53
lol
@AaronBertrand Thanks for the clarification, downvoting self. — alpofreely 26 secs ago
this must be a record
@AaronBertrand: Good point. I'll encourage this practice from now on. — Francis P 27 secs ago
two users actually listened to your explanation
I think that is a record.
I posted the wrong screen shot above:
@AaronBertrand thought so
I didn't notice until it was too late to delete shrug
so it's always recommended to just blindly create the indexes in sys.dm_db_missing_index_details right?
@swasheck 100% especially when they're redundant
20:06
@AaronBertrand obviously. that makes the index doubly fast, right?
i said fast but i meant, "performant"
@AaronBertrand Quit while you're ahead. Call that a good days SOing done and dusted.
20:51
This guy is starting to be a pain. Keeps posting questions to convert ms access to sql. refuses to accept any answers.
0
Q: Combining CASE STATEMENTS

user1958651I have an access code using IIF statements that have 2 in 1 and I am trying to rewrite them for SQL as CASE statements but I am hitting some speedbumps. Sum(IIf([RRDD] Not Like "12*" And [RRDD] Not Like "13*" And [RRDD] Not Like "16*" And [RRDD] Not Like "17*" And [RRDD] Not ...

@bluefeet Then I got lucky. I was about to post an answer, and then I was too lazy to finish that CASE
21:18
this user can't figure anything out
-1
Q: How to use a TRIM function in SQL

user1958651I cannot get this TRIM code to work SELECT dbo.COL_V_Cost_GEMS_Detail.TNG_SYS_NR AS [EHP Code], dbo.COL_TBL_VCOURSE.TNG_NA AS [Course Title], LTRIM(RTRIM(FCT_TYP_CD)& ') AND (' & LTRIM(RTRIM(DEP_TYP_ID) & ')' AS [Course Owner]

hey guys - I assume UTF-8 storage is still not supported by SQL Server 2012? I have a unix guy asking me about it. Would anyone care to update the following question with 2012 data?
That's right, SQL Server 2012 added some UTF-16 collations
interesting
glad I asked
21:36
Hey everyone!
I'm wondering why sql server import is detecting an excel column of mine as a double
When it clearly does not have a floating point of any kind
For a visual, here is what I'm looking at
http://i.imgur.com/Ba3SIaL.png
I'm unclear as to why my Quantity column is listed as "Double"
I guess I could just proceed with the warnings since I know I don't need that much precision
21:53
@Zach ask it as a question on the site. It's a bit quiet in chat tonight
@ConcernedOfTunbridgeWells Raising hand ..
@Phil Thanks for the tip.
@Zach Typically SQL Server is going to err on the side of including larger values even if none are immediately present. I'm not sure if it analyzes the entire data set or just a largely representative sample. Did you change the mapping to smallmoney for the highlighted row?
I'm going to be out for a bit, but I'll compose a question when I get back.
@AaronBertrand I've read that it determines type based on the first eight records of the excel spreadsheet.
And what about smallmoney?
@Zach ding! That sounds like your answer. Again, it probably chooses the largest compatible type. I bet if the first 8 rows contain only 0 and 1 it doesn't choose BIT
@Zach I was just asking if you changed that mapping, but I'm also curious if you have any compelling reason to use that type.
The content is dated but I still don't believe there are any advantages to using MONEY/SMALLMONEY.
But there are certainly risks of issues...
22:01
@AaronBertrand Here is a shot of my spread
I set my Quantity column to smallmoney only out of naivete
I figured it was appropriate based on its name lol
So SQL Server sees that the column contains numbers, and makes it the most accommodating type, assuming that the largest value might not be in the first 8 rows.
Would you expect it to choose single or smaller based on the first 8 values? I think that will break for a lot of people whose 9th row is 2 billion, or 32.6
True, true
But double seems weird to me
And maybe I'd just assume that Excel would want to scan more of the file
As opposed to just the first eight rows
*sql server
Double isn't even a data type in SQL Server. I wouldn't spend too much time worrying about it, especially if you're going to override the mapping anyway.
That's so you don't have to wait an hour for the mapping to happen. Think of a huge Excel spreadsheet stored on a network share over a really slow VPN.
My idea of hell
@Phil you had me at Excel
22:05
Haha
That, as a DBA, I'd offer to rewrite as a proper report as soon as possible
@Phil oh and it's on 5400 rpm disks
Oh so I have a database design question if anyone's interested
It's not a big deal, but I'm curious as to what you guys think
I'd still suggest posting a question on the site - then you can get input from people other than just the few paying attention here.
You mean on the design question I just mentioned?
22:07
Giving end users free production SQL access to write stuff in Access or Excel is wrong. Always. Tablescans, "accidental" (read: clueless) drops and deletions. Endless nightmares
Yes, on the design question. I know that posting here is a little less work than posting a question, but in general - and I don't want to speak for every single person - we're not in here to answer questions, we're here to chat. :-)
Ah, point taken
And post funny cat pictures
@swasheck that site was clearly designed before SSDs
22:08
@AaronBertrand and moke the resistance to accept perfectly-sensible answers to said questions
@swasheck and before IE3
@AaronBertrand what was your first clue?
Thank you for the helps though guys
I'll repay you with cat http://i.imgur.com/RVM2pYi.png
Front page of r/aww though
Not too original
sigh blocked
I said funny cats! Not cute cats! -50 DKP!
22:09
I'd prefer beagle pictures. I'm allergic to cats.
misread
I prefer cute cats to funny cats anyway
@AaronBertrand i prefer dbareactions.tumblr.com
Afternoon folks...got a SSIS design consideration with BULK data loads.
@MikeFal crits you for 3000000000. 250000000 overkill. You die. Definitely 50 DKP minus!
And can we petition to have stack use a different service than img.ur? At least it will buy the less fortunate among us some time to see images until their archaic IT departments catch on
Ok, I'm out.
22:11
@ShawnMelton Ask it as a question on the site please ;)
@AaronBertrand Is this a Beagel?
@AaronBertrand Night
Speaking of archaic IT departments, mine is on track to block the following:
DropBox
SkyDrive
GoogleDrive
iCloud
@Phil trying to figure out how to ask it on the site so it is meaningful and not just a quick answer
@MikeFal dont want you stealing IP
22:12
@ShawnMelton You can always edit it. Post it as a question, they put the URL in here. You can edit after
@Phil I'm going to follow on that
@swasheck It's not like I couldn't do that anyway. USB drives are only getting bigger.
@MikeFal true. i'm surprised that your sysadmin hasnt GPO'd USB out of the environment. ours has
@swasheck Ewwwwwwwww
I think there's a 3.5" floppy joke in there somewhere too...
22:15
@MichaelFredrickson Bah, go 5.25" or go home\
@MikeFal I heard you were more of a ZIP kinda guy. that, or JAZ
@MikeFal I guess I'll be going home then...
@MichaelFredrickson dont listen to him. he's working with cloud storage. you don't even know it's there.
22:31
Appreciate any feedback. dba.stackexchange.com/q/33294/507
Question 1) No, probably not.. 2) No, probably not... 3) Yes, probably...
Sounds like SSIS would just be doing the same thing that is being done in the C# app... so you probably wouldn't get any performance gains that way...
but doing the export / file copy / bulk insert could be faster...
@ShawnMelton This is all on the same network, yes?
@MikeFal yes
0
Q: MS SQL Server manage indexes

pehaadaIs it possible to automate the managing of indexes on my database. I'm looking to see if there are any scripts or programs that can automate this process. Would it be possible to use stats generated by SQL to determine what indexes could help performance. Then use another script based on stats...

yes. it is.
22:47
@ShawnMelton I'd probably have to test stuff, but I'm not sure there's an appreciable difference. I believe the SQLBulkCopy class uses the same underlying process as the BULK INSERT syntax.
@MikeFal That is biggest thing I was wondering. I know SSIS has the fast-load option with BULK loads but could not find anything that compares it to the SQLBulkCopy class. MSDN states the SQLBulkCopy is less efficient if the source and destination is on the same instance.
@MikeFal I think putting in SSIS right off would just get better control and management of it. The C# program would have to be recompiled for changes, which is not that efficient in this customers case I don't think.
@ShawnMelton I absolutely agree with you. Writing ETL processes in a .Net app when you have true ETL tools available to you seems......unclean.
@MikeFal The only problem they are experiencing with the process right now is two particular classes that move data are timing out on the SQLClient side. It is trying to move about 10.5 million and is timing out after it gets about 9.6 million done for some reason.
23:04
@ShawnMelton Shawn, Ola's scripts not the kind of maintenance/automation that guy is asking for, unfortunately.
@ShawnMelton He's looking for something more akin to the DETA.
@MikeFal "DETA" ??
@ShawnMelton an organic compound with the formula HN(CH2CH2NH2)2. This colourless hygroscopic liquid is soluble in water and polar organic solvents, but not simple hydrocarbons.
@swasheck Why of course
@ShawnMelton Database Engine Tuning Advisor
I feel dirty just saying it
@MikeFal Ah I know it as just DTA
23:07
@MikeFal shut yo mouth ... jus' talkin' 'bout Shaft
@MikeFal I see consultant answers being posted on that question. "If you automagically pay me $$$ I will take care of all your shortfalls, not having a DBA."
@ShawnMelton Yeah. I'm trying to answer completely in a way that says "if you fuck this up, you shoot your own foot off"
SELECT   OBJECT_NAME(S.[OBJECT_ID]) AS [OBJECT NAME],
         I.[NAME] AS [INDEX NAME],
         USER_SEEKS,
         USER_SCANS,
         USER_LOOKUPS,
         USER_UPDATES
FROM     SYS.DM_DB_INDEX_USAGE_STATS AS S
         INNER JOIN SYS.INDEXES AS I
           ON I.[OBJECT_ID] = S.[OBJECT_ID]
              AND I.INDEX_ID = S.INDEX_ID
WHERE    OBJECTPROPERTY(S.[OBJECT_ID],'IsUserTable') = 1
Damn, I feel like I just wrote a blog post
@MikeFal indeed you did
obligatory +1
23:21
data.stackexchange.com/stackoverflow/query/84763/… Apparently Skeet would have over 1.7M if the votes weren't rep-capped. I expect he might even be closer to 2M if you factor in "I didn't upvote because it's Skeet"
@jcolebrand Won't you factor "I upvoted because it's Skeet" as well?
Those are already present ;-)
That's why it's rep-capped vs "if all the votes were counted"
23:45
can someone please check my work?
0
A: SQL Server Agent - Run Query at the end of each month with date variable

swasheckTo find the first and last days of the month: DECLARE @MonthStart DATETIME DECLARE @Date DATETIME DECLARE @MonthEnd DATETIME -- create the required date. because today is the 21st i subtracted month. -- since you're running the job on the first day of the new month, -- you may want to change...

@swasheck Don't let Aaron see the: and b.bg_reported_date <= @MonthEnd
@swasheck Reading the query, but......msdn.microsoft.com/en-us/library/hh213020.aspx
2012 only, though
And to late, @AaronBertrand saw it and commented.
2
yeah ... meh
i'll delete
Naw, don't delete it.....just update it.
@MikeFal that's the problem ... to what? that's the only way i know how
OP expressedly said 2008 R2
23:53
@swasheck so engage Aaron to find the right way.
@swasheck to something like: b.bg_reported_date >= @MonthStart and b.bg_reported_date < @NextMonthStart
You do know it's possible to generate a new @var and just use that for the comparison, right?
Then the code is explicit and thus much more maintainable
Otherwise your answer is fine.
(afaik)
@ypercube i thought that's what i did ... did i not?
oh FFS ... i guess i didnt
@ypercube that's what i thought i did. but i clearly didnt
meh ... i'm humiliated for the day. deleting just moving along
Ah, was about to edit that, @swasheck
really, honestly ... who am i trying to fool ... have a good evening all

« first day (748 days earlier)      last day (4417 days later) »