--client±í;
use db
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[client]') AND name = N'id')
DROP INDEX [id] ON [dbo].[client] WITH ( ONLINE = OFF )

if not exists(select name from syscolumns where id=object_id('client') and name='photo')
	alter table [client] add [photo] [image] NULL

alter table [client] alter column [id] [nvarchar] (50) NULL
------------------------------------------------------------
alter table [client] alter column [name1] [nvarchar] (50) NULL
alter table [client] alter column [name2] [nvarchar] (50) NULL
alter table [client] alter column [phone1] [nvarchar] (50) NULL
alter table [client] alter column [phone2] [nvarchar] (50) NULL
alter table [client] alter column [qq1] [nvarchar] (50) NULL
alter table [client] alter column [qq2] [nvarchar] (50) NULL
alter table [client] alter column [addr1] [nvarchar] (50) NULL
alter table [client] alter column [addr2] [nvarchar] (50) NULL
alter table [client] alter column [occupation1] [nvarchar] (50) NULL
alter table [client] alter column [occupation2] [nvarchar] (50) NULL
alter table [client] alter column [birthday1] [nvarchar] (50) NULL
alter table [client] alter column [birthday2] [nvarchar] (50) NULL
alter table [client] alter column [time3] [nvarchar] (50) NULL
alter table [client] alter column [area] [nvarchar] (50) NULL
alter table [client] alter column [area2] [nvarchar] (50) NULL
alter table [client] alter column [check1] [nvarchar] (50) NULL
alter table [client] alter column [check2] [nvarchar] (50) NULL
alter table [client] alter column [check3] [nvarchar] (50) NULL
alter table [client] alter column [sex] [nvarchar] (50) NULL
alter table [client] alter column [zodiac] [nvarchar] (50) NULL

CREATE UNIQUE NONCLUSTERED INDEX [id] ON [dbo].[client] 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]


use [2014]
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[client]') AND name = N'id')
DROP INDEX [id] ON [dbo].[client] WITH ( ONLINE = OFF )

if not exists(select name from syscolumns where id=object_id('client') and name='photo')
	alter table [client] add [photo] [image] NULL

alter table [client] alter column [id] [nvarchar] (50) NULL
------------------------------------------------------------
alter table [client] alter column [name1] [nvarchar] (50) NULL
alter table [client] alter column [name2] [nvarchar] (50) NULL
alter table [client] alter column [phone1] [nvarchar] (50) NULL
alter table [client] alter column [phone2] [nvarchar] (50) NULL
alter table [client] alter column [qq1] [nvarchar] (50) NULL
alter table [client] alter column [qq2] [nvarchar] (50) NULL
alter table [client] alter column [addr1] [nvarchar] (50) NULL
alter table [client] alter column [addr2] [nvarchar] (50) NULL
alter table [client] alter column [occupation1] [nvarchar] (50) NULL
alter table [client] alter column [occupation2] [nvarchar] (50) NULL
alter table [client] alter column [birthday1] [nvarchar] (50) NULL
alter table [client] alter column [birthday2] [nvarchar] (50) NULL
alter table [client] alter column [time3] [nvarchar] (50) NULL
alter table [client] alter column [area] [nvarchar] (50) NULL
alter table [client] alter column [area2] [nvarchar] (50) NULL
alter table [client] alter column [check1] [nvarchar] (50) NULL
alter table [client] alter column [check2] [nvarchar] (50) NULL
alter table [client] alter column [check3] [nvarchar] (50) NULL
alter table [client] alter column [sex] [nvarchar] (50) NULL
alter table [client] alter column [zodiac] [nvarchar] (50) NULL

CREATE UNIQUE NONCLUSTERED INDEX [id] ON [dbo].[client] 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
