I found this bit of code on http://www.databasejournal.com/img/BigTables.sql for finding the size a tables in a database on MS SQL Server. Really handy for finding out which tables are using up all the disk space!
/********************************… Read more »
Create Table with Incremental Primary Key
Create Table [Courses] (
[course_id] Counter NOT NULL,
[course_title] text(100) NOT NULL,
[course_date] datetime NOT NULL,
[course_description] memo NOT NULL,
[course_places] int NOT NULL,
[cou… Read more »
Rename a table
Exec sp_rename [CurrentTableName], [NewTableName]
Rename column
EXEC sp_rename '[tablename].[CurrentColumnName]', 'NewColumnName', 'COLUMN'
Add a primary key to a table
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHA… Read more »
Search
Wish List
Found something helpful & want to say ’thanks‘? Then visit my
Amazon Wish List :)