Author: way0utwest

  • Running Powershell with Task Scheduler

    Another post for me that is simple and hopefully serves as an example for people trying to get blogging as#SQLNewBloggers.

    One of the things I needed to do with my SQL Saturday download process was run this automatically. I don’t want to remember to do this, so I decided to set this up on a schedule.

    I ran a quick search and it seemed to be a simple process. Essentially I run the Task Scheduler application and then call my script as a parameter to the PowerShell exe. The first step is to run Task Scheduler.

    2015-11-05 11_43_36-Task Scheduler

    This has a list of jobs, which I found some to be interesting. I disabled Adobe and a few others. Those are really annoying. I clicked "Create a basic task".

    2015-11-05 11_43_47-Task Scheduler

    The basic task is a wizard to walkthrough. First enter a name and description. Use something that will help you in 5 months when this breaks.

    2015-11-05 11_44_07-Create Basic Task Wizard

    I decided to run this daily. It’s not a big deal to me, so I’ll let it just go.

    2015-11-05 11_44_16-Create Basic Task Wizard

    The time doesn’t matter, and I let it run in the middle of the day. This way I might notice it running sometimes and that will motivate me to keep working on this process.

    2015-11-05 11_44_22-Create Basic Task Wizard

    I want to run a program, so I choose that in the next step.

    2015-11-05 11_44_29-Create Basic Task Wizard

    The dialog wants to know which program. In my case, I’ll have to browse to my PoSh code.

    2015-11-05 11_44_36-Create Basic Task Wizard

    I pick my code and it puts the path in here. However that won’t run as is. If you’ve used PoSh, you know this doesn’t work.

    2015-11-05 11_44_44-Create Basic Task Wizard

    What I need to do is call powershell.exe. I found this in the reference item below and what I do is add "powershell" to the front of my file, and then use the "-file" parameter. I also enclose my PoSh script in quotes.

    2015-11-05 11_44_58-Create Basic Task Wizard

    When I click next, I get the warning, which I accept.

    2015-11-05 11_45_05-Task Scheduler

    There’s a summary after this, but I say OK to that, and then run the script from the Task Scheduler. It works perfectly, so I stop there.

    Now we’ll see how it works over time. And if I get the next step working.

    SQLNewBlogger

    This was a quick process for me. A google search, a 2 minute read, and then 2 minutes to build the task.

    It took maybe 10 minutes to write this post, most of which was taking the screen shots and resizing them.

    You can do this.

    References

    I just used one link, which was from the Scripting Guy blog.

  • An Inconceivable Scale

    One of the talks I give on SQL Server deals with unstructured data. I start out this talk looking at the scales of data we deal with and was been amazed by the research I did about how much data we humans have created. What’s even more interesting is that the growth is outracing predictions made just a few years ago.

    When I started working with computers, we talked about kb of data, thousands of characters. That’s an amount of data we humans can easily comprehend. In fact, we used to talk about floppy disks and the number of average sized books that could be stored in kb, or single digits of MBs. As humans, we can comprehend that scale. Most of us have seen hundreds or thousands of books in a library.

    When we move to GB, things get harder, though at 4GB for a DVD, many of us can conceive what multiple GBs can mean. However terabytes? Can we conceive the scale of data? Sure. A TB is about 40 Blu-ray disks. While we might not appreciate how much data that is, we can picture it.

    A PB? That’s 41,000 Blu-ray disks. I can’t even conceive of what that looks like, much less imagine the billion MB sized pictures.  That’s a scale that has no reference. However as humans, we will create multiple exabytes of data this year. As individuals working with data, few of us will work with EB in our organizations, but some of us will. I read recently that Paypal processes 1.1PB of data regularly. Regularly processes, not just has in cold storage.

    We have zettabytes and yottabytes, but who could possibly conceive of what those mean? There’s not frame of reference I can imagine, though that may change. I expect that we will become used to PB at some point, just like a TB is no big deal right now. In fact, I really think I’ll see a TB on my phone sometime before the end of this decade.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 2.8MB) podcast or subscribe to the feed at iTunes and LibSyn. feed

  • Building Better Communication Skills

    This editorial was originally published on Jan 11, 2011. It is being re-run as Steve is on vacation.

    I think that one of the most valuable skills that someone in technology can have is the ability to communicate with others. It doesn’t matter whether you write code, rack servers, or sit in meetings with business people, it is important that you find a way to express clearly what you want, need, or would expect from someone else. If you can’t, you will find that you often struggle to get anything accomplished in an efficient manner.

    It’s possible that you can get by with verbal communications in many instances, but it seems that so much gets done by written communications of some sort. Especially these days where it seems that so much of the interaction between people takes place through email, IM, or even Twitter. We are constantly using some form of written text to convey information between each other.

    However it seems that many people don’t place a premium on building better writing skills. When I talk to many people at SQL Saturdays, most of them are hesitant to try something like blogging. The most common complaint: I hate writing.

    But we have to do it constantly at work and working on your writing skills will not only help you to communicate better, but it will also help you learn to better organize your own thoughts. You will have a better understanding of the logical thought process, which might even help you build better code.

    Steve Jones

     

  • #SQLFamily Feud

    I’ve started a new project. Actually, I started this well over a year ago, but I lost track of it and last week, despite the craziness, I was reminded of the effort and decided to get it going.

    What is the Game?

    A few of us were chatting about fun things at events and someone came up with the idea of Family Feud.  I thought it was great and started collecting questions. I then began organizing them, thinking I’d send out the list to 1000 people and get lots of responses.

    We would have the data available, and distribute it to someone at an event, such as SQL Saturday, and allow them to run a game. A game typically is two teams competing against each other, trying to give the top answers to a particular questions. Sometimes there are 4 answers, sometimes 6 or 7, but the idea is to get three of the answers for a team to win points. The first team to buzz in, or in this case, maybe signal the moderator gets to answer, each person in turn.

    Three wrong answers and the other team gets one chance to answer and win the round.

    I envision that we’d allow each group to collect points in maybe two rounds, and then we’d have a final round. The final round is one person from each team answering a set of questions. I’d say we do 5 to keep it quick. The second person doesn’t hear the first person’s answers, and together they need 200 points, with the count of survey answers matching their answers being added to each sum. Duplicates are not allowed.

    It’s a little cumbersome to explain, but watch the show on YouTube to get an idea how it works.

    Delays and Distractions

    However, I wanted to narrow the field, and didn’t want to send this in the SSC newsletter to everyone. Perhaps that was a mistake, but in compiling my list of people, I got distracted. Building a large group to email to is tedious, and despite some OCD on my part, I also have a little Short-Attention-Span-Syndrome.

    I had a soft launch last week, posting the first survey on Twitter and getting 100 responses in a few hours. That was kind of cool.

    I’ve got 6 surveys, which is a good start. I’m thinking if this works, that I’ll look to run additional surveys and collect more data that can be used in the future.

    What’s Coming?

    I am planning to randomly announce surveys on the @SQLServerCentrl and @way0utwest Twitter accounts this week to try and get more responses, but distribute them around the entire #sqlfamily.

    If you want to participate, watch out for the #sqlfamilyfeud hashtag later this week and send your answers in quick.

    If you’re an event organizer and want a copy of the datasets, feel free to ping me.