Find Primary Column of all tables in database
This code helps in finding Primary Keys for all tables in a database.
2012-10-02 (first published: 2012-09-04)
1,436 reads
This code helps in finding Primary Keys for all tables in a database.
2012-10-02 (first published: 2012-09-04)
1,436 reads
Output table of gaps in a primary key across multiple databases on same, remote and/or linked servers.
2012-02-13 (first published: 2011-08-12)
947 reads
This is the first of a series of articles to analyze the use of surrogate keys in different scenarios.
2010-10-25
14,031 reads
2010-07-15
3,937 reads
Following script will list out all the columns which have unique/primary key constraints for a given table.
2009-01-02 (first published: 2008-12-10)
1,270 reads
2008-11-04
1,954 reads
Every organization I talk to has the same problem dressed up in different clothes....
By DataOnWheels
I am delighted to host this month’s T-SQL Tuesday invitation. If you are new...
By alevyinroc
Ten years (and a couple jobs) ago, I wrote about naming default constraints to...
Comments posted to this topic are about the item The day-to-day pressures of a...
Comments posted to this topic are about the item Using OPENJSON
Comments posted to this topic are about the item Data Modeling with dbt for...
I have some data in a table that looks like this:
BeerID BeerName brewer beerdescription 1 Becks Interbrew Beck's is a German-style pilsner beer 2 Fat Tire New Belgium Toasty malt, gentle sweetness, flash of fresh hop bitterness. 3 Mac n Jacks Mac & Jack's Brewery This beer erupts with a floral, hoppy taste 4 Alaskan Amber Alaskan Brewing Alaskan Brewing Amber Ale is an "alt" style beer 8 Kirin Kirin Brewing Kirin Ichiban is a Lager-type beerIf I run this, what is returned?
select t1.key
from openjson((select t.* FROM Beer AS t for json path)) t1 See possible answers