Create Table DDL via TSQL
A stored procedure from longtime community member Lowell Izaguirre, returns the CREATE TABLE definition for any table, including PK, UQ, Identity, FK, Defaults, and more.
2019-04-16
17,515 reads
A stored procedure from longtime community member Lowell Izaguirre, returns the CREATE TABLE definition for any table, including PK, UQ, Identity, FK, Defaults, and more.
2019-04-16
17,515 reads
Use Powershell to query AD for Users, Groups and GroupMembers
2018-04-27 (first published: 2016-03-31)
31,117 reads
Here a quick script showing how to get all the Active Directory users in a AD group.
2017-02-24 (first published: 2016-03-17)
8,999 reads
Changing Database Collation Through Primary keys, Foreign Keys, Default and Check Constraints and more.
2016-03-07
4,364 reads
2014-08-13
2,034 reads
How to reverse engineer or script a trace for disaster recovery, or simply scripting for enhance and adjustment.
2010-03-23
2,086 reads
a stored procedure returning a single varchar(8000) of the CREATE TABLE script for any table.It does everything calculated columns, rules,indexes,defaults,triggers,constraints...everything.
2009-07-28 (first published: 2009-07-11)
852 reads
returns CREATE TABLE script for any table. including schema name,calculated columns,
indexes with INCLUDE,rules,defaults,triggers,constraints,extended properties...everything.
2009-07-11
1,921 reads
Find And Replace any string, in the entire table with this function. Parameterized for easy use.
2009-02-26 (first published: 2009-02-09)
902 reads
The default trace keeps the last 20 meg of info, and a max of 5 files...This loads all 5 files into a table so it can be reviewed.
2009-02-25 (first published: 2009-02-07)
1,276 reads
By Steve Jones
I use ConEmu for my terminal interface. I’m still on Windows 10 at home,...
Creating a Fabric workspace takes about 30 seconds. Restructuring workspaces after people have built...
By Steve Jones
It’s a small change, but a handy one. Flyway Desktop (FWD) now includes the...
Comments posted to this topic are about the item Adding new column with DEFAULT...
Comments posted to this topic are about the item Advanced Deployment Scenarios: Stairway to...
Comments posted to this topic are about the item You Need a DBA Pipeline
Which number did the two COUNT(*) return:
DROP TABLE IF EXISTS #tmp CREATE TABLE #tmp (id INT NOT NULL) INSERT INTO #tmp (id) SELECT gs.value FROM GENERATE_SERIES(1, 5) AS gs ALTER TABLE #tmp ADD my_value INT NOT NULL CONSTRAINT df_tmp_my_value DEFAULT 1 SELECT COUNT(*) FROM #tmp AS t WHERE my_value = 1 ALTER TABLE #tmp DROP CONSTRAINT df_tmp_my_value ALTER TABLE #tmp ADD CONSTRAINT df_tmp_my_value DEFAULT 2 FOR my_value SELECT COUNT(*) FROM #tmp AS t WHERE my_value = 1See possible answers