Find possible missing foreign key relationships

This procedure is intended for single column primary key relationships.First we will create two table functions. The first finds a list of all tables with their primary key columns. The second finds all existing foreign key relationships with their table and column names. Finally we find all tables with primary key column names that do […]

5 (2)

2007-02-26 (first published: )

648 reads

Date String format with optional Timestamp

I find it so annoying to format dates. Sometimes I want to include the timestamp, but if it is a midnight time stamp, the time is irrelevant. Sending in a datetime will return either the date string or a date string with a timestamp up to the seconds with either AM or PM.

5 (1)

2007-01-02 (first published: )

159 reads

Blogs

Daily Coping–3 Apr 2020

By

I’ve started to add a daily coping tip to the SQLServerCentral newsletter, which is...

Data Céilí 2020 Cancelled

By

Yesterday we announced that Data Céilí 2020 has been cancelled due to the continuing...

Code from Redgate Streamed

By

I presented a session today at Redgate Streamed and did a number of demos....

Read the latest Blogs

Forums

Need T-SQL to list all tables in database that 'qualify' for Compression

By VoldemarG

Does anyone know of any existing script that would allow me to list all...

Basic SQL Question

By porterdl

I am new to SQL and I am having a hard time finding resources...

Delet old backup in azure

By abdalah.mehdoini

Hello, How to delete backups in blob storage from azure sql server VM to...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers