Scripting using SMO

I will be delivering a lightning talk at DataMinutes on June 7th on this topic. I thought it would help to write a synopsis of what am going to talking of on my blog post.

SMO – essentially stands for SQL Server Management Objects…this is a .net based scripting model Microsoft created to perform several SQL Server based tasks using scripts. It has been around since SQL Server 2005 and many people have written scripts using .net languages or powershell to accomplish various tasks. Using SMO is increasingly important in ‘Infrastructure as code’ world. Databases are a really important part of this infrastructure. Most of us find it easy and familiar to generate scripts using SSMS or Azure Data Studio and would prefer to keep doing it the same way. But, when you have a large code base – this can become problematic in many ways. People have varied SSMS settings that can allow room for non standard scripting. Scripting out what we create to add to our database repository becomes an additional task to do. Automating scripting using SMO helps to generate scripts that are uniform/standard in appearance and save the time lost in generating them as well.

SMO can accomplish a great many tasks within SQL server – those include backp/restore, creating agent jobs, changing server settings…on and on. I choose to focus my attention on just scripting SQL Server objects in this blog post and in my talk.

My script i will be using for this talk can be found here . My talk is at 11 am EST and the conference schedule is here. There are many awesome speakers..hope you will consider attending if you are reading this. Thank you.

Data dictionary script

I restarted speaking with New Stars of Data today – I gave a talk on Database documentation. Below is the script I created to pull metadata into an excel file if you need it. Thank you Mladen Prajdic(t) for being the original inspiration for this.

--Query to pull data dictionary from sql server metadata.
--Author: Mala Mahadevan
--Date 3/11/2021 V1.00
--Read:
--Have xp_cmdshell enabled for export to excel file
--Run on database you need metadata from
--Works on SQL Server 2012+
--Set variable @outputfilename to whatever filename you desire output to go to.
DROP TABLE IF EXISTS ##TempExportData

DECLARE @DBName varchar(100),
		@SQLStmt nvarchar(4000),
		@ShellStmt varchar(8000),
		@OutputFilename varchar(100)

SELECT @OutputFilename = 'c:\ugpresentation\datadictionary.xls'

BEGIN TRY
SELECT @DBName = db_name()	
SELECT @SQLStmt = 'USE ' + @DBName + ';'+'
	SELECT  
	''Database'' AS [Database Name],
	''Schema'' AS [Schema Name],
	''Table Name'' AS [Table Name],
	''Column Name'' AS [Column Name],
	''DataType'' AS [Data Type],
	''Length'' AS [Length],
	''Precision'' AS [Precision],
	''Scale'' AS [Scale],
	''IsNullable'' AS [IsNullable],
	''IsPrimaryKey'' AS [IsPrimaryKey],
	''Primary Key Constraint'' AS [PK Constraint],
	''IsIndexed'' AS [IsIndexed],
	''IsIncludedIndex'' AS [IsIncludedIndex],
	''Index Name'' AS [Index Name],
	''Foreign Key Constraint'' AS [FK Constraint],
	''Parent Table'' AS [Parent Table],
	''Default Constraint'' AS [Default Constraint],
	''Comments'' AS [Comments]
	INTO ##tempExportData  
	FROM sys.tables
	UNION
	SELECT
	DB_NAME() AS [Database Name],   
	OBJECT_SCHEMA_NAME(T.[object_id]) AS [Schema Name],
	T.[name] AS [Table Name],    
	C.[name] AS [Column Name],      
	UPPER(TY.[name]) AS DataType,    
	CAST(C.[max_length] AS VARCHAR(10)) AS [Length] ,     
	CAST(C.[precision] AS VARCHAR(5)) AS [Precision],    
	CAST(C.[scale] AS VARCHAR(5)) AS [Scale],    
	IIF(C.[is_nullable] = 0,''N'',''Y'') AS IsNullable,   
	IIF(ISNULL(I.is_primary_key,0) = 0, ''N'',''Y'') AS IsPrimaryKey,   
	KC.name as [Primary Key Constraint],   
	(CASE WHEN IC.index_column_id > 0 THEN ''Y'' ELSE ''N'' END) AS IsIndexed,   
	IIF(ISNULL(is_included_column, 0) = 0, ''Y'', ''N'') AS IsIncludedIndex,   
	I.name AS [Index Name],   
	OBJECT_NAME(FK.constraint_object_id) as [Foreign Key Constraint],   
	OBJECT_NAME(FK.referenced_object_id) as [Parent Table],   
	DC.name AS [Default Constraint],   
	EP.value AS Comments 
	FROM sys.tables AS T	
	INNER JOIN 
		sys.all_columns C 
	ON T.[object_id] = C.[object_id]  
	INNER JOIN 
		sys.types TY 
	ON C.[system_type_id] = TY.[system_type_id] 
	AND C.[user_type_id] = TY.[user_type_id]   
	LEFT JOIN 
		sys.index_columns IC 
	ON IC.object_id = T.object_id 
	AND C.column_id = IC.column_id
	LEFT JOIN 
		sys.indexes I 
	ON I.object_id = T.object_id 
	AND IC.index_id = I.index_id
	LEFT JOIN 
		sys.foreign_key_columns FK 
	ON FK.parent_object_id = T.object_id AND FK.parent_column_id = C.column_id
	LEFT JOIN 
		sys.key_constraints KC 
	ON KC.parent_object_id = T.object_id AND IC.index_column_id = KC.unique_index_id
	LEFT JOIN 
		sys.default_constraints DC 
	ON DC.parent_column_id = C.column_id AND DC.parent_object_id = C.object_id
	LEFT JOIN 
		sys.extended_properties EP 
	ON EP.major_id = T.object_id AND EP.minor_id = C.column_id
	--ORDER BY T.[name], C.[column_id]
'
	EXECUTE sp_executesql @SQLStmt

	--select * from ##tempexportdata
	
	SET @ShellStmt = 'bcp "' + ' SELECT * from ##TempExportData" queryout "' + @OutputFileName + '" -c -T -CRAW'
	Exec master..xp_cmdshell @ShellStmt
END TRY

BEGIN CATCH
	SELECT  
    ERROR_NUMBER() AS ErrorNumber  
    ,ERROR_SEVERITY() AS ErrorSeverity  
    ,ERROR_STATE() AS ErrorState  
    ,ERROR_PROCEDURE() AS ErrorProcedure  
    ,ERROR_LINE() AS ErrorLine  
    ,ERROR_MESSAGE() AS ErrorMessage; 
END CATCH

	

Old but not gone…

I am part of a weekly talk show we run at the TriPASS user group, called ‘Shop Talk’. Shop Talk was the brainchild of Kevin Feasel, our key user group lead..we meet on a bi weekly basis and discuss random tech topics related to sql server. Some of these are questions from our audience, and some are just ideas for discussion that one of us come up with. I am constantly amazed and grateful for how much I learn by being part of this show – from my co hosts and from the very intelligent audience we are blessed with. Last week, we discussed Brent Ozar’s blog post on ‘What SQL Server Feature Do You Wish Would Go Away?’. The recording of our discussion (this topic starts around 26:00) is here.
I am not blogging what we discussed in its entirety, the show speaks for itself there. I learned a few features, and use cases of SQL Server features that I never knew existed. Some of these are deprecated – so why is this important to blog about? It is, because if my resume says I’ve worked on this product for 20+ years – I better know what those features are as well. The topic of Brent’s post is a rather common interview question too – I’ve asked as an interviewer it once or twice myself, and I’ve been asked about it as an interviewee several times by several people. It helps to know more ways of answering it. Below are a few terms that I learned/re-learned as I had forgotten they existed, from the show.

Use cases for cursors

I did not consider cursors as among features that have to go away. Cursors are not ideal in a set based language but they absolutely have their use cases. But I heard of two use cases that I did not know of.
1 Leaky Bucket Algorithm
If we have a bucket into which water is poured in randomly. We have to get water in a fixed rate, to ensure that extra water gets out. This is possible by making a hole at the bottom of the bucket. It will ensure that water coming out is in a some fixed rate, and also if bucket will full we will stop pouring in it. So the idea is that the input rate can vary, but the output rate remains constant.

I found this cool blog post by Kevin Feasel again on not just the algorithm but a use case for it and why this use case demands cursors. Quoting from the post itself ‘  The problem is that we have not only a window, but also a floor and ceiling’ – this means using windowing functions is not possible. This is a genuine use case among others which makes it clear that cursors are needed although should be used sparingly.

2 Quirky Update
Remember the days before windowing functions? I do!! We had to do all kinds of workarounds to get running totals..there is no need for us to revisit that any more – but it helps to remember how things were done..the term ‘quirky update’ – using variables and cursors to do what windowing functions now do – came from this article by Robyn Page. Scrolling down to the code, we can see how she does it. I have used this, several times – and I recall how hard it was when you had to write SSRS reports with running totals with logic like this. This is not an argument to keep cursors, but not one to get rid of them either. We have other ways of accomplishing what Quirky Updates used to do, and that’s a good thing to remember, for sure.

Fibers Vs Threads
When Kevin asked me if I knew what fibers were – I drew a blank. I am not aware of any such term with SQL Server. Looks like this goes back all the way to Windows NT/SQL Server 6.5 days – I vaguely do remember ‘lightweight pooling’…’Fiber is multiple pieces of code set on a single thread to execute and controlled by an internal piece of code written in the SQL executable and not by Windows itself.’ This line from an old article made me laugh out loud ‘ Fibers, called lightweight pooling, should be turned on only if CPU is 100 percent and context switching is high.’ Needless to say in today’s world lightweight pooling is no longer necessary.

Numbered Procedures
I had no idea such a thing even existed..but apparently they do…and how it works is as below..you can group procedures by naming them with a <samename>;<incrementing number> as below.

CREATE PROCEDURE proc1;1
AS
BEGIN
SELECT 1
END
GO
CREATE PROCEDURE proc1;2
AS
BEGIN
SELECT 2
END
GO
CREATE PROCEDURE proc1;3
AS
BEGIN
SELECT 3
END
GO

DROP PROCEDURE proc1

The ONLY advantage of such a grouping is , apparently, the last line – you get to drop all of them with one call. I am not sure what was the motivation behind such a feature, but was glad to see it deprecated now.

Those are all the quaint/interesting things I learned during this show. Thanks for reading.

TSQL Tuesday #134 – Taking a break

This month’s TSQL Tuesday invite is from James McGillivray – he asks people to write about what they were/are doing to take a break during this crisis ridden time we are in.
Breaks are very important – it is very easy to drive ourselves deeper into work when we are working from home. I personally still struggle with guilt that am not doing enough and tend to work harder than i am in a regular office. Limitations and breaks are really important for me. Below are a few things I do in this regard.
1 Take short walks – I live near a wooded area and it is easy to take a stroll out of home up the lane and back. We get a lot of sunshine even in winter in NC, so it is an added opportunity to get some much needed Vitamin D as well. I take a lot of walks, depending on the weather – a minimum of two to a maximum of 5. I always feel fresh and invigorated after a walk.
2 Coloring books – this is a hobby I enjoy very much. I have a lot of different types of books – mandalas, landscapes, flowers…various. I take one and color it vigorously. It is amazing how much stress relief this can bring.
3 Meditation – I cannot not emphasize how important this is. I recently ran into something called ‘tapping meditation’ and use this – it is a combo of acupressure based tapping and guided visualisation on positive thoughts. I meditate twice a day, for my health and general well being.
4 Watch random television – when I am tired I tend to lean back into rewatching stuff I’ve enjoyed. That includes old classic movies and tv serials – my particular favorites are Downton Abbey and ER. I know lots of little things from rewatching these over and over and still laugh at the jokes. It helps me destress.

These are a few of my little stress breakers. Thanks for reading.

End of an Era – SQL PASS and Lessons learned

Most of my blog is filled with posts related to PASS in some way. Events, various volunteering opportunities, keynote blogging, this or that…With the demise of the organization, I wanted to write one final post but wondered what it could be..I could write about what I think caused it go down, but that horse has been flogged to death and continues to be. I could write about my opinion on how the last stages were handled, but that again is similar. I finally decided I would write about the lessons I’ve learned in my 22 year association with them. This is necessary for me to move on and may be worth reading for those who think similar.
There is the common line that PASS is not the #sqlfamily, and that line is currently true. But back in those days, it was. Atleast it was our introduction to the community commonly known as #sqlfamily. So many lessons here are in fact lessons in dealing with and living with community issues.

Lesson #1: Networking is important. Seems odd and obvious to say it..but needs to be said. When I was new to PASS I stuck to tech sessions and heading right back to my room when I was done. I was, and I am, every bit the introverted geek who liked her company better than anyone else’s, and kept to it. That didn’t get me very far. I used to frequent the Barnes and Noble behind the Washington convention center in the evenings, to get the ‘people buzz’ out of me – it was here that I met Andy Warren, one of my earliest mentors in the community. Andy explained to me the gains of networking and also introduced a new term ‘functional extrovert’ to me. That is, grow an aspect of my personality that may not be natural but is needed for functional reasons. I worked harder on networking after that, learned to introduce myself to new people and hang out at as many parties and gatherings as I could. It paid off a lot more than tech learning did.

Lesson #2: Stay out of crowds and people you don’t belong with. This comes closely on the lines of #1 and may even be a bit of a paradox. But this is true, especially for minorities and sensitive people. There are people we belong with and people we don’t. Networking and attempting to be an extrovert does not mean you sell your self respect and try to fit in everywhere. If people pointedly exclude you in conversations, are disrespectful or stand offish – you don’t belong there. Generally immigrants have to try harder than others to explain themselves and fit in – so this is something that needs to be said for us. Give it a shot and if your gut tells you you don’t belong, leave.

Lesson #3: You will be judged and labelled, no matter what. I was one of those people who wanted to stay out of any kind of labelling – just be thought of as a good person who was fair and helpful. But it wasn’t as easy as I thought. Over time factions and groups started to develop in the community. Part of it was fed by politics created by decisions PASS made – quite a lot of it was personal rivalry and jealousy between highly successful people. I formed some opinions based on the information I had (which I would learn later was incomplete and inaccurate), but my opinions cost me some relationships and gave me some labelling. Although this happened about a decade ago, the labels and sourness in some of those relationships persist. Minorities get judged a labelled a lot quicker than others in general, and I was no exception to that.Looking back- I realize that it is not possible to be a friend to everyone, no matter how hard we try. Whatever has happened has happened, we have to learn to move on.

Lesson #4: Few people have the full story – so try to hold opinions when there is a controversy. There are backdoor conversations everywhere – but this community has a very high volume of that going on. Very few people have the complete story in face of a controversy. But we are all human, when everyone is sharing opinions we feel pushed to share ours too. A lot of times these can be costly in terms of relationships.I have been shocked, many times, on how poor informed I was when I formed my opinion and later learned the truth of the whole story. I think some of this was fuelled by the highly NDA ridden PASS culture, but I don’t think PASS going away is going to change it. Cliques and back door conversations are going to continue to exist. It is best for us to avoid sharing any opinions unless we are completely sure we know the entire story behind anything.

Lesson #5: Volunteering comes with power struggles. I was among the naive who always thought of every fellow volunteer as just a volunteer. It is not that simple. There are hierarchies and people wanting to control each other everywhere. There are many people willing to do the grunt work and expect nothing more, but many others who want to constantly be right, push others around and have it their way. Recognizing such people exist and if possible, staying out of their way is a good idea. Some people also function better if given high level roles than grunt work – so recognizing a person’s skills while assigning volunteer tasks is also a good idea.

Lesson #6: Pay attention to burnouts. There is a line of thought that volunteers have no right to expect anything , including thank you or gratitude. As someone who did this a long time and burned out seriously, I disagree. I am not advocating selfishness or manipulative ways of volunteering , but it is important to pay attention to what we are getting out of what we are doing. Feeling thankless and going on for a long time with empty, meaningless feeling in our hearts – can add up to health issues, physical and mental. I believe PASS did not do enough to thank volunteers and I have spoken up many times in this regard. I personally am not a victim of that, especially after the PASSion award. But I have felt that way before it, and I know a lot of people felt that way too. Avoid getting too deep into a potential burnout, it is hard to get out of . And express gratitude and thanks wherever and whenever possible to fellow volunteers. They deserve it and need it.

Lesson #7: There is more to it than speaking and organizing events. These are the two most known avenues for volunteering, but there are many more. Blogging on other people’s events, doing podcasts, promoting diversity, contributing to open source efforts like DataSaturdays.com – all of these are volunteering efforts. Make a list and contribute wherever and whenever possible. PASS gave people like me who are not big name speakers many of those opportunites..with it gone it may be harder, but we have to work at it.

Lesson #8: Give it time..I think some of the misunderstandings and controversies around PASS come from younger people who didn’t get the gains out of it that folks like me who are older did. Part of it has to do with how dysfunctional and political the organization as well as the community got over time – but some of it has to do with the fact that building a network and a respectable name really takes time. It takes time for people to get to know you as a person of integrity and good values, and as someone worth depending on. Give it time, don’t push the river.

Last, but not the least – be a person of integrity. Be someone people can depend on when they need you. Even if we are labelled or end up having wrong opinions in a controversy , our integrity can go a long way in saving our skin. Mine certainly did. Be a person of integrity, and help people. It is , quite literally all there is.

Thank you for reading and Happy Holidays.

PASS Summit 2020 – My experience

This was the first year in 16 years for me that there has been a fall season without the PASS Summit to go to. Every year, during the fall, it has been a soul sustaining practice to pack up and head to the summit (typically, Seattle) and spend a week with friends – learning, sharing one another’s stories and just enjoying the warmth and comfort of being with people who care. This year, thanks to Covid, that was not to be. We had a virtual summit instead and most of us were skeptical on how this was going to work out.
For me personally, this year has been THE most challenging of my adult life. Health issues, losses in my immediate family due to covid and just the emotional stress of the hermit like existence with no relief in sight was beginning to get to me. The virtual summit came as a welcome relief. Below is my experience.
PRECONS:
I signed up for two precons – Day 1 on Powershell with Rob Sewell, and Day 2 on Execution Plan Deep Dive with Hugo Kornelis. Both were excellent in terms of quality and rendering. BUT, I lost 3 hours of Rob’s precon because he was on a different timezone (i knew this when i signed up but thought the recordings would make up)..and Hugo’s was packed with so much content that a re-watch (or multiple re-watches) would have helped. But the recording was limited to the Thursday of the summit. Am not sure how anyone thought people attending the summit would find time to re watch anything in this painfully short interval. I certainly could not and my learning was limited to the first attendance. I will definitely reconsider putting $$ down on a precon if this is the way it continues to be done.
SUMMIT DAY 1
It felt unusual/odd to start a day without a keynote but I got used to it and attended two great classes in the morning – Raoul Illayas on ‘Data Modernization, how to run a successful modernization project’, followed by David Klee’s class on ’10 Cloudy questions to ask before migrating your sql server’. Both classes were excellent with great Q&A and well moderated. This was followed by the afternoon keynote. It started with my friend and co chapter lead Tracy Boggiano winning the PASSion award – which was a heart warming moment. The PASSion Award had a huge, positive impact on my life and I was a bit sad she did not get to experience it in person. But she did say a few words and it was received really well by everyone in the community. This was followed by several microsoft-ies demoing cool product features – lead by Rohan Kumar. It was fun and interesting. I attended two sessions in the afternoon ‘What is new in sql server tools’ by Vicky Harp and her team at Microsoft, followed by ‘Making a real cloud transformation, not just a migration’ by Greg Low. Both were outstanding classes. In the evening I had to moderate a Birds-of-a-feather bubble on Mentoring – I had a good chat with a few friends who showed up, and made a couple of new friends as well. Overall it was a worthy day of learning and networking with few real glitches to worry about.

SUMMIT DAY 2
I started this day by attempting to reach out to a few friends – these are people I see in person and not on social media. I sent them a message via messaging option, but did not hear back. I was disappointed with how this worked. I was able to catch up on a few friends accidentally – because they were in the same class or same network bubble, but intentionally reaching out was really hard and did not seem to work very well.
I also visited a few vendor rooms online – vendors were the reason the virtual summit is possible. Vendor visits are always a big part of my in person summit attendance so wanted to make sure they were thanked. I got good responses for my visit at Red Gate and Sentry One. Some of the other vendors did not care to respond very much (maybe they did not have anyone online).
I also attended two classes ‘Normalization beyond third normal form’ with Hugo Kornelis and ‘Azure SQL: Path to an Intelligent Database’ with Joe Sack and Pedro Lopez. Both classes were outstanding in content.
The afternoon’s keynote was again from microsoft – it seemed to have content but was a bit dry and difficult to follow along. I think given how difficult this year was in general, we can forgive Microsoft this.
The absolute highlight of Day 2 , to me, was the Diversity in Data panel discussion that I was part of – with some amazing women – Tracy Boggiano, Hope Foley, Anna Hoffman, Jess Pomfret and DeNisha Malone. I have been on a few panels but this was truly well moderated by Rebecca Ferguson from PASS HQ, well attended by a number of people in the virtual summit including several of my own colleagues. It was a true honor to do it.

SUMMIT DAY 3
The last day arrived, albeit too soon. I logged in early, attended a few sessions (‘Execution plans, where do I start’ by Hugo Kornelis, ‘Getting Started with Powershell as a DBA’ by Ben Miller). The ‘Diversity, Equity and Inclusion’ keynote by Bari Miller was amazing – planning to revisit this and make more notes/probably a separate blog post. In the afternoon attended ‘Splitting up your work in chunks’ by Erland Sommarksog, and ‘the good, bad and ugly of migrating sql server to public clouds’ by Allan Hirt. Half way through Allan’s class(which was outstanding as always) I started to feel really tired/brain fried and wanted a break. There was a networking session open for late evening – so hopped on it and had a lovely chat with many friends i could not see in person. That ended a very fun week.
Following are what worked well and what didn’t:

POSITIVES

1 The platform was relatively easy to navigate – finding a class was really easy.
2 Chat rooms in classes were a lot of fun and good places to find friends unexpectedly as well. All the sessions I attended personally, except a few on friday were very well moderated.
3 PASS HQ and BoD members were freely available and it was really easy to find and have chats with them if one desired throughout the week.
4 Replaying sessions were a really good bonus treat – I wish the same was true for precons as well.
5 Having the recordings available on an immediate basis is absolutely great – watching a few this weekend and able to catch what I missed in the class. This would be very hard to do if we had to wait a couple of months for the recordings.

NEGATIVES
1 I am not sure how any vendor would make any gains out of this. Traffic in vendor rooms, when i visited, seemed low and in some cases vendor reps did not even bother answering chat messages. (I don’t blame them if the traffic was not much).
2 Transcribing/sub titling was a total mess. Granted, it made for a lot of very fun moments in many classes but the purpose of it is to help hearing impaired, don’t think it lived up to that cause at all.
3 Pre cons – esp the ones given by experts – are – to me not worth it with replay option gone in such a short time. I would have appreciated if i had the weekend to replay both my precons but I didn’t.
4 Finding individuals to chat up was insanely hard. This is especially true of people not on social media. I was very disappointed that I never heard back from many people to whom i sent messages via the platform. I don’t think they knew where to check this, I certainly didn’t. I had to largely depend on people to be there on social media or to show up in group chats (many did).

Overall, it was a worthy experience to me and especially uplifting in a time like this. I am hoping that for the next year PASS could do a blend of live and online classes and we can all make the best of both worlds. Thanks to everyone for attending and supporting the organization.




T-SQL Tuesday 132: Coping with a pandemic

This month’s T-SQL Tuesday is hosted by my good friend and data platform MVP Taiob Ali. Taiob’s challenge is very relevant to current season – he asks to blog about how we are coping with what life has dealt us during this time.

I really wondered where to start on this..because this year has stuck me with so many challenges that I never imagined I would face. I have been blessed with reasonably good health, longevity and good health in my family and a relatively low stress life other than periods which passed soon. But this year was not meant to be that. Clearly I had lessons to learn that I haven’t, and the universe decided it was time I did. My issues started well before the pandemic, around February or March, with some health challenges that seemed minor – some dental issues, digestive issues and female health related. I went through my annual physical, which came back good, and my doctor sent me home with some antacids, and also advised me to consult an orthodentist for my jaw related problems , which I had had ten years ago. I am relatively new to the Raleigh area, so had to look up a good orthodontist here, and that took a bit of time. I was still going to work as usual and coping, with the help of some OTCs and researching dentists as I went along.

By March, Coronavirus had been declared a pandemic and our office decided to let us telecommute full time by mid April. I still recall the day – I had tuned a difficult stored procedure and taken off early. I was doing some shopping at Target when my boss messaged me to ask if I could come in and look into some timeouts the said procedure was causing on production. So I decided to purchase the (expensive) purse I was looking at (that purse will remain with me for a lifetime, as it was the last in-store shopping i would do for months). I went back in to work, fixed some issues on the procedure and headed home. It would be my last visit to the office for a long time. We were asked to work from home the next day onwards, and are on telecommute since then and will be for an indefinite period of time. Going to work was an activity i enjoyed – the office is literally one block from where I lived, the people and environment was very fun to be around. I started to feel really low (in addition to the general depression the pandemic was causing) being stuck at home all the time. I spent too much time dwelling on this and forgot all about the orthodontist search, which did not serve me well. By June, the jaw problems had escalated seriously and I could not eat anything without severe pain and distress. I was put on a jaw appliance and advised no solid food. I lost 10 lbs in two weeks and with great difficulty managed to find an odd combo of things to eat which did not hurt the jaw and provided some degree of nutrional support. The pain subsided in five weeks but only subject to the jaw appliance being in place. I am seeing another orthodontist to get further advice. But the combo of all this has led to a ton of health issues, esp digestion related. I won’t say much on that except that am getting treated and it will be slow but surely heal.

In the meantime -I lost 3 beloved relatives to Covid. I am not good with emotions in general, and being stuck with so much was unbelievably stressful. Thankfully, the amazing therapist I had in Louisville who helped me cope with my mom’s untimely death was available on telemedicine. I was able to process some emotions and grief with his aid. I can’t say am still through with it but am able to manage and be functional.

I can write a few more pages on my own story, but I think this is enough for people to get an idea. My lessons are as below..these are not things that I did not know but now I know really well and hope other people will consider:

1 Your body and mind are your vehicles to living and well being. Make it #1 priority to take care of them. Having a fun job that you enjoy does not mean you are doing this – a lot of us as techies think being absorbed in work means we are having a great life – what we neglect in the process can hit us hard, especially as we get older. Force yourself to log off when you are done, get that annual physical/exercise/dental appointment/nutritionist appointment in.
2 Stay in touch with family, especially elders – make the best of the time you get with them, even if it is virtual. We don’t know how much we have left and it is good not to have any regrets around this.
3 If you are going through chronic pain/discomfort, develop ways to focus on something – whatever gives your mind a way away from it. I take short walks, look at picture books with scenic pictures, old photo albums and various.
4 Get a therapist or a friend to do a healing visualizing meditation – there are lots of such meditations available but a personalized one , with scenarios that you want to happen are very helpful. I use the one my therapist made for me every day and it helps me, a lot. Some people who are religious may also be able to use prayer in this manner.
5 Last but not the least, stay safe through it. This means a lot of stress in of itself. I know several friends and family membes who have gotten the virus, including some who are very healthy. Nobody thinks of it as trivial. Mask up and limit exposure to any place with people.

‘THIS TOO SHALL PASS AWAY’…is a wise line that has helped me many a time. It is a line to ponder repeatedly. We will get through, it will all be fine. Peace be with everyone.

T-SQL Tuesday 131: Data Analogies, or: Explain Databases Like I’m Five!

This month’s TSQL2sday is hosted by one of my favorite presenters, Rob Volk. His challenge for us is to use analogies and explain a database concept like you would to a five year old. I love this idea..because so many of us techies have challenges with getting down-to-earth and simple when it comes to explaining things. We often assume other people are at the same level as we are.
I have many examples but the first one that came to mind to me, was a question my Dad asked me many years ago. He was sitting next to me while I was at work, and saw me get to my work using multiple passwords – first, unlocking the laptop. Then logging in to work on vpn. Then, logging in to the sql server I had to be on. His question was – why do you need so many, isn’t one enough?
I had to explain this using the example of security he had at home, where he lived. His bedroom has a lock.It is to ensure his privacy, and he keeps documents and various things there that he does not want everyone in the house to have access to. The house has a lock…for obvious reasons, of course. We don’t want any burglary or any strangers entering it easily. The community he lives in is a gated community, with a security guard at the gate. Only residents or their authorized guests can enter. Again, for obvious reasons..they don’t want strangers or loiterers in there. Why are so many layers necessary?
Each layer has its own vulnerabilites. There are people within the community who may be security risks. I can have things on my laptop that are personal and I don’t want to get in to work directly without an additional layer that protects the work environment from any accidental breaches I may have. There are people in house who may be guests or other friends and he may not want them to look at all the stuff in his room. I certainly don’t want everyone at work to have access to what I have, as a DBA, that can cause considerable damage. The individual strengths of each layer also cover any gaps that other defenses may have. The fewer the number of people who have access the more secure whatever it is you are securing may be.

Thank you Rob, for hosting.

Azure SQL Championship

There is no doubt that this is a time when we all have to be extra aware and work towards keeping our skills aligned with market needs. During this time of great crisis, the last thing we want is to lose our jobs or not have the skills necessary to land a new one. Multiple articles and research studies have been done on growing demand for cloud computing skills. Azure is undoubtedly among the fastest growing platforms for cloud – as this article from Dice.com says having Azure skills increases your potential to be marketable significantly.
Learning can be drudgery, it can also be fun. One of the fun ways to learn Azure is to take part in Azure SQL Championship – a joint attempt by Microsoft and PASS to promote Azure learning. From October 12-30, there will be daily quizzes/simple challenges to solve. If you do it right you have a chance to win some fabulous prizes as below:

GRAND PRIZE

  • Admission to PASS Summit Conference 2020.
  • Admission to PASS Summit Conference 2021 (3 days). Plus up to $3k for travel, accommodation + expenses.

SECOND PRIZE

  • PASS Summit 2021 Speaking Session.

THIRD PRIZE

  • A Raspberry Pi Kit, Azure SQL Revealed e-book, Azure branded items.

This is a great opportunity to get some skills in and also participate in a community event. Please consider doing it!! Will be blogging/share more in the days to come. Thanks for reading.

Being seen and why PASS helped

One of my colleagues/friends read my earlier blog post on the future of PASS and said he was not aware that being seen as a minority person was among my reasons for supporting them. In this one I want to explain that a bit more.
There is a strongly held belief in the tech community atleast that volunteers should not expect anything, including recognition. Theoritically, this is true. Volunteering is based on the concept of doing good without expectations and those should include recognition. But we don’t live in an ideal world.
I have been at many tech events not associated with PASS as a regular attendee. I knew what was being talked about, I wanted to participate – but it is insanely hard. I could be a pillar, or a book shelf, to the many men there.
The tech industry is hugely white male dominated – and those of us ‘others’, if we have to be seen, need some sort of prop identifying what you did, and perhaps, that you did it well. It may be an award, or it may just be a digital badge. Or it may be you sitting at a table with a table cloth or swag that is familiar looking to the people going by. People stop to ask details about the user group. Then they ask about what I am doing for them. Then, perhaps about other chapters or conferences or whatever else PASS has. It is a gain, for me, and for PASS. The same thing goes for digital badges on my resume. Below is an actual conversation during an interview, when the interview saw the ‘regional mentor’ badge.
Interviewer: So, what does a ‘regional mentor’ mean?
Me: It means I get to mentor and help chapter leaders on various aspects of what they do.
Interviewer: I see, so what are the chapters you mentor?
Me: In southeast region, I mentor 6 chapters (I list names).
Interviewer: Oh there is one in Greenville? I did not know that. We have another office there, I must ask our staff there to go. So I suppose you got to become regional mentor by being with them for some time and leading chapters yourself?
Me: Yes. I have run my own chapter for ten years in Louisville.
Interviewer: That tells me a lot about initiative!

That’s typically how it goes. Below are the ‘badges’ I have received doing various things for PASS. If PASS goes away, all this goes with it. Many people like me wil not have any props, any means to start a conversation or let others know what they are capable of. Please consider registering for the virtual summit, help us save the organization and sustain efforts at helping people succeed.