Scripts

Technical Article

Truncate tables with foreign keys

Truncating tables with constraints always had been a pain, since we have to drop and recreate all the FKs. I created a script that takes care of dropping and recreating the foreign keys while truncating. Please use with caution! and always respect your Data !

(3)

You rated this post out of 5. Change rating

2016-12-01 (first published: )

1,376 reads

Technical Article

Generate add / alter script for missing / different type columns

This query generate add/alter script for missing or different columns. Execute on source database and copy resultset. Execute generated script on any database (may be all customer databases) Missing columns will be created and different types will change as source schema.

(4)

You rated this post out of 5. Change rating

2016-11-18 (first published: )

914 reads

Blogs

Where Is My SQL Agent? Running Scheduled Jobs Against Azure SQL Database

By

One of the first things I review when I inherit a new SQL Server...

AgentDBA vs Critical SQL Server

By

It’s 07:43. Someone’s already left a message. “Something’s wrong with the DB server.” You...

Finally Cleaning Up Dropbox: Moving Almost a TB to Google Drive with rclone

By

I’ve had a Dropbox account for years. Like a lot of people, I started...

Read the latest Blogs

Forums

Alamat kontak resmi BCA KCP Tebet Telp:0818751777

By Halo BCA

WhatsApp:0818-751-777 Gedung Gajah Tebet, Jl. Dr. Saharjo No.Raya 111 Unit N & O, RT.1/RW.1,...

Stan Phone Number Australia +61-1800868603 Quick Help Guide

By richardrussel

When things go wrong - like trouble signing in, videos pausing, unclear charges, or...

BCA KCP Pasar Minggu Center | Tlp/Wa:0817866887

By Layanan BCA 24 JAM

Tlp/Wa_Cs:0817-866-887. Jl. Lenteng Agung Raya No.26 E-F, RT.1/RW.4, Ps. Minggu, Kota Jakarta Selatan, Daerah...

Visit the forum

Question of the Day

Detecting Characters

I have a SQL Server 2022 English default installation on a server. I want to detect if there are any upper case characters in rows and I have this code:

SELECT CustomerNameID,
       CustomerName
 FROM dbo.CustomerName
 WHERE CustomerName = LOWER(CustomerName)
Here is the sample data I am testing with:
CustomerNameID CustomerName
1              John Smith
2              Sarah Johnson
3              MICHAEL WILLIAMS
4              JENNIFER BROWN
5              david jones
6              emily davis
7              Robert Miller
8              LISA WILSON
9              christopher moore
10             Amanda Taylor
How many rows are returned?

See possible answers