Many of us work for some organization and get paid to do so. We might work for ourselves or others, but every so often we hope to get some renumeration for our efforts. For most of us, we negotiated some pay rate and then hope to get annual raises the reflect our work product.
The interesting thing that I've learned in many years of changing jobs and negotiating pay is that many of us have no idea what others doing similar jobs are being paid. There isn't a set scale of pay, unlike many other industries, and since our jobs can vary dramatically from organization to organization, despite having similar titles, we may learn that our compensation deviates dramatically from others in similar situations.
Last year SQLServerCentral ran a salary survey and then released the aggregated data. This was a quick attempt to help you understand where you might stand relative to others, and it was very popular. Brent Ozar took our survey a step further, with a more detailed set of questions and data. This year Brent has beat us to the punch, with a new survey for 2017. I encourage you to participate and help build a useful data set. I plan on doing our own in the new year, probably this month, and hopefully we'll have two good sets of data that you can review and analyze.
Most of us are data professionals, and we know that having more information helps us to make better decisions. Filling out these anonymous surveys can help others understand where they might stand relative to you and vice versa. This is the type of data that can enable you to better negotiate your own pay in the future. After all, there's nothing like presenting some data professional specific results to management to help your case that an adjustment might be needed.
You could think of the code analysis feature in SQL Prompt as a machine-assisted code review. The rules that are used to check your code point out questionable areas that might be missed during regular testing. More »
In this post, I will talk about a utility which would ease generating table scripts even by an app developer without accessing SSMS.
The advantage of this powershell utility is:
1. It allows the user to exclude identity columns in the data scripts
2. It allows the user to specify the number of rows to be populated in the data scripts.
Let me do a walkthrough !!
On executing this script, it asks for :
Mode of authentication : Windows/SQL
If mode of authentication is SQL, then it would ask Sql User name and Password
Table and Schema name for scripting
Various options for scripting
Check for object existence
Script foreign keys
Whether to exclude identity columns
Whether to limit the number of rows for data script
as seen in figure 1.0.
we get the scripts generated as shown in figure 1.1
If the user enables the feature to exclude identity columns by passing “y” to the option “Do you want to ignore identity columns while scripting data” as shown in figure 2.0 we get the output with the identity column “ResellerKey” as shown in figure 2.1
The data script contains around 701 rows and we do not put a limit on number of rows as shown in figure 3.0 and 3.1
However, we may require a subset of rows for our testing purpose. Let’s say we need just 2 rows, then we need to pass below parameters:
Do you want to create data scripts for fixed number of rows : y
Enter the number of rows required in the data script: 2
as shown in figure 4.0
We see that we got just 2 rows in the data script as showing in figure 4.1
How to use the script
Follow the below steps for executing the script:
1. Paste the powershell code mentioned in this article in a text editor and save the file with extension “ps1”, let’s say the file is saved as GenerateScripts.ps1
2. Let’s say the file is saved to a location : c:\utility\GenerateScripts.ps1, create a batch file with the name GenerateScripts.bat in the same location as the powershell file and paste below mentioned code in the batch file
powershell -executionpolicy bypass -File .\GenerateScripts.ps1
3. In order to execute the powershell, execute the batch file GenerateScripts.bat
3. After executing this utility, the scripts are saved in the same folder within the file “scripts.sql” file.
To execute the option for exclude identity columns and limit the number of rows in data scripts, the user should be a member of db_ddlAdmin or db_Owner role.
I would love to hear the feedback and suggestions on further improvements to this script !!
This newsletter was sent to you because you signed up at SQLServerCentral.com.
Feel free to forward this to any colleagues that you think might be interested.
If you have received this email from a colleague, you can register to receive it here.