Skip to content

Instantly share code, notes, and snippets.

View lest-xu's full-sized avatar
🌴
On vacation

lest-xu

🌴
On vacation
  • United States
View GitHub Profile
USE MyDB
Go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('"Order"') and o.name = 'FK_ORDER_REFERENCE_CUSTOMER')
alter table "Order"
drop constraint FK_ORDER_REFERENCE_CUSTOMER
go
@lest-xu
lest-xu / BubbleSort.sql
Created February 8, 2018 16:12 — forked from max-mulawa/BubbleSort.sql
Bubble Sort in T-SQL
IF OBJECT_ID('tempdb..#NumbersArray') IS NOT NULL
DROP TABLE #NumbersArray
GO
--Create T-SQL version of number array look-like
CREATE TABLE #NumbersArray
(
ArrayIndex Int PRIMARY KEY CLUSTERED,
Value Int
)
GO