Database
How to do an audit table.
Who, what, when, values



Q. Does the increment get rolled back or deleted?
A. It gets deleted.

Create => deleting
Update => reverts
Delete => reverts

[DatabaseName].[dbo].[TableName]
ALTER TABLE [TableName]
ADD [temp] TYPE
GO

UPDATE [TableName]
SET [temp] = [OldColumnName]
GO

ALTER TABLE [TableName]
DROP COLUMN [OldColumnName]
GO

ALTER TABLE [TableName]
ADD [NewColumnName] TYPE
GO

UPDATE [TableName]
SET [NewColumnName] = [temp]
GO

ALTER TABLE [TableName]
DROP COLUMN [temp]
GO

SQL Server documentation

UnicodeLetter, _, @@, #

letters, numbers, @@, $, #, _

Server versions

SELECT T.*
FROM (SELECT IdentifyField, GroupingField, AggregatedField, ROW_NUMBER() OVER(PARTITION BY GroupingField ORDER BY AggregatedField DESC) Sequence
      FROM TableOfInterest) T
WHERE T.Sequence = 1

http://www.sqlusa.com/bestpractices2005/centurydateformat/

[["Command", "Description"], ["sp_who2", "find out which queries are in process"], ["DBCC INPUTBUFFER(999)", "get details of process by its number"], ["KILL 999", "kill process"], ["BlkBy", ""]]

Couch, Raven, HBase

not null
default

primary key
foreign key
unique 
check
    

t-sql between
ORM (Object Relational Model?)
[["Company", "Product", "Notes"], ["Microsoft", "Entity Framework", "POCO"]]

MySQL:Persistit
b+tree
Akiban Server

http://engineering.twitter.com/2010/04/introducing-gizzard-framework-for.html Good read - Twitter Gizzard, a framework for creating distributed datastores
    3/8/2016 SQL Server to Linux
MySQL
MariaDB
postgreSQL
Oracle 12 C Linux
Azure
sp_who2

DBCC INPUTBUFFER(11)

kill 11

When formatting SQL use this format:


SELECT 
   ORDINAL_POSITION
  ,COLUMN_NAME
  ,DATA_TYPE
  ,CHARACTER_MAXIMUM_LENGTH
  ,IS_NULLABLE
  ,COLUMN_DEFAULT
  ,*
FROM   
  INFORMATION_SCHEMA.COLUMNS 
WHERE   
  TABLE_NAME = 'table_name' 
ORDER BY 
  ORDINAL_POSITION ASC; 
------------------------------
Information_schema.key_column_usage
------------------------------
null ascending 1 desc ?
Reason for why different entities should not be lumped into one table