« first day (590 days earlier)      last day (4577 days later) » 
03:00 - 17:0017:00 - 00:00

17:02
@bluefeet - Ok, something that has helped me in the past, add SET FMTONLY OFF at the start of your sp
@Lamak tried that as well.
@bluefeet have you tried TRUNCATE TABLE?
@bluefeet - and the openrowset trick?
@swasheck yes
@Lamak yes
man
17:05
@jcolebrand ?
dfsgdg
the problem is the bad vendor product. It creating a new table each time a survey is created it the big problem
@jcolebrand oh, by accident
@bluefeet perhaps i can interest you in a DROP DATABASE?
@jcolebrand race condition :-)
now I'm scared to try it
in case you do too
@swasheck i wish, this is the last thing I have to finish before my old job will officially let me move on to my new job
17:07
@bluefeet i got lost in the sqlfiddle thing ... what's the original problem?
@swasheck that he's doomed
;-)
all i saw was bad vendor input
here's the question
1
Q: BCP error near the keyword 'as'

bluefeetI am new to using BCP but I am trying to extract data generated via a stored proc. This is a continuation of my original question which was a stored procedure with temp tables. This procedure has grown a bit but the core is the same, generate temp tables, run dynamic SQL to populate the tables a...

and the problem is with bcp and dynamic SQL
@bluefeet So this is taking rows and pivoting them into normalize columns?
@CadeRoux yes basically. We are converting it from multiple columns into multiple rows of data for another area to consume.
17:22
@bluefeet are you limited to bcp or is there a way you could introduce SSIS into the mix?
you'd have to re-start and re-strategize
@swasheck I don't care at this point, I just want to finish it. I believe whatever our choice they will have another integrate into a process to trigger. Either through a WCF webservice, etc
so where are you getting the @ColumName variable?
Can you just run the generate part first (using sqlcmd, say) and then the bcp? The data selection part doesn't appear to be dynamic in any way.
@CadeRoux that is what I am looking at right now.
@swasheck @ColumnName is declared prior to the dynamic SQL piece and the value is selected from the cl.SurveyData table
@bluefeet This is a problem in SSIS as well because like mrdenny says, it does that SET FMTONLY thing
17:29
good afternoon!
ah.
@bluefeet sorry ... for some reason the "here's the full script" part of your question didn't register
@bluefeet Although I know why that fails with temp tables, I'm not sure why it fails with the dynamic (although the inserts obviously shouldn't be run at all).
@CadeRoux I don't know anymore. I have been slamming my head against my desk with this. I just want to move on to my new job.
how many tables/columns are you looking at?
@swasheck that is the great unknown. A new table is created when the users create a new survey. The columns are created based on the number of questions for each survey. (I hope you are beginning to see the fun).
At this time I would say between 20-50 tables each with 5-10 columns.
17:38
@bluefeet so this isnt one-and-done ... you're setting up an ongoing procedure?
but we do not know for sure.
@swasheck yes that was why we are using dynamic sql, then we do not have to know when the business adds a new survey
our preference would be to have a self-sufficient process that we don't have to alter monthly, yearly, etc with survey changes
Mikael's comment is the root of the problem with the dynamic. SET FMTONLY means that these parts aren't working: SELECT @TableName = tableName, @ColumnName = columnName
FROM cl.SurveyData
WHERE @RowCount = rownum
Then the empty @TableName/@Column name result in your dynamic SQL during that phase being invalid.
It's the old leaky abstraction problem.
I think 2012 has a new feature where you can declare the output format so that it doesn't have to try to infer it.
At this point, I am considering using the sql agent job to run the first stored proc with the dynamic sql and then running a second procedure after I know the data is populated
@CadeRoux yup that is the plan. :)
17:46
@bluefeet It's not worth trying to fit it into one proc. Who knows, later it might be better that it's two thing anyway.
@CadeRoux now I just need to convince the project manager that this is how we have to do it
@bluefeet Banging your head against that is sometimes harder than banging it against a desk.
@CadeRoux argh blocked here at work
@bluefeet Just a Zidane head butt with explosion
nice
they block all the good stuff here
18:01
@bluefeet Gotta make do with skank weed, then.
wow, @Mr.Brownstone intervened
1
A: Need some help with this query get all status and their associated comments of me and all my friends

Mr.BrownstoneOk, so based on our conversation if you make sure that when a friend's request is created you also create an entry in the other direction: (i.e. Friend_A asks Friend_B, but you also need a relationship between Friend_B and Friend_A) then you can run the following query to obtain the results that ...

@dezso he is a gentleman :-)
with a lot of free time, I suppose :)
not sure about that
I think he said his employer allows him to post (but not chat) during work hours
I just checked the length of his conversation on chat
18:17
@dezso @JackDouglas you have no idea, that was a tough cookie!
@JackDouglas you are correct, I can post but not chat while I am in the office. This one came through while I was on my way back home - I thought we had solved it last time.
@dezso you asked me a question last night but I was offline <http://chat.stackexchange.com/transcript/message/5798911#5798911> what was you refering to? :-)
how do you link in chat?
just drop the link in the text box
Ah ok, thanks!
wanted to know which Q/A went nuclear :)
Oh ok, if you selected SQL Server as the database engine it then says it depends if your trying to run a nuclear power station with it. If you click yes it takes you to a news article about how there are loads of bugs in it. The article was from 2000 when the spammer worm came out and totalled everyone's instances.... bad times! :-(
18:32
So, do you really work in the nuclear industry?
@JackDouglas You missed the afk above didn't you?
Yeah genuinely do, it's kind of cool but you just have to ensure you take a spare pair of shorts with you when you need to do a site visit. No matter how many times I go, I still am scared sh*itless...
and no need for light bulbs at home, right?
If it got to that stage I think I'd quit ;-)
@dezso When I first started at my company we had this 3 day workshop which was all about how important it is we check, double check and triple check what we do as people may die. When I got back to my desk somebody give me a script to run against one of the safety systems, it was only a select query but I didn't want to press run!!!
19:19
0
Q: How does retrieval of data work when we have more than one column indexed in Oracle?

YooSay for instance table1 has three columns col1, col2, and col3 indexed and named as index1. When we select data using col1 alone, will the query be as fast as when we select using three columns? select * from table1 where col1 = ? select * from table1 where col1 = ? and col2 = ? and col3 = ? ...

Anyone got the source code for the Oracle optimiser? :D
Vote to ellipsis chat is frozen?
@Phil so many question marks here?
19:41
@Mr.Brownstone Hah. I'd hate/love to see your change management process.
19:55
@JakeFeasel feature request: full-text indexes in SQL Server :)
I have to say, a surprise 5AM start is no way to start a Friday :<
@swasheck Hmm - are they not available now?
I haven't intentionally disabled them
Schema Creation Failed: User does not have permission to perform this action.:
everything works up until CREATE FULLTEXT CATALOG
@swasheck Well, yeah that looks like a problem all right
off the top of your head, do you know what permission is needed for creating them?
help me but I am not gonna explain what my code does..
-3
Q: SQL declare if then statement

user1604264We run an in house system that uses syntax similar to SQL. In a few months were will convert entirely to Microsoft SQL Server. How do I rewrite this statement in SQL? define vLength = if (pos('"',so_sku:length) > 0 and trun(um) = "PC") then val(subfield(length,'"',1)) divide...

who on earth is upvoting that questions?
20:05
@JakeFeasel The user needs reference permission on the fulltext catalog, and alter permission on the table. msdn.microsoft.com/en-us/library/ms187317.aspx
@bluefeet just saw that one ... i think that most of it can be inferred but it'd be nice to have something that we dont have to guess at
@JakeFeasel Also, the user needs reference permission on a stoplist if the stoplist is used (by default, public has the reference right on the default stoplist)
@SimonRigharts thanks - I'll see what I can do. Shouldn't take long to implement
@JakeFeasel it seems like your employer supports this to some degree - do they mind that you put so much time into it? (or are you off hours right now)?
@swasheck I don't usually spend much time on it during the day - typically I work on it late in the evening, after my kids go to bed. It's lunchtime, and not real busy at the moment, so I'm spending a bit more time during the day than usual today
between other stuff
20:14
west coast?
yeah
Portland
as of a couple weeks ago - previously from Anchorage, AK
between "portlandia" and "blue like jazz" i have a lot of preconceived notions about portland :)
oh yeah - i forgot about AK. what a transition
Indeed it is - quite a nice one, too
yeah Portlandia sold us heh
@bluefeet ... have you come across a solution for your bcp issue?
Is the SQL Server full text catalog something separate from a particular database? Some global server entity?
nvm, I'll just read about it a bit
20:29
6
Q: Fix for orphan user 'guest'?

JustinStolleWhat can be done, if anything, when the special guest user is orphaned (not linked to any login)? For one of my databases (SQL Server 2005), executing the following lists the guest user as an orphaned user. exec sp_change_users_login 'report' Results: UserName UserSID guest 0x3C2E66...

1
Q: SQL Server 2008 user, group, or role already exists in the current database

TimI am trying to migrate an old, problematic Plesk server to a new one but there are some problems with SQL Server 2008. Plesk couldn't migrate one of the DBs. So, I backed up the DB and restored on the new server. Then I tried to restore 'User Mappings' for the existing user but I got "User, grou...

both are about sp_change_users_login and both have the same answer
The question is, are they sufficiently duplicates to close one as of the other?
@jcolebrand no ... the first is particularly problematic because that sp wont work on guest
No. That answer doesn't fit the first one
yeah, guest is a special case
@swasheck sqlfiddle.com/#!3/43d4a - Here ya go
@SimonRigharts so we should delete the answer from "guest"?
Or more specifically, all of you lot should go downvote it for being wrong?
@JakeFeasel score. thanks
20:39
@swasheck Np, thank you for pointing it out
@jcolebrand or just support the propa answer by @Mr.Brownstone
Good news iOS users - SQL Fiddle finally is fully functional on your devices. In order to support copy/paste, I had to simplify the editors down to just textareas, so a bit of a loss there, but otherwise - good to go!
Also simplified for Android/WebOS users. I think CodeMirror wasn't working well on those either
@JakeFeasel ... neat
One of my next tricks will be to support "offline" mode - using SQLite (either option) while offline. Possible since it runs completely in the browser. Only downside is no sharable URL
Might make for a fun (?) way to pass the time - fiddle with your phone's internal DB engine, while disconnected
20:54
@JakeFeasel ahem there is some sort of a way to share it ...
@jcolebrand While offline? Do tell
@JakeFeasel no, URLs of a sort: github.com/Raynos/distributed-map
Well, yes it's possible to generate the same URLs while being offline
But they won't be useable for anyone else, of course, until you're back online
Meaning they won't be sharable
Just that they will be sharable from the localstorage, was my point, distributed hash-map via browser...
@jcolebrand Well, that sounds interesting, but probably not really necessary in my case
21:03
well ... something good happened to my state this summer
Won the fattest state award? Or slimmest?
slimmest
Heh nice
other than that we've had major fires in/near major cities and movie theater rampages
ready for summer to end
@swasheck 20% - 35% is the spread. What a bunch of fatasses we have in the US.
21:16
@CadeRoux too much driving. too many preservatives. when i was in turkey, we'd walk to market every day to get food. fresh. exercise. get only what you need. good stuff
@swasheck It's not just the US. England is getting worse, China is too: pbs.org/newshour/rundown/2010/06/…
They'll all eventually get where we are if we don't hurry up and eat everything first.
@CadeRoux i guess it's the mark of "civilization"
@swasheck What's not accounted for by high fructose corn syrup is regular sugar, fat and no exercise.
@swasheck I've been successful at cutting out most of the HFCS in stuff we buy from the grocery. And less sugar in most other things. Cheesy carbs are a challenge with the kids, though, between the mac and cheese and the grilled cheese and the quesadillas.
did you hear about how they got around the "hfcs" thing? they relabeled it as "corn sugar" and now they're in compliance
quesadillas are a big hit in our home
part of it is the whole concept of who is in control. the reality is that the US is a capitalism that has run amuck --- no longer dictated by the people but by the dollar. i'm not all anti-us anarchist ... just observing what's happenin'
i'd still rather be here than anywhere (other than turkey or new zealand)
21:36
NZ is still pretty capitalist, it's just not as mercenarily capitalist
.. is 'mercenarily' a word?
(fwiw: 27% obesity here)
@swasheck Just got to keep plugging away at it with our own dollars and getting people educated. I think people should seriously enjoy their food. And everything just needs to be done in enlightened disciplined moderation. That's why I support the Bloomberg-style laws. People just can't control themselves. Free-refills, sure!
@SimonRigharts yeah ... but i fantasize about running away from it all to Hobbiton
Hey, no fair! My favorite c# evil doesn't work after installing .NET 4.5: `typeof(string).GetField("Empty").SetValue(null, " "); // evil`
@swasheck I have a soda a couple times a week and I try only to have Mexican Coke. Otherwise, beer is healthier and I have that instead - deliberately. I get water instead of a refill at a restaurant and I go up to the fountain machine and get a plain soda water instead of a syrup drink.
@CadeRoux the only carbs i drink are beer (and i make that myself)
well ... that's false ... sometimes i'll have sugar in my coffee
21:43
Water, Beer, and black coffee - only liquids I consume
@swasheck I just love to drink most things. When I first started working my first job, we had free sodas - I must have drunk a 6-pack of Coke or Barq's every day. I gave it up and felt so much better - between the caffeine and the sugar - that really cut down on the stress.
i'm sure
Neverending pasta bowl from olive garden - ad on streaming video right now... No wonder people are so fat.
Another thing people seem not to get: Stop eating when you don't feel hungry (rather than waiting until you're full)
22:00
@SimonRigharts Splitting entrees and goboxes. Saves money too.
22:57
hey help me debug this but the stored proc is 30 pages and i can't post it all
0
Q: Select statement after insert hangs?

sanikaIn my stored procedure I am trying to insert records in to a temporary table --Temporary table create table #CR_TMP ( ct_co_id int NULL , ct_nbr int NULL , ctrct_srvc_type char(4) NULL , start_date ...

um no
It's amazing how people think we're actually mind-readers.
I mean if I could read minds I wouldn't be sitting here now. I'd be making billions on Wall St ... or more likely sitting in a corner, rocking silently, waiting for the bad thoughts to go away. :v
23:18
Can anyone follow this one:
0
Q: mysql order by inner query field

user1508136my query is: select a from b where c in ( select d from e where f in ( select f from e where d=100) and e!=100 group by e order by count(e) desc ) ) this query will output result what i want but I want to order it by this subquery select d from e where f in ( select f f...

Worthy of a blog post?
1
Q: How often does SQL Agent update the next_run_date/next_run_time values and how does this get updated?

BBlakeI've been working on code in T-SQL to add new schedules to a SQL Agent job using the sp_add_jobschedule proc in the msdb database. When I add a new schedule (typically a run-once at a specific date/time) and immediately look at the values in sysjobschedules and sysschedules, I can see that the ...

I got confused around about the third line
And that does sound like a reasonable candidate for a blog post. Admittedly it's a bit of a corner case, but they're the fun ones. :)
(My "I got confused around about the third line" was in relation to that MySQL query above...)
@AaronBertrand geez how long did it take you to write that up?
About an hour. Had a lot of time to kill waiting around for the stupid background thread to finally update the table a second time.
I'm really surprised there isn't a whitepaper on Agent internals. It's one of the oldest features in SQL Server and it's probably the one that is one of the least understood.
23:33
Hmm. Just discovered one of our databases hasn't had any maintenance in the last year and a half because our custom version of sp_msforeachdb deliberately skipped it. Oh the joy
Yeah sp_msforeachdb is dangerous, but so is a custom one. :-)
And anoher database hasn't had any maintenance in six months because that same version of sp_msforeachdb will skip any databases that have user connections. Egads.
I'm almost scared to keep digging
Pub trivia time, 'night folks
03:00 - 17:0017:00 - 00:00

« first day (590 days earlier)      last day (4577 days later) »