Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
Featured Script
Redgate SQL Compare
The Voice of the DBA
 

Learning to Stop Being a Hero

A few weeks ago I re-published a piece on whether we might be giving too much of ourselves for our employers. At the time I was on holiday with my family and since this was a popular piece years ago, I decided to run it again. I was surprised at the response, with quite a few individuals writing about their experiences in their current positions.

A good friend of mine read the editorial and then sent me a link to a post by Paul Cunningham that looks at the IT hero. This talks about some of the ways in which we put ourselves out as employees. It's a good read, and it's certainly something to think about when you look for a new job. When I talk about finding a dream job, I'm not talking about a specific job or career path, but rather, what's the right fit for you. That might not be the job I want, or even that your friends want. It's the job that you'd want.

To find your job, you really need to think about more than the work, the company, the location, or benefits. Instead, think about everything and start to rate those items against each other. A friend always tries to scale everything to some monetary value to make it easy to compare jobs. You can put a value on a 5 minute commute v a 45 min commute by thinking of the cost of time. Same for other benefits. Perhaps you can even do this in terms of future opportunities. You certainly can do this in terms of expected work week, on call time, and more.

What you don't want to do is let an employer take advantage of you by asking for a lot more of your time than you feel comfortable giving for the salary. Most of us are happy to pitch in when extra work is needed. I've seen this in restaurants, lawn care, and IT. What we don't want to do is get taken advantage of when extra work is required on a regular basis. You don't need to be a hero to be successful.

Perhaps the final caveat in all of this is that you can't control how all employers treat or view employees. Sometimes you might take a job that isn't a good fit because you need a job, or maybe because you're trading a poor situation for some experience. Just be sure you know you're making that trade.

The other thing I'd note is that finding a dream job, or maybe just a job that fits your life well, means you need to be able to compete with the others wanting that job. Work on improving your technical and soft skills to ensure that when the time comes, you are in the best position to get that job.

Steve Jones - SSC Editor

Join the debate, and respond to today's editorial on the forums

Redgate SQL Change Automation
 
 Featured Contents

A DBA's Look at the Data Catalog

BrainDonor from SQLServerCentral

A data catalog is a way of classifying and adding metadata about the information in your database for compliance purposes. Take a look at how one DBA is using Redgate's Data Catalog.

Data privacy: don’t look forward, look back

Additional Articles from Redgate

What does Amazon’s Alexa have to do with a wiretapping law from the 1960s? With all the talk about new data privacy legislation, we don’t stop to think about existing laws. Legislation like the GDPR kick-started the way the world views data privacy, and this blog post explores how existing laws are being used in new ways around the globe to enforce similar protection.

The End of SQL Server 2008 and 2008 R2 Extended Support

Additional Articles from SimpleTalk

Many organisations still run their companies on SQL Server 2008 or 2008 R2. There are many reasons to upgrade, but the most pressing reason is that extended support is running out. In this article, Brian Kelley explains what this means, tells you about some of the features you’ll gain if you upgrade, and provides some options.

From the SQL Server Central Blogs - Introducing sp_AzSQLDBPermissions (Beta)

Kenneth.Fisher from SQLStudies

I’ve written a version of my permissions scripts for Azure SQL Database. It’s still in Beta but I’m confident enough ... Continue reading

From the SQL Server Central Blogs - Understanding Columnstore Indexes in SQL Server Part 1

SQLEspresso from SQLEspresso

Recently I reviewed filtered indexes, this time let’s look at columnstore indexes. These indexes are very useful for data warehouse workloads and large tables. They can improve query performance...

 

 Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

Getting the Options

What is returned by @@OPTIONS?

Think you know the answer? Click here, and find out if you are right.

 

 

 Yesterday's Question of the Day (by Steve Jones - SSC Editor)

Making a DataFrame

I have two lists in Python:

>>> a
['Ford', 'Chevrolet', 'BMW', 'Audi', 'GMC', 'Porsche', 'Toyota', 'Honda']
>>> b
['F150', 'Suburban', 'X5', 'Q5', 'Tahoe', 'Cayenne', 'RAV4', 'CRV']

I want to combine these in a dataframe, with the columns for make and model labeled correctly. Which of these will do this?

Answer: df = pd.DataFrame({'Make':a, 'Model':b})

Explanation: There are multiple ways to do this, but the Pandas method, DataFrame, will allow you to put two lists together. When you want the column names, we send in a dictionary with the column name and list as a dictionary. Ref: Intro to Data Structures - https://pandas.pydata.org/pandas-docs/stable/getting_started/dsintro.html

Discuss this question and answer on the forums

 

Featured Script

Creating an Automated Database Update\Upgrade Script with RedGate SQL Compare Command-Line and Powershell

thedspaincrew from SQLServerCentral

A script to drive SQL Compare for building upgrade scripts.

##change to SilentlyContinue to remove write-debug output
$DebugPreference = 'Continue'

## this is the filepath to a local directory. change to a directory on your box. Better to write the files locally and then copy to the network share. This process only writes once to the network share
$outfile_for_script = ''

##Clean up any old files before the process starts
Write-Debug 'checking if script needs to be deleted'
if ((get-childitem $outfile_for_script).count -gt 0)
{
Remove-Item $outfile_for_script*.sql
}

##For this process to work you must set the directory to the location of the SQLCompare.exe
Write-Debug 'set location of sql Compare'
Set-Location "C:Program Files (x86)Red GateSQL Compare 13"

# filter ..tables
Write-Debug 'Compare tables...'
.SQLCompare.exe /Sourcecontrol1

/revision1:HEAD

/sfx:""

/server2:""

/u2:

/p2:

/db2:

/filter:"C:SQL CompareFiltersTables_filter.scpf"

/include:Identical

/Options:ie,ip,f,oec,iup,iu,nc,ndl, dacia

/scriptFile:"$($outfile_for_script)script.sql"

/Force

/Quiet

Write-Debug "create drop of dependent sps and then drop types"

##print a delineation between each script creation
'-------------------' | Out-File $outfile_for_scriptscript.sql -Append -Encoding utf8
'-------------------' | Out-File $outfile_for_scriptscript.sql -Append -Encoding utf8
'-------------------' | Out-File $outfile_for_scriptscript.sql -Append -Encoding utf8
'-------------------' | Out-File $outfile_for_scriptscript.sql -Append -Encoding utf8

##QP_Upgrade_Drop_Types_And_Dependencies.sql script finds dependent SP and drop then drops types
get-content Upgrade_Drop_Types_And_Dependencies.sql | Out-File $outfile_for_scriptscript.sql -Append -Encoding utf8

[string]$date = (Get-Date -format MM_dd_yyyy)

##create a new filename with date time and version designation
$path = "$($outfile_for_script)"
$version = ''
$filename = "_Upgrade_$($version).SQL"

$scriptpath = $path + $date + $filename

Get-Content "C:$($outfile_for_script)script.sql" | Out-File $scriptpath -Encoding utf8

Write-Host "move new upgrade file from $($scriptpath) to "

copy-item -Path $scriptpath -Destination \network_share

More »

 

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.


SQL Server 2017 - Administration
Need connect string to connect from Linux to SQL Server using an A/D group name - ISO way to setup a connection string to connect from Linux to SQL Server using an A/D group name. (we do NOT want to use a SQL Login!) - this link details the setup for a Linux connection to a SQL Server database: https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-SQL-Server-from-Linux - one of the final instructions during setup is to add […]
SQL Server 2017 - Development
How to split time into hourly slot using SQL (can use view,or stored proc or fun - I have data in table which has start date, end date and duration. I want to show hourly time slot. **logic**: - Condition 1. If start date =9:00 and end date = 11:00 then show the date as 09:00-10:00 10:00-11:00 It should repeat 2 times and all related column data will also repeat 2 times. […]
SQL Server 2016 - Administration
SQL Cluster - I am looking at a Cluster that has been built by a person that during the SQL Cluster installation he did not select all CSV's that related to the instance.  This has meant that the storage fails over independently which is not ideal.  there has been a case that two of the required volumes were […]
Admin puzzler - ok so Friday off I get a call from user doing  posting taking over an hour( should take 5 minutes).  No blocking do deadlock no high CPU.  Active sessions show higher reads than normal.  No open trans.  Go to mgmt. studio and when I try to open objects on main pharmacy database it times out.  […]
SQL Server 2016 - Development and T-SQL
Using @@ROWCOUNT To Return Second Recordset in Sproc - I'm working with a Stored Procedure that hopefully will return two recordsets to a Classic ASP application. Currently, when I test my Stored Procedure, @@ROWCOUNT always returns the count of 1, even when the count is not 1. Here is my code for the Stored Procedure (below). Would I need to return the @row variable […]
Problem to Display Field With OPENXML - Hello community, I am trying to Importing and Processing data from XML files into SQL Server tables, following the example post on this site : https://www.mssqltips.com/sqlservertip/2899/importing-and-processing-data-from-xml-files-into-sql-server-tables/ by Arshad Ali. This is the first time i use this technique, then i put only one filed to display, but i dont know why the result is always […]
Administration - SQL Server 2014
Auto Shrink on live DB - Hello, On one of our customers' live server there are both live and UAT DBs. The latter occasionally replicated from the live DB upon customer's request. All has been done and maintained by DBA's.  When such a copy generated I am normally required to truncate several of our biggest tables (some over 100 MBs), which […]
SQL Server 2005 Installation After 2014 as Default Instance on Win Server 2012 - Greetings! Did anyone notice the anomaly as in below screenshot? When tried to install SQL Server 2005(bare version 9.0 - No SP) after SQL Server 2014(version 12.0) is already installed, the SQL 2005 threw error showing SQL 2014 installation as SQL 2000. OS : Windows Server 2012 X64 SQL Server 2014: Developer X86 SQL Server […]
Development - SQL Server 2014
Stored Procedure with Parameters in Excel - Long Run time - I have a stored procedure with two date variables, Start date, End date. If I run this in excel, it takes forever and eventually deadlocks. ALTER PROCEDURE [dbo].[lost_sales_v2] @SD datetime, @ED datetime If I take the variables out of the procedure name and embed a set date range in the query, it returns in less […]
SQL 2012 - General
Using Correlated Queries with OPENQUERY - Good day everyone,   I'm new to this forum and was hoping I could get some help with what I'm trying to accomplish. I'm trying to delete old users from each respective database from a list I have. Now I'm using SQL Server 2012 to do this, but the databases i'm connecting to are in […]
SQL Server 2012 - T-SQL
Index Size Question - I'm trying to track down storage usage on our SQL Server 2012 instance.  I have a table with 11,703,018 rows and 10 indexes (9 non-clustered + PK) on it.  The PK is a clustered uniqueidentifier (I know not the greatest but i'm stuck with it for now) that only has the uniqueidentifier column included (size […]
Find time different based on Type by making group - I have data like attached picture, I want to make group each event when it starts from 1 and end till its max of eventId = 14 and calculate the time difference ... as shown in picture. If there are 8 EventType with 1 then it should have max of 8 eventType with EventType 14. […]
SQL Server 2008 - General
Unable to load text data in using BULK INsert with XML Format file - I have the following table   IF OBJECT_ID('[TempDB]..[#LoadData]') IS NOT NULL DROP TABLE [dbo].[#LoadData]; CREATE TABLE [dbo].[#LoadData] ( [RTOPartyID] INT NULL , [Prefix] NVARCHAR(255) NULL , [FirstNames] NVARCHAR(255) NULL , [LastName] NVARCHAR(255) NULL , [Suffix] NVARCHAR(255) NULL , [PartyType] NVARCHAR(255) NULL , [PlaceOfBirth] NVARCHAR(255) NULL , [TaxIdentificationNumber] NVARCHAR(50) NULL , [CrownServant] BIT NULL , [DateOfBirth] […]
Replication DB name - Hi, Supposing we would like to replicate a copy of a DB, called DB1 to another server. Does the database need to be called DB1 on the subscribers or does that not matter?
Powershell
Something akin to GROUP BY in SQL - So I have an array: $array = @() $Props = [ordered]@{Table="Table1"; Col1=1; Col2=2} $array += New-Object psobject -Property $Props $Props = [ordered]@{Table="Table2"; Col1=4; Col2=5} $array += New-Object psobject -Property $Props $Props = [ordered]@{Table="Table1"; Col1=3; Col2=7} $array += New-Object psobject -Property $Props $Props = [ordered]@{Table="Table2"; Col1=2; Col2=6} $array += New-Object psobject -Property $Props I want to […]
 

 

RSS FeedTwitter

This email has been sent to {email}. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. This newsletter was sent to you because you signed up at SQLServerCentral.com.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
webmaster@sqlservercentral.com

 

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