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

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

160 reads

Blogs

Daily Coping 8 Jul 2020

By

I’ve started to add a daily coping tip to the SQLServerCentral newsletter and to...

Don’t be afraid of No

By

How many times have you been afraid to hear “No”? We have all been...

Spark .NET - Spark ML TF-IDF

By

Spark ML in .NET for Apache Spark Spark is awesome, .NET is awesome, machine...

Read the latest Blogs

Forums

DBCC CHECKDB output

By stevec883

I ran a DBCC on a database and it found some anomalies. Just looking...

Why is sys.master_files showing the size of RBS files as 0?

By hurricaneDBA

Dear Everyone I hope you are all safe in these strange times. I am...

In where condition use column value which contains column name

By rohit.kumar.barik

Hi Team, Greetings! I have below table. let table name =Emp I need to...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers