Level 1

DELETE TableOrView
[FROM TableSources]
[WHERE WhereRowSearchCondition]
INSERT [INTO] TableOrView [(ColumnList)]
{ VALUES (ListOfValues) | SELECTSubquery }
UPDATE TableOrView
SET Column&ExpressionList [FROM TableSources]
[WHERE WhereRowSearchCondition]
SELECT [ALL | DISTINCT] [TOP n [PERCENT]] SelectList
[INTO NewTable]
[FROM TableSources]
[WHERE WhereRowSearchCondition]
[
	GROUP BY [ALL] GroupList [WITH [CUBE | ROLLUP]]
	[HAVING HavingRowSearchCondition]
]
[ORDER BY OrderList [ASC | DESC]]
[
	COMPUTE ComputeList
	[BY ComputeByList]
]
SELECTCommand1
UNION [ALL]
SELECTCommand2

Level 2

Leave non-select statements commented out so you don't accidentally run them. Some of these are T-SQL specific.

select @@servername, @@version;

--remote(s):
select * from master.dbo.sysservers;
select * from master.sys.servers;
exec sp_linkedservers;
select * from sys.linked_logins;

--Schema related:
--ALTER SCHEMA com TRANSFER dbo.StairStep;
--GRANT SELECT ON SCHEMA :: myschema TO myuser;
--GRANT INSERT ON SCHEMA :: myschema TO myuser;
--GRANT UPDATE ON SCHEMA :: myschema TO myuser;
--GRANT EXECUTE ON SCHEMA :: myschema TO myuser;

--exec sp_renamediagram @diagramname='All Table Names by Structure', @new_diagramname='All Tables'

--select * from master.sys.messages; --All the error codes

--create view UserCircleCnt as select UserID, count(distinct CircleID) CircleCnt from com.Member group by UserID;

declare @var int; set @var = 7;
while @var <= 119
begin
	--update com.Circle set ID = (@var -6) where ID = @var;
	set @var = @var + 1;
end

declare @tbl table(ID int, Name varchar(50));
	--insert into @tbl (ID, Name)
	select 1, 'Foo';
	select * from @tbl;

--insert into MyLinkedServer.MyDatabase.MySchema.MyTable select * from MySchema.MyTable;
--insert into com.CircleUser (CircleID, UserID) values (126, 64);
--delete from com.Circle where ID < 1;

select 
	replace(replace('hello
world', char(13), ' '), char(10) , '')
	, isnull(null, '')
	, nullif(datepart(year, getdate()), 1900);

select * from Step S where S.ID in (select Element from com.Split(@IDList, ','))


GeorgeHernandez.comSome rights reserved