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 4 Jun 2020

By

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

SQL Homework – June 2020 – DML Triggers

By

Triggers. Blech. Triggers are a really really cool feature of SQL Server, that are...

Backup your SQL instances configurations to GIT with dbatools – Part 2 – Add parallelism

By

We have seen how we can export and save the results to a folder...

Read the latest Blogs

Forums

Date Join Issue

By nymets86

I joined two tables together trying to get a field out of one and...

estimated execution plan

By sizal0234

  I have an SP which is truncating a table and then insert into...

optimizing SSIS package

By sizal0234

  I am trying to optimize an SSIS package which has multiple streams..so step...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers

Question of the Day

Minus Query

See possible answers