Where are Sequences?–#SQLNewBlogger

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

I created a few sequence objects lately to test some things. Since I tended to create and use these, I knew the names. Coming back a few days later, with new queries, I wondered where these were stored. This post shows a few things I learned.

SSMS

Where would you think Sequences are stored. They are a weird object, with the NEXT VALUE FOR syntax being used. This feels DDL-ish. However, if we look at the Object Explorer, there aren’t a lot of choices here.

2020-05-12 10_36_03-SQLQuery7.sql - ARISTOTLE_SQL2017.way0utwest (ARISTOTLE_Steve (56))_ - Microsoft

The area that seems most promising is Programmability, and when I check here, I see them.

2020-05-12 10_37_00-SQLQuery7.sql - ARISTOTLE_SQL2017.way0utwest (ARISTOTLE_Steve (56))_ - Microsoft

If I look at the properties, I can see the settings, which is good. I especially like seeing the current value.

2020-05-12 10_37_20-Sequence Properties - MyKey

 

T-SQL

Since this is an object, it ought to be query-able from T-SQL. sys.objects is a good place to start, and when I query, I see this:

Sequence object results from sys.objects

Good, but not a lot of information here. With SQLPrompt, I do see there is another choice, sys.sequences.

SQL Prompt Intellisense with sys.sequences

If I query this DMV, I now see the same information from sys.objects at the top of the result set.

First few columns of sys.sequences

If I scroll, I can see more of the metadata I am looking for. Last_used_value is important, though I wonder what caching does here. A post for another day.

metadata for the sequence from the DMV

ADS

Azure Data Studio has an Object Explorer, but it’s not as useful, as you can see. No options to get data. In ADS, I’d query the DMV.

Azure Data Studio Object Explorer with just a Refresh option

SQLNewBlogger

This was a quick post, as I tried to find information. Once I did, which took just a minute, I decided to spend 5-10 minutes assembling this post and trying the various tools to get information.

A quick look at how I find the information. You could focus a small post in this way on some learning effort you make.

Posted in Blog | Tagged , , , | Comments Off on Where are Sequences?–#SQLNewBlogger

Other IDEs

Most of us use SSMS (SQL Server Management Studio) to manage our SQL Server instances or to write database code. However, Microsoft does give us database options with Visual Studio, VS Code, and Azure Data Studio. It does seem as though Microsoft would prefer more of us move to ADS, but I’m not sure I’m ready, and I wonder if you are.

I saw a list recently of some other tools, and I wonder if anyone uses these in their work. Most of these are cross platform, and support a number of different database platforms. Datagrip might be the most popular, but there are others. SQL Manager, Adminer, DBVis, SQLPro, and Flyspeed are ones I’ve heard of in the past. I’ve used DBArtisan at one company, and loved it as I could work disconnected. At the time, Query Analyzer didn’t support offline work.

Having an IDE that you are comfortable using is important to working efficiently. Many of us become quite used to the flow of our tool, we develop habits, muscle memory, and shortcuts that work for us. We get used to where things appear on the screen and what icons to click. Changing IDEs can be very disruptive and frustrating while you get used to a new interface. I still remember going from Enterprise Manager to SSMS and it was an annoying period of a few months as I got used to SSMS.

These days I find myself trying ADS often, but usually falling back to SSMS. I think that visually the basic HTML-like display is annoying. I have much preferred the thick client look at SSMS. It doesn’t help that some of the tools I often use don’t quite work the same in ADS. If we get a bit more of SQL Prompt in there, I might change my mind, but using the Command Palette rather than keyboard shortcuts is somewhat unfamiliar to me. What’s strange is that I like VS Code overall, and use it for PoSh, but for some reason it’s not the same with databases.

I am glad we have choice in tooling, though I don’t know that any large set of users actually use anything more than what is installed with SQL Server. I don’t know if other tools will allow anyone to produce more, or better, code, but I do know that I have found that some tools do help. It can be worth spending a bit of time experimenting with some other IDE to see if your work improves.

Steve Jones

Listen to the podcast at Libsyn, Stitcher or iTunes.

Posted in Editorial | Tagged | 2 Comments

Daily Coping 17 Jun 2020

I’ve started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here.

Today’s tip is to take a photo of something that brings you joy and share it.

I try to take a lot of pictures. It’s to capture memories of moments, of times with my family and animals. I have loved having a mobile device that makes this possible.

Here’s a recent one. In Colorado, we’ve started to open slowly. One thing that has been allowed in some places is getting together with stable groups, so those that don’t change from meeting to meeting. That has allowed me to start coaching again, not for competition, but for a release and helping my team get ready for next season’s tryouts.

We’ve had a couple practices a week, just kids, no parents, and we keep our equipment separate and clean.

20200602_122239

They’re kids, so I’ve blurred the image, but it was wonderful to see them, having some fun, hearing how excited they are and listening to their challenges.

They bring my joy and touch my heart.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 17 Jun 2020

Making a Donation to PASS

This year the PASS Summit will be virtual, though not free. Until June 19, the conference will cost $500 for the 3 day conference, $900 with precons, and $349 for a single pre-con. SQL Bits is still scheduled for September, and I wonder if they will move to virtual. Microsoft has moved all events to virtual for the next year, which puts pressure on others. The flip side is Microsoft events are mostly marketing and many other events are fundraisers for their organizations.

PASS reopened their call for speakers, which is interesting. I wouldn’t expect any speakers to pull out from the event, but perhaps I’m wrong. Or maybe they’re expanding the schedule, since I know time zones will be an issue and I suspect we’ll see some broadcasting across the 24 hour clock. To do this isn’t free, as the infrastructure and coordination of staff to make an event happen cost money. Microsoft can just lose money on staff, but for PASS, SQL Bits, and other events, they need help. Even with volunteers helping, you need some staff. Staff requires money.

This means the request from PASS this year is for every speaker to essentially donate their time to create a presentation and deliver it for little to no compensation. They can watch other talks for free, there will likely be some speaker gift, and there is some marketing and exposure from speaking at the Summit, but this is different than getting an admission to the live event. I don’t know how employers, clients, etc. view anyone’s speaking experience at the Summit, but it’s on my speaking CV multiple times and I’m proud that I’ve been able to speak there.

I didn’t submit earlier this year when the call for speakers opened. The timing was bad for me, personally, and I decided to forego attending. When the call re-opened, I decided to submit. I am happy to support the community, and a virtual event means that travel and timing is less of a factor.

I have seen some speakers question whether being asked to deliver a talk for free that will be behind a paywall is a good idea. They question if this is a fair trade for their time and effort. I think each speaker can make their own decision. I don’t mind if you speak, or if you decide this isn’t for you. It is a fair question, and there are plenty others we can debate: the financial structure of PASS, the decisions about the Summit, and the future direction of the organization.

PASS already had a deficit in their budget this year. The Summit will likely generate less money and potentially the deficit will be larger. If I can donate a few tens of hours to build a session and deliver it, and help with the financials of PASS, I am happy to do so. I plan to support a few other events later this year as well, helping organizers where I can to weather this difficult time.

Steve Jones

Listen to the podcast at Libsyn, Stitcher or iTunes.

Posted in Editorial | Tagged , | 1 Comment