|
USE [AdventureWorks2012]
GO
/****** Object: UserDefinedDataType [dbo].[codep] Script Date: 26/01/2016 14:24:13 ******/
CREATE TYPE [dbo].[codep] FROM [nchar](5) NULL
GO
/*Create table parent ( Nom char (20), Prénom char(20), Adresse char (20), codepostal codep,--codep tddu Id_parent int identity(1,2) primary key nonclustered)
create table enfant ( Nom char (20), Prénom char(20),Id_parent int, constraint lienparentenfant foreign key (Id_parent) references parent(Id_parent) on delete cascade on update cascade) */
--use [Base de test1]insert into parent values('Partouche', 'David','11 Allée de','91339')
--create view vuetest2 with encryption , SCHEMABINDING create view vuetest5 with SCHEMABINDING,VIEW_METADATA,encryption as select Nom, Prénom from dbo.parent
--drop view vuetest1
use Demo
declare @i int
set @i=0
while @i<1000000
Begin
set @i=@i+1
insert into parent values('Partouche', 'David','11 Allée de', @i)
print cast(@i as varchar(5))
Drop from table parents where id_parent<500
|