Author: way0utwest

  • Finding Strings

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

    A quick one today, just looking for strings. I wrote an article on this, so there’s more detail there, but here’s a bit of code you can look through and see what it does.

    CREATE TABLE dbo.MyTable ( mystring VARCHAR(200) );

    GO

    INSERT dbo.MyTable

        ( mystring )

      VALUES

        ( ‘This is a 7’ )

      , ( ‘There is a 7 in this string’ )

      , ( ‘Why must 7 always be here’ )

      , ( ‘No 7s here. JK’ )

      , ( ‘My 7s here’ )

      , ( ‘An 7s here.’ )

      , ( ‘On 7s here.’ );

    GO

    SELECT

        ‘SetPosition’ = SUBSTRING(mystring, 4, 1)

      , ‘FindThe7’ = SUBSTRING(mystring, CHARINDEX(‘7’, mystring), 1)

      FROM

        dbo.MyTable AS mt;

    DROP TABLE dbo.MyTable;

  • Open Source SQLPS

    I first saw PowerShell in 2007 or 2008 at TechEd. I was both fascinated and excited, finding the idea of using command line tools both nostalgic as well as handy. Certainly there have been a number of file based operations I’ve wanted to do in SQL Server in the past that weren’t easy to accomplish in DOS-style programming and even less easy in T-SQL. VBScript worked, but it was a very cumbersome, error prone method of developing scripts.

    PowerShell (PoSh) seemed elegant, and I was excited to have it come to SQL Server and integrate with SMO. SQLPS was released as a first step, but it was again cumbersome and poorly integrated into SQL Server. I found it to be more of a pain than a help, and abandoned using it. Since then I’ve tended to build my own scripts using techniques from our Powershell Tool Time series to help.

    However plenty of PoSh experts I know like the SQLPS module, but they want it improved. Apart from asking for a few changes in SQL Server 2016, there is a Connect item to open source the module. It’s an interesting idea, and certainly it does appear the Microsoft is unwilling to put many resources into SQLPS. If that’s the case, why not open source the tools? Is there any revenue impact?

    I’d argue that this is one of those areas that starts to exceed the scope of what MS can accomplish when it’s not a priority. Just like the opening of Windows Live Writer, allowing the community, including MS employees, to donate their own time to fixing and expanding the tool could allow this to flourish and grow, perhaps even helping SQL Server adoption.

    I’m certainly not a PoSh expert, but I’m curious. If you use PoSh, would you want a SQLPS module maintained as an Open Source product? Whether you do or not, what do you think about opening up ideas like this for public viewing and pull requests to integrate changes back into the product?

    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.

  • Building Better Software

    One of the ways in which many software development teams have tried to improve is by examining what has worked in other organizations and projects and experimenting with ideas. Across the decades that we have been using computers, there have been quite a few models, the most well known of which is the CMMI Model from Carnegie Mellon University.

    The CMMI Model contains lots of good ideas and practices, much like Six Sigma, ISO and other frameworks. However we (as a group) often don’t follow many of the ideas. It seems that so many developers (under pressure from managers) work to just complete tasks, without regards to the well known, valuable techniques of measurement, improvement, and more.

    However there isn’t much magic in using any of these frameworks. They all cover similar concepts, which are based on measuring what you do, taking that feedback to alter your process and get better, as well as then working within a structured process that is repeatable. Do more of what works, and do less of what doesn’t. Adjust your way of working regularly.

    The problem for most of us is getting a group of people to actually follow a process over and over. It seems that we continually want, at least as a large group, to cowboy code our way through development cycles, without learning from the past. Of course, I meet plenty of people that use an ALM (or DLM) process to build software, and they all espouse the benefits, but they do note that it takes a long time to adopt a new process throughout an organization. A year of investment isn’t considered uncommon.

    Perhaps that’s the problem? Can management actually make the investment time to build out better processes? The media hype says they want to, with all the DevOps hype. Plenty of companies, including Redgate Software, are selling tools that companies use to help themselves adopt a process. However I wonder how successful organizations are. Is there enough continuity in the technical staff and management to actually make a change? It took Microsoft years to change. Are you moving in that direction? Is there any chance you will?

    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.

  • The Slack Integration

    About a year ago, my group at Redgate Software adopted Slack as a way of communicating with each other. Slack has become very popular with development teams, and is used extensively in many companies, including my own. At first I liked this tool, which allows some real time communications, but also some tagging and notifications if someone messages you. However, over time, I find it less useful. Perhaps the seven hour time difference accounts for some of that.

    However plenty of people have found various ways to integrate Slack into their development process. Everything from build failures to successful deployments to mentions on Twitter. I’m not sure of the value of these myself, but I can understand that grabbing messages and centralizing them in a channel can provide value. Personally I still prefer to work through email, which gives me a nice, asynchronous, disconnected, comfortable tool.

    The other day someone asked me if we would think about integrating parts of SQLServerCentral with Slack. I wasn’t sure there was value, but then I thought, perhaps some people would like a channel with interesting or hot threads in the forums, or mentions of articles. Certainly many people like different mediums of communication, so why not Slack?

    It wouldn’t be for me, but I do wonder how many of you are using Slack and would want to to add in a new channel. Or a few channels. Maybe you’d like one with the Question of the Day and interesting notes from the discussion. Since Slack can work across companies and accounts, we certainly could open things up to you.

    Let us know today what you think of Slack and would you like any integration with the tool. How would you use it?

    Steve Jones

    The Voice of the DBA Podcast

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