Scripts

Execute on DMVs without user having View Server State

Wanted to share this script to the community just in case anyone out there may be search for a way to allow a hosted customer the ability to query certain DMVs for information without granting them View Server State. There are some other options out there, but this worked better for me after going through […]

2020-09-24

421 reads

Fiscal/Retail 4-5-4 Calendar Function

This function returns a 3 year calendar based on a 4-5-4/5-4-4/4-4-5 calendar, also known as a 52/53 week calendar.  The basis of this calendar function was derived from the NRF retail calendar published at https://nrf.com/resources/4-5-4-calendar and the Wikipedia article published at https://en.wikipedia.org/wiki/4%E2%80%934%E2%80%935_calendar. The calendar function requires 2 helper functions.  The helper functions were derived from […]

2020-09-21 (first published: )

484 reads

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

597 reads

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: )

784 reads

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: )

647 reads

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

388 reads

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: )

1,351 reads

Blogs

Would You Pass the SQL Server Certifications Please? What Do You Mean We're Out?

By

I have held various certifications through my DBA career, from CompTIA A+ certification back...

PASS Summit 2020 Mental Health Presentation Eval Comments

By

I first starting presenting on mental health last December in Charlotte, NC on mental...

PASS Summit 2020 Mental Health Presentation Eval Comments

By

I first starting presenting on mental health last December in Charlotte, NC on mental...

Read the latest Blogs

Forums

Ideas for Auditing

By Tava

I'm currently looking to design some auditing on my SQL application and am wondering...

Set Variable to lookup first row value with white space in property name

By jdlayton83

Hi, How can I set the value of a variable from a Lookup activity...

How to aggregate Dimension values properly

By ktflash

Ahoi, im trying to deal with a user request to combine 2 values of...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers

Question of the Day

WHILE in R

See possible answers