Using PowerShell to Archive Twitter Feeds–Preserving the wisdom of Paul Randal

If you didn’t make it out to the PASS Summit then you missed out on a lot of great content.  If you’re not on twitter and following some of SQL Server’s best and or rowdiest than you’re missing a lot.  And if you didn’t follow Paul Randal while he was tweeting from the session he and Kimberly L. Tripp presented then you missed a great refersher course on SQL fundamentals that are critical to your success in this field.

The challenge of dealing with great content burried in tweets is figuring out how to capture that information in a way you can reference it later. I took a queue from of Bruce Payette’s book Windows PowerShell in Action and decided I’d try tackling this problem. 

I started by visiting the PaulRandal twitter page. If you just wanted to download his last 20 tweets you could just use the RSS feed: .  How do you get the others? I got around the 20 tweet limitation by  favorite-ing Paul’s tweets starting at the beginning of the conference and then working my way toward the current date:

Every time I selected 20 of Paul’s tweets as a favorite I just ran this PowerShell script and appended it to a file that I was storing them in. 

 ([xml] (new-object net.webclient).DownloadString(”)) | formattable -autosize description, pubDate, link >> PaulRandal.txt

After that I used SSIS to load them in a SQL db and help me clear out a few of the tweets that would be of little use without the other half of the conversation and what not. 

I did learn a couple of interesting PowerShell quirks during this process.  The first is that your output is truncated based on your available screen size.  I began writing this script while running the PowerShell command in a 1280 x 1024 screen.  When my output was restricted I took a chance and tried running it on my laptop where the resolution is ste to 1920 x 1200. Running the download at a higher resolution was good enough to solve problem. (I haven’t yet found out why PowerShell kept trying to truncate in the first place. If you have ideas on this feel free to use the comments.)  The second was seeing the real differenece between the “>>”  and “>” operators.  By using a double “>>” instead of a single “>” I was able to append my output instead of completely replace it every time I ran my script.  Next time I’ll figure out how to pump it straight into a table so that I can skip the SSIS step.

Finally here’s what I ended up with:

PaulRandal:And we’re on – pretty packed room here in our pre-con – just shy of 100. #sqlpass                11/2/09 4:38 PM                
PaulRandal:#sqlpass Let’s make the hashtag for our indexing precon #ktprecon – I’ll watch both.               11/2/09 4:56 PM  #ktprecon 
PaulRandal:Question from #sqlpass: Ever a use for heaps? A: Not really. E.g. incoming clickstream temp storage            11/2/09 4:58 PM 
PaulRandal:#sqlpass Either that or Kimberly’s jokes really *are* bad, and I’m just laughing because I have to (being married to her) 🙂     11/2/09 5:01 PM 
PaulRandal:#ktprecon #sqlpass Q: why do SELECT COUNT(*) of a heap with fwded records generate extra IOs?             11/2/09 5:14 PM  #sqlpass 
PaulRandal:#ktprecon #sqlpass A: because the Storage Engine will only process fwded records when it finds them from a fwding record      11/2/09 5:14 PM  #sqlpass 
PaulRandal:@DBA_hole #ktprecon #sqlpass Yes (unless you specifically ask for a nonclustered primary key)             11/2/09 5:19 PM  #ktprecon 
PaulRandal:@DBA_hole #ktprecon #sqlpass But not a drop/recreate. It’s a create of clustered index + drop of heap. Semantic, but important difference.  11/2/09 5:20 PM  #ktprecon 
PaulRandal:#ktprecon #sqlpass Our wonderful attendees…                    11/2/09 5:24 PM  #sqlpass 
PaulRandal:#ktprecon #sqlpass Kimberly in mid-sentence… isn’t she cute? 🙂               11/2/09 5:26 PM  #sqlpass 
PaulRandal:#ktprecon #sqlpass Ola Hallengren’s *wonderful* db maintenance script:              11/2/09 5:35 PM  #sqlpass 
PaulRandal:@sqlinsaneo They’re not real seagulls – they’re MS-controlled robots #sqlpass                 11/2/09 5:37 PM                 
PaulRandal:@buckwoody I’m trying to avoid looking at you – too embarrassed after what happened to us last night in that phone booth #sqlpass    11/2/09 5:42 PM    
PaulRandal:#ktprecon #sqlpass Alternative to shrink:                     11/2/09 5:54 PM  #sqlpass 
PaulRandal:@DBA_hole #ktprecon #sqlpass Depends on your I/O subsystem, filegroup layout, HA/DR strategy… may be more mgmt probs than gains    11/2/09 6:04 PM  #ktprecon 
PaulRandal:#sqlpass Please refill the coffee in the speaker room (and have someone check regularly…) thanks!            11/2/09 6:38 PM 
PaulRandal:@DonKirkham #sqlpass backup/restore does not reclaim space (or do anything else to the db). Only way to reclaim is some form of shrink.   11/2/09 6:41 PM 
PaulRandal:@DonKirkham See for an alternative for you.                     11/2/09 6:51 PM
PaulRandal:@ktegels Because an existing filegroup has data files – a FS filegroup is a pointer to the root of the NTFS data container      11/2/09 6:52 PM
PaulRandal:#ktprecon #sqlpass How expensive are page splits in terms of transaction log?            11/2/09 7:03 PM  #sqlpass 
PaulRandal:#ktprecon #sqlpass Do page splits ever roll back? No: script to prove it:             11/2/09 7:04 PM  #sqlpass 
PaulRandal:#ktprecon #sqlpass Demo scripts (and companion content for the internals book chapter) are at        11/2/09 7:10 PM  #sqlpass 
PaulRandal:Audience perspective: RT @joewebb: Live from #ktprecon at #sqlpass.             11/2/09 7:12 PM  #sqlpass
PaulRandal:#ktprecon #sqlpass Kimberly dissing DBCC commands while I’m on stage next to her? Not a smart move! 🙂           11/2/09 7:17 PM  #sqlpass 
PaulRandal:#ktprecon #sqlpass OH from Kimberly: “The key points are…. really just the key points.” Very astute observation there dear 🙂    11/2/09 7:45 PM  #sqlpass 
PaulRandal:@ChiragRoy #ktprecon #sqlpass It depends 🙂 Wait until she talks about indexing strategies this afternoon.          11/2/09 7:48 PM   
PaulRandal:@AndyLeonard #sqlpass #ktprecon She’ll never see it – she doesn’t tweet much – I’m safe 🙂              11/2/09 7:49 PM  #ktprecon 
PaulRandal:#sqlpass People.. the answer is always “it depends”. Apart from if the question is ‘should auto-shrink be turned on?’.       11/2/09 7:58 PM 
PaulRandal:@datachick My other favorite answer is “12” and then watch the mystified expressions. #sqlpass             11/2/09 8:01 PM             
PaulRandal:#sqlpass L U N C H    T I M E! #ktprecon We’ll be back to cover more incredible indexing info (and on-stage (verbal) spousal abuse! 🙂   11/2/09 8:03 PM  #ktprecon 
PaulRandal:@DonKirkham Ah – no solution for that – maybe a 3rd-party backup/restore tool?                 11/2/09 8:52 PM
PaulRandal:#ktprecon #sqlpass Once more into the breach, dear friends, once more….  back after lunch with the KT Indexing Show       11/2/09 9:05 PM  #sqlpass 
PaulRandal:#ktprecon #sqlpass Don’t INCLUDE LOB columns in NC indexes. It creates a whole extra copy of the LOB data. Not good.       11/2/09 9:10 PM  #sqlpass 
PaulRandal:#ktprecon #sqlpass And don’t put an index on every column. One of the worst things you can do.             11/2/09 9:13 PM  #sqlpass 
PaulRandal:@SQLCraftsman Oh yeah. Confusing unto and into always gets me into unto-ward trouble.               11/2/09 9:16 PM
PaulRandal:#ktprecon #sqlpass What is a ‘seekable’ index? An index with keys that can be used in a left-based subset to match a search argument.   11/2/09 9:23 PM  #sqlpass 
PaulRandal:#ktprecon @sqlpass What order should the NC index key columns be in? It depends… 🙂               11/2/09 9:24 PM 
PaulRandal:#ktprecon #sqlpass So far Kimberly’s answered “It depends” 15 times…                   11/2/09 9:26 PM  #sqlpass 
PaulRandal:#sqlpass Q I get asked: query perf dropping, what happened? If it slowly drops, fragmentation. If it drops off a cliff, stats. Commonly.  11/2/09 9:35 PM 
PaulRandal:@ChiragRoy #ktprecon #sqlpass Parts of database must all be at the same point in time as primary filegroup… no problem.      11/2/09 10:08 PM   
PaulRandal:#sqlpass Q: How to make system gen’d stats persist after a restart? A: they are always persisted in the primary FG.        11/2/09 10:10 PM 
PaulRandal:#ktprecon #sqlpass How are auto-gen’d stats names generated?                11/2/09 10:18 PM  #sqlpass 
PaulRandal:#ktprecon #sqlpass Stats are *always* at the table level. Partitioning has *no* benefit as far as stats are concerned. Even in SS2008.   11/2/09 10:53 PM  #sqlpass 
PaulRandal:#ktprecon #sqlpass 2008 filtered stats != poor-man’s partition-level stats                  11/2/09 10:54 PM  #sqlpass 
PaulRandal:Apparently my #sqlpass worth today is limited to tweeting from #ktprecon, and holding her used teabags. Very humbling 🙂      11/2/09 11:05 PM  #ktprecon
PaulRandal:@plitwin #sqlpass #ktprecon 🙂 She’ll get the same treatment in my Friday post-con – it goes both ways.          11/2/09 11:09 PM  #sqlpass 
PaulRandal:#ktprecon #sqlpass Filtered indexes and filtered stats might become seriously out-of-date         11/2/09 11:41 PM  #sqlpass 
PaulRandal:#sqlpass One of the joys of co-presenting is watching Kimberly trying to draw on-screen using ZoomIt 🙂          11/2/09 11:49 PM 
PaulRandal:#ktprecon #sqlpass Does order of columns in WHERE clause affect index choice? No. (unless you’ve got, say, 50 conditions)      11/2/09 11:50 PM  #sqlpass 
PaulRandal:#ktprecon #sqlpass I love hearing UNION described as “set, set squish”                   11/3/09 12:10 AM  #sqlpass 
PaulRandal:#ktprecon #sqlpass Over-indexing is worse than under-indexing. Err on the side of fewer indexes always.           11/3/09 12:16 AM  #sqlpass 
PaulRandal:#ktprecon #sqlpass OH: keep the search arguments in the WHERE clause and the join arguments in the FROM clause         11/3/09 12:18 AM  #sqlpass 
PaulRandal:#ktprecon #sqlpass For OLTP or OLTP/DSS combo, you want to try to cover the aggregate. INCLUDE the columns you’re aggregating.     11/3/09 12:22 AM  #sqlpass 
PaulRandal:#ktprecon #sqlpass and GROUP BY the key. E.g. SUM(sales) by customer                   11/3/09 12:22 AM  #sqlpass 
PaulRandal:#ktprecon #sqlpass key would be customer, INCLUDE would be sales. Otherwise an unordered aggregate needs to be done. Slooooooow.    11/3/09 12:23 AM  #sqlpass 
PaulRandal:#ktprecon #sqlpass Indexed views whitepaper                    11/3/09 12:29 AM  #sqlpass 
PaulRandal:#ktprecon #sqlpass Whitepaper comparing heaps and clustered indexes               11/3/09 12:30 AM  #sqlpass 
PaulRandal:#ktprecon #sqlpass Database Tuning Advisor whitepaper                  11/3/09 12:32 AM  #sqlpass 
PaulRandal:#ktprecon #sqlpass Craig Freedman’s blog on index_operational_stats               11/3/09 12:35 AM  #sqlpass 
PaulRandal:Today Kimberly and I are the embodiment of ‘it depends’. Catch us at lunchtime! #sqlpass              11/3/09 6:30 PM              
PaulRandal:That picture’s on my FB page too 🙂 RT @robboek: @BrentO just put up a very flattering picture of @PaulRandal #sqlpass       11/3/09 11:57 PM       
PaulRandal:@MidnightDBA #sqlpass 1000 is a number I made up when back at MS, but it only applies if the table is in memory. Otherwise, sure, defrag.  11/4/09 12:06 AM 
PaulRandal:#sqlpass Just like the <10% nothing, 10-30% defrag, 30%+ rebuild. I made those numbers up too as people wanted *some* guidance. YMMV.  11/4/09 12:10 AM 
PaulRandal:@GFritchey Hope you didn’t mind me commenting on the tweets coming from your session!               11/4/09 12:53 AM
PaulRandal:@GFritchey 🙂 I always like to ‘fess up about the BOL numbers/guidance about defragging.              11/4/09 1:01 AM
PaulRandal:@kbriankelley @SQLSarg #sqlpass Absolutely disagree for user DBs.                    11/4/09 2:08 AM 
PaulRandal:@SQLSarg @kbriankelley #sqlpass and for tempdb, start with #files = 1/4-1/2 #cores IF seeing page latch contention (not page IO latch)   11/4/09 2:09 AM
PaulRandal:@kbriankelley @SQLSarg #sqlpass see                       11/4/09 2:09 AM 
PaulRandal:#sqlpass For me best thing about this PASS is mting all Tweeps I’ve gotten to know over last 6 mths. We have a *rocking* community!    11/4/09 3:47 AM 
PaulRandal:#sqlpass In a good way, of course. Well, maybe except @BrentO and @sqlrockstar…. ;-D               11/4/09 3:50 AM 
PaulRandal:Snotty in Seattle. Cold is kicking my butt again, offline now to veg in front of TV b4 Logging&Recovery spotlight at #sqlpass in the a.m.  11/4/09 3:55 AM 
PaulRandal:Wow – all the #Muppets videos have gone from YouTube (under litigation threat from WMG) – no more #Manamana! How sad 🙁      11/4/09 4:04 AM  #Manamana
PaulRandal:#sqlpass Understand Logging and Recovery? Completely? If not, come to my spotlight this morning at 10.15 in 2AB.        11/4/09 4:08 PM 
PaulRandal:@AndyLeonard @sqlagentman It’s called job security. Make up numbers while at MS, get paid to explain them once I leave. Simple! ;-D #sqlpass 11/4/09 4:09 PM 
PaulRandal:@AndyLeonard #sqlpass Don’t blame me – I didn’t make up the schedule!                                                                        11/4/09 4:13 PM 
PaulRandal:@buckwoody A kilt will be on show.                                                                                                           11/4/09 4:13 PM
PaulRandal:Had great fun doing my logging/recovery session this morning. I’ve got some much deeper log internals blog posts lined up too. #sqlpass      11/4/09 10:56 PM 
PaulRandal:@way0utwest You may have a kilt, but you also have a pink cowboy hat. I worry about you Steve… #sqlpass                                    11/4/09 11:58 PM 
PaulRandal:Damn right! bwin have a rocking SQL setup. RT @aspiringgeek: DBCC should be done everyday. No, not @paulrandal, bwin’s VLDB’s DBA #sqlpass   11/4/09 11:59 PM 
PaulRandal:Helping Kimberly thread the wireless mic under her top #sqlpass #passawesomeness 🙂                                                         11/5/09 12:22 AM  #passawesomeness 
PaulRandal:@SQLCraftsman Just ask @BuckWoody about the time he was almost arrested in Leavenworth with me…. #sqlpass                                  11/5/09 12:24 AM 
PaulRandal:In Kimberly’s Covering Indexes Spotlight session – 4C1-2 #sqlpass                                                                            11/5/09 12:28 AM 
PaulRandal:Kimberly on stage #sqlpass                                                                                              11/5/09 12:35 AM 
PaulRandal:RT @sarahspace: How I explain what it is like to be a DBA:  DBA is the sexiest profession there is this side of being a stripper #sqlpass    11/5/09 12:45 AM 
PaulRandal:Now sitting next to @sqlfool in @kimberlyltripp’s session #sqlpass                                                                           11/5/09 12:46 AM 
PaulRandal:@kimberlyltripp’s Tipping Point blog posts r @ #sqlpass You’d be amazed how selective a query must be to use an index.  11/5/09 12:50 AM 
PaulRandal:@t_burger @kimberlyltripp’s deck is up on site but may not have made it to the download section yet. Don’t worry, it will be. #sqlpass       11/5/09 12:54 AM 
PaulRandal:@DevSQL She also has roadrunnerkt and I have roadrunnerpr. I’ve got another one called roadkill 🙂 #sqlpass                                 11/5/09 12:55 AM 
PaulRandal:@tjaybelt I think @kimberlyltripp just rocks full-stop 🙂                                                                                   11/5/09 1:00 AM
PaulRandal:@aspiringgeek She’s sitting next to me – just showed her that tweet #sqlpass                 11/5/09 1:00 AM                 
PaulRandal:Latest version of @kimberlyltripp’s sp_helpindex2 script is at #sqlpass             11/5/09 1:04 AM             
PaulRandal:He has amazing body-hair…. RT @janhonenj: #sqlpass @BuckWoody is claiming he knows something about shampoo. I’m not sure I believe him.  11/5/09 1:06 AM 
PaulRandal:@Kimberlyltripp managed to go 6 whole seconds without saying ‘it depends’ after challenging herself not to. Nice. #sqlpass      11/5/09 1:09 AM      
PaulRandal:Do not just automatically put an index on every column #sqlpass                     11/5/09 1:13 AM                     
PaulRandal:Over-indexing is usually worse than under-indexing – think of the overhead of maintaining all those unused indexes… #sqlpass     11/5/09 1:14 AM     
PaulRandal:Covering: best done cleverly, correctly, and concisely. @kimberlyltripp was in an alliterative mood, obviously. #sqlpass      11/5/09 1:16 AM      
PaulRandal:@BrentO, *you* of all people organized a breakfast *without* #bacon?!?! RT @lotsahelp: @BrentO going to remember the #bacon? #sqlpass   11/5/09 1:26 AM!?!  #sqlpass
PaulRandal:Chugging down Hall’s cough sweets to try to avoid a cacophony of coughing in the covering session #sqlpass          11/5/09 1:27 AM          
PaulRandal:If your stats are out of date, it might not matter how good your indexes are – SQL may not be able to figure out to use them #sqlpass   11/5/09 1:30 AM   
PaulRandal:OH from @kimberlyltripp: I want you to stop caring #sqlpass                      11/5/09 1:40 AM                      
PaulRandal:You can get the Credit db that @kimberlyltripp was using in the session from #sqlpass          11/5/09 1:43 AM          
PaulRandal:OMG these chairs are incredibly uncomfortable – parts of my anatomy are asleep and sore! #sqlpass            11/5/09 1:45 AM            
PaulRandal:Using indexed views wps (2005) and (2008). Don’t go crazy with them though #sqlpass     11/5/09 1:58 AM     
PaulRandal:My latest TechNet Magazine article is out on web “Recovering from Disasters Using Backups” #sql #sqlserver #sqlpass  11/5/09 4:35 PM #sqlserver #sqlpass
PaulRandal:Yeah! RT @sqlbelle: Yup! Agreed! RT @kbriankelley: @sqlbelle That’s a shame. You’ll get more DR info out of a @PaulRandal session. #sqlpass  11/5/09 5:17 PM  
PaulRandal:We spent ton of time at end of 2005 dev reducing data/inst cache misses – very fiddly, gnarly work, but fun! #sqlpass                        11/5/09 5:44 PM 
PaulRandal:I always explain that the NULL bitmap in a record is one big cpu cache miss prevention mechanism #sqlpass                                    11/5/09 5:46 PM 
PaulRandal:Here’s the MIT paper, it’s a good read: Materialization Strategies in a Column-Oriented DBMS #sqlpass                   11/5/09 6:17 PM 
PaulRandal:You can actually download MITs column store database engine source code and play around with it too #sqlpass            11/5/09 6:24 PM 
PaulRandal:Me too! RT @AndyLeonard: Hey #sqlpass! I will be at the PASS Bookstore at noon to sign books and answer questions.                           11/5/09 6:53 PM! 
PaulRandal:@sqlfool I’ll be wearing my ‘it depends’ t-shirt again today, just for you. See you at lunch at the bookstore.                               11/5/09 7:09 PM
PaulRandal:Came home from #sqlpass to prep for tomorrow’s post-con/convalesce – lots of #bacon and eggs for lunch mmmmmmm                               11/5/09 9:34 PM  #bacon
PaulRandal:@aspiringgeek Surely they’re not advising that as a generalization? #sqlpass                                                                 11/5/09 10:02 PM 
PaulRandal:@simon_sabin Yup, -E makes ind creates/rebuilds alloc multiple extents when round-robin-ing. Didn’t realize @aspiringgeek’s context #sqlpass 11/5/09 10:08 PM 
PaulRandal:@hpebley3 #sql the database with the ID in the message is shutdown and can’t be started for some reason.                                     11/5/09 11:01 PM 
PaulRandal:Leave it on for *all* DBs RT @sqlbelle: Leave autogrow on for #sharepoint dbs  . It is like your catastrophic insurance policy #SQLPASS      11/5/09 11:02 PM  #SQLPASS
PaulRandal:#sqlpass if anyone’s brave enough, ask @BuckWoody to tell the story of the time we were arrested in Leavenworth when he did a strip-tease… 11/5/09 11:06 PM 
PaulRandal:@PaulRandal #sqlpass … during the winter yodeling competition.                                                                             11/5/09 11:07 PM 
PaulRandal:#sqlpass And btw, @BuckWoody won the yodeling competition. Very scary. Never go on vacation with that man.                                   11/5/09 11:10 PM 
PaulRandal:@AndyLeonard Tell him “No, no, the other one – the burly one that grabbed me”                                                                11/5/09 11:11 PM
PaulRandal:#sqlpass Ok, ask @BuckWoody why he’s not allowed on any Sound Transit public buses any more… there’s a story.                              11/5/09 11:12 PM 
PaulRandal:#sqlpass When they arrested @BuckWoody, he tried to claim he was Bill Gates. But the cop knew Bill had more hair.                            11/5/09 11:13 PM 
PaulRandal:#sqlpass Twitter is wonderful, interacting with (well, derailing) sessions remotely! Maybe @BuckWoody and I should co-present one next time? 11/5/09 11:15 PM 
PaulRandal:@AndyLeonard @BuckWoody’s Kung Fu is weaker than mine… #sqlpass                                                                            11/5/09 11:17 PM 
PaulRandal:Hmm – he might ‘dress up’ again. RT @mrdenny: I think @PaulRandal and @buckwoody need to come to the bar with us tonight.  #sqlpass          11/5/09 11:19 PM 
PaulRandal:#sqlpass Someone tell @BuckWoody his wife called to say he’d forgotten his meds again this morning and could I take care of him?             11/5/09 11:24 PM 
PaulRandal:#sqlpass and whatever you do, don’t feed @BuckWoody’s psychoses by letting him talk to an audience – he gets delusions of grandeur.          11/5/09 11:25 PM 
PaulRandal:#sqlpass OMG – the gerbil story! (Well, multiple gerbils were involved actually) @BuckWoody’s daughter was really annoyed. Someone ask him.. 11/5/09 11:27 PM 
PaulRandal:#sqlpass Just imagine @BuckWoody, dressed like a pest-control guy, tripping out on who-knows-what, running around a house after gerbils…   11/5/09 11:30 PM 
PaulRandal:@AaronBertrand That’s because of the Cease and Desist letter @BuckWoody had from the Animal Control folks #sqlpass                           11/5/09 11:32 PM 
PaulRandal:@AndyLeonard That reminds me – you should see tricks @BuckWoody can do with whole olives and cocktail sticks, using just his teeth #sqlpass  11/5/09 11:34 PM 
PaulRandal:That’s right. Never trust @BuckWoody. Never. RT @mrdenny: @AndyLeonard @PaulRandal I’m sure that it is a trick. #sqlpass                     11/5/09 11:35 PM 
PaulRandal:#sqlpass For finale, someone ask @BuckWoody if he can do last 5 minutes of his session after removing all his false teeth…he’s good at it! 11/5/09 11:37 PM 
PaulRandal:And you wonder why he gets arrested…. RT @SQLRockstar: @buckwoody has $5 in his pocket AND someone else’s pants on #woodyfacts #sqlpass    11/5/09 11:41 PM  #sqlpass
PaulRandal:I’m proud I had most insults from @BuckWoody. I guess. RT @sqlagentman: New blog post: Buck Woody Has Issues #sqlpass   11/5/09 11:52 PM 
PaulRandal:@TimCaylor #sqlpass will be in Seattle Nov 8-11 2010                                                                                         11/5/09 11:52 PM 
PaulRandal:@BuckWoody and I just agreed to do a joint session next year – and we’ll both wear kilts! Be afraid… be very afraid…. #sqlpass           11/6/09 12:29 AM 
PaulRandal:#1 tip for speakers I saw this year at #sqlpass – get a clicker so you can move around the stage more freely.                                11/6/09 12:31 AM  #sqlpass 
PaulRandal:Blog: RT @GFritchey: WA in system stats stands for Washington state. From @Paulrandal via Gail Shaw. #sqlpass           11/6/09 12:35 AM 
PaulRandal:Err, Scotland? 🙂 RT @joewebb: where does one buy a kilt? #sqlpass                                                                          11/6/09 12:48 AM 
PaulRandal:@joewebb It’s a neat trick. In my spotlight last year I showed how to change them in 2005+ too, in dire circumstances 🙂                    11/6/09 12:50 AM
PaulRandal:See blog TechEd Demo: Using the SQL 2005 Dedicated Admin Connection to fix Msg 8992: corrupt system tables #sqlpass      11/6/09 12:52 AM 
PaulRandal:Any Tweeps coming to our disaster recovery #sqlpass post-con tomorrow?                                                                       11/6/09 1:01 AM 
PaulRandal:#sqlpass isn’t a conference, it’s one big SQL fun-fest with a bunch of new and old friends. What a damn good time!                           11/6/09 1:04 AM 
PaulRandal:@JustAGuy0479 Cool – see you tomorrow! Are you the guy I was supposed to slap if he fell asleep in KLT’s session yesterday?                  11/6/09 1:17 AM
PaulRandal:KLT’s blog post RT @GFritchey: OH For filtered statistics, auto update of stats is useless. Do it yourself. – Gail Shaw 11/6/09 1:30 AM
PaulRandal:Our house… RT @sqlbelle: #sqlpass feels like *home* ie where else can you find a place where everyone does some kind of SQL Server work    11/6/09 1:54 AM 

And here’s the whole list in a more readable format:

Please Share This:

You may also like:

2 Responses

  1. Take a look at export-csv. You can then use Invoke-sqlcmd or just plain old sqlcmd/osql to run a BULK INSERT statement to import the csv:
    ([xml] (new-object net.webclient).DownloadString(“”)) | Select description, pubDate, link | Export-Csv -NoTypeInformation ./randal.csv

    Another option is to build up a batch of insert statements and then call invoke-sqlcmd/sqlcmd:

    $sql = ([xml] (new-object net.webclient).DownloadString(“”)) | foreach { “INSERT twitter_feeds VALUES (‘$($_.description)’,’$($_.pubDate)’, ‘$($’)”}

    There’s a few other options listed here:

  2. To eliminate the truncate description you need to remove the “FT” line and save the result to a variable, then use Get-member to see all the Properties available to you. Then, with some more PowerShell code you could move the data around and put it somewhere else…maybe a SQL table.

    One thing for sure… once you start using PowerShell, there’s no stop!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.


Subcribe to Blog Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

What I'm Saying on Twitter

Subscribe via feedburner