Experimenting with Go-SQLCMD

  • Comments posted to this topic are about the item Experimenting with Go-SQLCMD

  • If it is written in GO then that language has a nice balance of ease of use, speed of compilation, speed of execution, and testability.

    If anyone was wondering what to learn after Python then I would put GO at the top of the list.

    Does that mean that GO-SqlCmd has an easy route to being open sourced?

     

  • How about go-bcp?

    Gerald Britton, Pluralsight courses

  • Honestly, I found one of early benefits of go-sqlcmd was that it has QUOTED_IDENTIFIER set to ON by default (unlike sqlcmd) and the -I switch (to enable Quoted Identifiers in the "old" sqlcmd) has been removed; you have to put SET QUOTED_IDENTIFIER OFF; in the batch. Plus that it's also usable on ARM is great; means I can use it on my RasPi running Azure SQL Edge. 🙂

    I "upgraded(?)" to go-sqlcmd at home about a month ago, and I've honestly not regretted it. Though, I can imagine that if Microsoft want to replace sqlcmd with it, it's going to be a breaking change for a lot of people; the -P switch has also been removed, for example (for good reason!!!). I'm a but confused that they named it sqlcmd too and not g0-sqlcmd or sqlcmd-go in the command line, to avoid such problems.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • David.Poole wrote:

    If it is written in GO then that language has a nice balance of ease of use, speed of compilation, speed of execution, and testability.

    If anyone was wondering what to learn after Python then I would put GO at the top of the list.

    Does that mean that GO-SqlCmd has an easy route to being open sourced?

    It is here: https://github.com/microsoft/go-sqlcmd

  • Thom A wrote:

    Honestly, I found one of early benefits of go-sqlcmd was that it has QUOTED_IDENTIFIER set to ON by default (unlike sqlcmd) and the -I switch (to enable Quoted Identifiers in the "old" sqlcmd) has been removed; you have to put SET QUOTED_IDENTIFIER OFF; in the batch. Plus that it's also usable on ARM is great; means I can use it on my RasPi running Azure SQL Edge. 🙂

    I "upgraded(?)" to go-sqlcmd at home about a month ago, and I've honestly not regretted it. Though, I can imagine that if Microsoft want to replace sqlcmd with it, it's going to be a breaking change for a lot of people; the -P switch has also been removed, for example (for good reason!!!). I'm a but confused that they named it sqlcmd too and not g0-sqlcmd or sqlcmd-go in the command line, to avoid such problems.

    Interesting. I hope they replace the original with this, but with full backward compatibility. I hate that -P is removed, though not sure security is changed if you need a SET command.

  • Steve Jones - SSC Editor wrote:

    Interesting. I hope they replace the original with this, but with full backward compatibility. I hate that -P is removed, though not sure security is changed if you need a SET command.

    The security point is only in regards to -P being removed; the removal of -I is a security matter. The removal of -P just means you can't pass the password in the command. Instead, you are prompted for the password. So sqlcmd -U thom would then present a password prompt that hides the key entry. Like when you use sudo in bash, for example:

    Peek 2023-04-21 17-06

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • But you can pass the password as an environment variable, or you should. I can't get that working, nor do I see a pwd prompt as you see.

    To me, the biggest issue is there seems to be a split in how this works. It goes to old or new mode, and then some parameters do or don't work.

     

  • The verical resutls feature is a nice one to have. Though I have seen this in powershell with the invoke sql command(let).  Powershell seemingly decides for you to present in vertical or horizontal based on the output width.

    ----------------------------------------------------

  • One thing I like about sqlcmd is that it's always around and easy to use. I hope this becomes the default sqlcmd, but without some of the breaking changes.

    In general, I find PowerShell better, but more cumbersome, especially for quick things. Maybe I just need to add a function of some sort to my profile that works like SQLCMD.

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply