CREATE DATABASE demo1
go

use demo1
go


-- create the assembly
CREATE ASSEMBLY 


-- catalog some of the functions as SQL UDFs
CREATE FUNCTION 

-- use it
declare @x float
declare @y float
set @x = -40
set @y = dbo.FahrenheitToCentigrade(@x)
print @y
go

-- fill in the table creation
CREATE TABLE readings (

)
go

ALTER TABLE readings WITH NOCHECK 
ADD CONSTRAINT PK_ReadingDate_City PRIMARY KEY CLUSTERED
(ReadingDate, City) 
go

CREATE INDEX IDX_hitemp_far ON readings(hitemp_far)
go

CREATE INDEX IDX_hitemp_cen ON readings(hitemp_cen)
go
