Scripts

Technical Article

Table Variable Deferred Compilation (SQL 2019)

I have explored the SQL Server 2019, Intelligent Query Processing Feature – “Table Variable Deferred Compilation”.

The script contains some theory at the top and links to read.
After that, there are required queries to run on SQL Server 2019.
This way we can see the feature in action and look at it's strengths and caveats.

3.67 (3)

2020-08-03

1,030 reads

Technical Article

Post SQL Server Installation steps with PowerShell

I bet, each DBA would change some settings after the SQL Server installation as per their company standard . I wrote this PowerShell script for one of my client who has below standards: Port should be 1433, static Disable SQL telemetry* & SQLWriter services Change recovery model to FUll for all databases except tempdb and […]

5 (2)

2020-07-02 (first published: )

1,974 reads

Technical Article

move db files to different location dynamically

Lately, I'm dealing with lots of DB migrations and came across situation that I have no proper dynamic script to move DB files to different location. There are an option to proceed manually scripting one by one DB and execute it. Another option is detach attach DB - I'm not a big fan of this […]

3 (2)

2020-07-01 (first published: )

1,445 reads

Technical Article

Insert Multiple Rows

Insert multiple rows in the table using insert syntax which is the same as single insert rows. So, we have to use value likewise, single rows than there is the same process but include coma and insert the value of another row in your query. In this paragraph, we were given a syntax with insert […]

2020-06-29

1,065 reads

Technical Article

How to register SPN for SQL service account

Check if the SPN is already registered: setspn -l domain\xxxxx If not, run below commands: setspn -A MSSQLSvc/abc.xx.companyname.com:1433 domain\xxxxx setspn -A MSSQLSvc/abc.xx.companyname.com domain\xxxxx setspn -A MSSQLSvc/abc:1433 domain\xxxxx setspn -A MSSQLSvc/ abc domain\xxxxx   Verify again, setspn -l domain\xxxxx

5 (1)

2020-06-17 (first published: )

3,365 reads

Technical Article

Monitor basic Database parameters like Recovery Model, Page Verify, Auto Close, Auto Shrink, DB Owner, Auto Create Statistics Enabled, DB Create Date etc with PowerShell command.

I have created this script for one of our client, the requirement was all the databases should be in full recovery model and should be monitored. Also, I added other important parameters like AutoShrink, AutoClose etc. Output:

5 (2)

2020-06-16

800 reads

Blogs

Daily Coping 28 Sep 2022

By

Today’s coping tip is let go of other people’s expectations of you. I think...

SQL Server In Place Upgrades

By

Good morning dear blog reader. Today’s episode is fresh from a great weekend with...

Daily Coping 27 Sep 2022

By

Today’s coping tip is take your time. Make space to just breathe and be...

Read the latest Blogs

Forums

SQL inplace upgrade from sqlexpress to standard edition in VM Google cloud

By RK2012

Hello Team, planning to do SQL in place upgrade from sql2016express to sql2016 standard...

SQL Master Data Services 2019 - Website keeps prompting for login

By Pete Bishop

I have two SQL 2019 servers running Master Data Services which are continually prompting...

Add more columns to output

By Bruin

$msg = Get-Content 'C:\miscjunk\SQL_Servers.txt' | ForEach-Object {New-Object 'Microsoft.SqlServer.Management.Smo.Server' $_} | Select-Object -Expand Databases |...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers