5>
6>
7> CREATE TABLE myusers(
8> UserID varchar(30)NOT NULL PRIMARY KEY,
9> FirstName varchar(30),
10> LastName varchar(30),
11> EmployeeType char(1) NOT NULL,
12> DBAccess varchar(30),
13> StartDate datetime,
14> ExpDate datetime
15> )
16> GO
1> CREATE TABLE oldusers(
2> UserID varchar(30),
3> FirstName varchar(30),
4> LastName varchar(30),
5> EmployeeType char(1) NOT NULL,
6> DBAccess varchar(30),
7> StartDate datetime,
8> ExpDate datetime
9> )
10> GO
1>
2> CREATE PROC pr_copyuser (@UID varchar(30) )
3> AS
4> INSERT INTO oldusers SELECT * FROM myusers WHERE UserID = @UID
5> DELETE myusers WHERE UserID = @UID
6> GO
1>
2> drop PROC pr_copyuser;
3> GO
1>
2>
3> drop table oldusers;
4> drop table myusers;
5> GO
|