-----------------------------
---- ويرايش جداول 1395/10/01

-----------------------------
-- drop table Tarhe_Dandan
ALTER TABLE [dbo].[darmanha]
   ADD  [R_D] [int] NULL  
GO
ALTER TABLE [dbo].[darmanha]
   ADD  [R_A] [int] NULL  
GO
ALTER TABLE [dbo].[darmanha]
   ADD  [name_bakhsh] [nvarchar] (255) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[darmanha]
   ADD  [name_tabagheh_darman] [nvarchar] (255) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[darmanha]
   ADD  [code_tabagheh_darman] [int] NULL  
GO
UPDATE    darmanha SET  code_ertebat = 0  WHERE   (code_ertebat IS NULL)
Go
UPDATE    darmanha SET  code_bakhsh = 0  WHERE   (code_bakhsh IS NULL)
GO
UPDATE    darmanha SET  code_Bimeh = 0  WHERE     (code_Bimeh IS NULL)
GO
UPDATE    darmanha SET  code_daro = 0  WHERE     (code_daro IS NULL)
GO
UPDATE    darmanha SET r_azad = 0 WHERE     (r_azad IS NULL)
GO
UPDATE    darmanha SET r_bimar = 0 WHERE     (r_bimar IS NULL)
GO
UPDATE    darmanha SET r_bimeh = 0 WHERE     (r_bimeh IS NULL)
GO
UPDATE    darmanha SET r_mabeh = 0 WHERE     (r_mabeh IS NULL)
GO
UPDATE    darmanha SET r_pezeshk = 0 WHERE     (r_pezeshk IS NULL)
GO
UPDATE    darmanha SET r_d = 0 WHERE     (r_d IS NULL)
GO
UPDATE    darmanha SET r_a = 0 WHERE     (r_a IS NULL)
GO
UPDATE    darmanha SET code_tabagheh_darman = 0 WHERE  (code_tabagheh_darman IS NULL)
Go
ALTER TABLE [dbo].[pezeshkan]
   ADD  [darsad] [float] NULL 
Go
ALTER TABLE [dbo].[pezeshkan]
   ADD  [code_tafzil] [nvarchar] (10) COLLATE Arabic_CI_AS NULL 

Go
ALTER TABLE [dbo].[setting]
   ADD  [show_noa_pay_ghabz] [bit] NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD  [path_auto_backup] [nvarchar] (255) COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD  [time_auto_backup] [smallint] NULL

Go
ALTER TABLE [dbo].[setting]
   ADD  [code_bank] [int] NULL

Go
ALTER TABLE [dbo].[setting]
   ADD  [code_pay] [int] NULL

Go
ALTER TABLE [dbo].[setting]
   ADD  [alarm_bad_ghol] [bit] NULL
Go

ALTER TABLE [dbo].[setting]
   ADD [alarm_bad_hesab] [bit] NULL
Go

ALTER TABLE [dbo].[setting]
   ADD [code_moshtari] [int] NULL
Go

ALTER TABLE [dbo].[users]
   add [ab_report_cheque] [bit] NULL 
Go

ALTER TABLE [dbo].[users]
   add [ab_insert_cheque] [bit] NULL 
Go

ALTER TABLE [dbo].[users]
  add [ab_edit_cheque] [bit] NULL 
Go

ALTER TABLE [dbo].[users]
   add [ab_del_cheque] [bit] NULL
Go

ALTER TABLE [dbo].[users]
  add [ab_insert_Variz_Be_Hesab] [bit] NULL
Go


ALTER TABLE [dbo].[users]
  add [ab_edit_Variz_Be_Hesab] [bit] NULL
Go


ALTER TABLE [dbo].[users]
  add [ab_del_Variz_Be_Hesab] [bit] NULL 
Go

ALTER TABLE [dbo].[users]
  add [ab_report_Variz_Be_Hesab] [bit] NULL 

Go

ALTER TABLE [dbo].[users]
  add [ab_edit_bad_ghol] [bit] NULL 
Go

ALTER TABLE [dbo].[users]
  add [ab_edit_bad_hesab] [bit] NULL 
Go

ALTER TABLE [dbo].[users]
  add  [ab_tarif_tarefeh_labratvar] [bit] NULL 
Go

Go
ALTER TABLE [dbo].[setting]
   ADD  [vorod_check_paziresh] [bit] NULL
GO
ALTER TABLE [dbo].[morajeat]
   ADD  [code_pay] [int] NULL
GO
ALTER TABLE [dbo].[help]
   ADD  [code_vaz_check] [int] NULL
GO
ALTER TABLE [dbo].[help]
   ADD  [code_noa_cheque] [int] NULL 
GO
ALTER TABLE [dbo].[list_del_edit]
   ADD  [code_amaliat] [int] NULL 
GO
ALTER TABLE [dbo].[list_del_edit]
   ADD  [tozihat] [nvarchar] (250) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[list_del_edit]
   ADD  [code_system] [int] NULL  
GO

ALTER TABLE [dbo].[tarikh]
   ADD  [code_person] [int] NULL  
GO


ALTER TABLE [dbo].[tarikh]
   ADD  [sharh] [nvarchar] (150) COLLATE Arabic_CI_AS NULL
GO


ALTER TABLE [dbo].[tarikh]
   ADD  [time_karkerd] [char] (5) COLLATE Arabic_CI_AS NULL
GO

ALTER TABLE [dbo].[tarikh]
   ADD [Minute_karkerd] [int] NULL 

GO

ALTER TABLE [dbo].[labratvar]
   ADD [r_bes] [money] NULL

GO

UPDATE setting SET vorod_check_paziresh=1 where id=1
Go
INSERT INTO bank (code_bank,name_bank) VALUES (1,'ملي ')
Go
INSERT INTO bank (code_bank,name_bank) VALUES (2,'پاسارگاد ')
Go
INSERT INTO bank (code_bank,name_bank) VALUES (3,'ملت')
Go
INSERT INTO bank (code_bank,name_bank) VALUES (4,'كشاورزي ')
Go
INSERT INTO bank (code_bank,name_bank) VALUES (5,'صادرات ')
Go
INSERT INTO bank (code_bank,name_bank) VALUES (6,'اقتصاد نوين ')
Go
INSERT INTO bank (code_bank,name_bank) VALUES (7,'سپه ')
Go
INSERT INTO bank (code_bank,name_bank) VALUES (8,'رفاه كارگران ')
Go
INSERT INTO noa_cheque (code_noa,name_noa) VALUES (1,'دريافتي ')
Go
INSERT INTO noa_cheque (code_noa,name_noa) VALUES (2,'پرداختي ')
GO
INSERT INTO vazeiat_cheque (code_vazeiat,name_vazeiat) VALUES (1,'قابل وصول ')
GO
INSERT INTO vazeiat_cheque (code_vazeiat,name_vazeiat) VALUES (2,' وصول شده ')
GO
INSERT INTO  vazeiat_cheque (code_vazeiat,name_vazeiat) VALUES (3,' برگشتي ')
GO
INSERT INTO noa_in_out (Code_Noa_In_Out,name_Noa_In_Out) VALUES (1,' ورود ')
GO
INSERT INTO noa_in_out (Code_Noa_In_Out,name_Noa_In_Out) VALUES (2,' خروج ')
GO
INSERT INTO noa_in_out (Code_Noa_In_Out,name_Noa_In_Out) VALUES (3,' مرخصي ')
GO
INSERT INTO noa_in_out (Code_Noa_In_Out,name_Noa_In_Out) VALUES (4,' ماموريت ')
GO
ALTER TABLE [dbo].[moarefiha]
    ALTER COLUMN[tarikh_moarefi] [nvarchar] (10) COLLATE Arabic_CI_AS NOT NULL

Go
ALTER TABLE [dbo].[moarefiha]
    ALTER COLUMN[tarikh_etebar_moarefi] [nvarchar] (10) COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[Labratvar]
   ADD [code_tarefeh] [int] NULL

Go

ALTER TABLE [dbo].[bimaran]
   ADD [bad_ghol] [bit] NULL

Go
ALTER TABLE [dbo].[bimaran]
   ADD [bad_hesab] [bit] NULL

Go

ALTER TABLE [dbo].[moarefiha]
   ADD [radif] [int] NULL
Go

ALTER TABLE [dbo].[moarefiha]
   ADD [mablagh] [money] NULL
Go

ALTER TABLE [dbo].[moarefiha]
   ADD [sharh] [nvarchar] (250) COLLATE Arabic_CI_AS NULL 
Go

ALTER TABLE [dbo].[moarefiha]
   ADD [darsad] [float] NULL
Go

ALTER TABLE [dbo].[moarefiha]
   ADD [code_mokammel] [int] NULL 

Go
ALTER TABLE [dbo].[pezeshkan]
    ALTER COLUMN  [darsad] float NULL
Go
ALTER TABLE [dbo].[bimaran]
   ADD [s_r_bed] [money] NULL 

Go
ALTER TABLE [dbo].[bimaran]
   ADD [s_r_bes] [money] NULL 

Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Host] [nvarchar] (50) COLLATE Arabic_CI_AS NULL 

Go
ALTER TABLE [dbo].[moarefiha]
    ALTER COLUMN  [darsad] [int] NULL
Go
Go
ALTER TABLE [dbo].[users]
   ADD [ab_insert_sorat_hesabe_bi] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_del_sorat_hesabe_bi] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_edit_sorat_hesabe_bi] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_report_sorat_hesabe_bi] [bit] NULL 
Go 
ALTER TABLE [dbo].[setting]
   ADD [active_virayesh_nobat] [bit] NULL
Go 
ALTER TABLE [dbo].[setting]
   ADD [hade_code_morajeh] [int] NULL
Go 
ALTER TABLE [dbo].[setting]
   ADD [onvan_balay_ghabz] [nvarchar] (255) COLLATE Arabic_CI_AS NULL 
Go 
ALTER TABLE [dbo].[darmanha]
   ADD [zarib_k] [int] NULL 
Go 
ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [Zarib_K] [int] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_sabt_daem_darman] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_bargasht_sabt_daem_darman] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_del_darman_users] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_edit_darman_users] [bit] NULL
Go
ALTER TABLE [dbo].[sorat_hesabe_bimarestan]
   ADD [printable] [bit] NULL
Go 
ALTER TABLE [dbo].[setting]
   ADD [code_unit] [int] NULL
Go 
ALTER TABLE [dbo].[morajeat]
   ADD [code_sabt_daem_darman] [int] NULL
Go 
 
ALTER TABLE [dbo].[users]
   ADD [ab_insert_nameh] [bit] NULL
Go 

ALTER TABLE [dbo].[users]
   ADD [ab_edit_nameh] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_del_nameh] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_report_nameh] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_view_tarhe_darman] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_insert_tarhe_darman] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_del_tarhe_darman] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_edit_tarhe_darman] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_report_tarhe_darman] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_view_natije_azmayesh] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_insert_natije_azmayesh] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_del_natije_azmayesh] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_del_natije_azmayesh] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_edit_natije_azmayesh] [bit] NULL 
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_report_natije_azmayesh] [bit] NULL
Go 
ALTER TABLE [dbo].[users]
   ADD [ab_bazresi_list_del_edit_paziresh] [bit] NULL 
Go 
ALTER TABLE [dbo].[setting]
   ADD [show_tarhe_darman] [bit] NULL
Go 

ALTER TABLE [dbo].[setting]
   ADD [show_Natije_Azmayesh] [bit] NULL
Go 

ALTER TABLE [dbo].[setting]
   ADD [check_sharayet_bimeh] [bit] NULL
Go 
ALTER TABLE [dbo].[bimaran]
   ADD [sh_kargozini] [nvarchar] (15) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [check_code_sharh_darman] [bit] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [code_sharh_darman] [nvarchar] (2) COLLATE Arabic_CI_AS NULL
 
Go
ALTER TABLE [dbo].[bimaran]
   ADD [code_mahale_khedmat] [int] NULL
Go
ALTER TABLE [dbo].[bimaran]
   ADD [code_nesbat] [int] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [code_nesbat] [int] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [code_mahale_khedmat] [int] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [code_tabagheh] [int] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [code_job] [int] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [code_gens] [int] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_zarib_k] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [code_mahale_khedmat] [int] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [code_nesbat] [int] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [not_finished] [bit] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [sh_kargozini] [nvarchar] (15) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [zarib_k] [float] NULL
Go

ALTER TABLE [dbo].[setting]
   ADD [code_gens] [int] NULL

Go
ALTER TABLE [dbo].[darmanha]
   ADD [r_takhfif] [int] NULL

Go
ALTER TABLE [dbo].[darmanha]
    ALTER COLUMN  [zarib_k] [float] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ALTER COLUMN [code_sharh_darman] [nvarchar] (2) COLLATE Arabic_CI_AS NULL
Go

ALTER TABLE [dbo].[users]
  Add [ab_hesabdari] [bit] NULL  
GO
ALTER TABLE [dbo].[users]
  DROP COLUMN [ab_mali]
Go
ALTER TABLE [dbo].[users]
  Add [ab_edaree] [bit] NULL  
GO
ALTER TABLE [dbo].[users]
  DROP COLUMN [ab_edari]
Go
ALTER TABLE [dbo].[setting]
   ADD [search_pezeshk_on_paziresh] [bit] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [tavalod] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [sen] [int] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [sabte_sarie_bimar] [bit] NULL
Go
ALTER TABLE [dbo].[tarhe_darman]
   ADD [r_azad] [int] NULL
Go
ALTER TABLE [dbo].[tarhe_darman]
   ADD [r_bimar] [int] NULL
Go
ALTER TABLE [dbo].[tarhe_darman]
   ADD [r_bimeh] [int] NULL
Go
ALTER TABLE [dbo].[darmanha]
   ADD [r_takhfif] [int] NULL
Go
ALTER TABLE [dbo].[darmanha]
   ADD [meghdar] [int] NULL
Go
ALTER TABLE [dbo].[tarhe_darman]
   ADD [tedad_darman] [int] NULL
Go
ALTER TABLE [dbo].[tarhe_darman]
   ADD [meghdar] [int] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [code_noa_khedmat] [int] NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [insert_time] [datetime] NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [edit_time] [datetime] NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [code_user_edit] [int] NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [code_gens] [int] NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [code_user_insert] [int] NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [r_mabeh] [money] NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [r_takhfif] [money] NULL
Go

ALTER TABLE [dbo].[noskhehha]
   ADD [r_bed] [money] NULL
Go

ALTER TABLE [dbo].[noskhehha]
   ADD [r_bes] [money] NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [r_mandeh] [money] NULL
Go

ALTER TABLE [dbo].[noskhehha]
   ADD [tarikh_javab] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [tarikh_sabt_javab] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [sh_parvandeh] [nvarchar] (15) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [not_bimeh] [bit] NULL 
Go
ALTER TABLE [dbo].[darmanha]
   ADD [radif] [int] NULL 
Go
ALTER TABLE [dbo].[darmanha]
   ADD [code_noa_khedmat] [int] NULL 
Go
ALTER TABLE [dbo].[users]
   ADD [ab_view_sarjame_darman] [bit] NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD [show_tozihat] [bit] NULL 
Go
ALTER TABLE [dbo].[morajeat]
   ADD [tozihat] [ntext] COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[bimaran]
   ADD [sabeghe_bimari] [bit] NULL 
Go
ALTER TABLE [dbo].[bimaran]
   ADD [sharh_sabeghe_bimari] [nvarchar] (200) COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[users]
   ADD [ab_view_sarjame_darman_print] [bit] NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD [code_mah] [int] NULL 

Go
ALTER TABLE [dbo].[sorat_hesabe_bimarestan]
   ADD [code_mah] [int] NULL 

Go
ALTER TABLE [dbo].[setting]
   ALTER COLUMN [T_Exit_1] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   ALTER COLUMN [T_Exit_2] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   ALTER COLUMN [T_Exit_3] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[shiftha]
   ALTER COLUMN [From_Time] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[shiftha]
   ALTER COLUMN [To_Time] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
Go
INSERT INTO mah (code_mah,name_mah) VALUES (1,'فروردين ')
Go
INSERT INTO mah (code_mah,name_mah) VALUES (2,'ارديبهشت')
Go
INSERT INTO mah (code_mah,name_mah) VALUES (3,'خرداد')
Go
INSERT INTO mah (code_mah,name_mah) VALUES (4,'تير')
Go
INSERT INTO mah (code_mah,name_mah) VALUES (5,'مرداد')
Go
INSERT INTO mah (code_mah,name_mah) VALUES (6,'شهريور')
Go
INSERT INTO mah (code_mah,name_mah) VALUES (7,'مهر')
Go
INSERT INTO mah (code_mah,name_mah) VALUES (8,'آبان')
Go
INSERT INTO mah (code_mah,name_mah) VALUES (9,'آذر')
Go
INSERT INTO mah (code_mah,name_mah) VALUES (10,'دي')
Go
INSERT INTO mah (code_mah,name_mah) VALUES (11,'بهمن')
Go
INSERT INTO mah (code_mah,name_mah) VALUES (12,'اسفند')
Go
UPDATE setting SET show_tozihat=1 where id=1
Go
ALTER TABLE [dbo].[setting]
    ALTER COLUMN[code_markaz] [nvarchar] (50) COLLATE Arabic_CI_AS  NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [code_noa_amal] [int] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [code_takhasos] [int] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [code_takhasos] [int] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_paziresh] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_paziresh] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_vaght_dehi] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_in_Out] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_tasavir_bank] [bit] NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD [show_nameha_asnad] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_bimarestan] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_tanzimat] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_gozareshat_bimeh] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_gozareshat_bimeh] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_sandogh_bimar] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_sandogh_bimar] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_sandogh_bimar] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_tarikhche_pezeshki] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_tasavir_bimar] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_list_darmanha] [bit] NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD [show_sandogh_daryaft_pardakht] [bit] NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [code_takhasos] [int] NULL
Go
ALTER TABLE [dbo].[sorat_hesabe_bimarestan]
   ADD [code_noa_amal] [int] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [parent_radif] [int] NULL
Go
ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [r_takhfif] [int] NULL
Go
ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [meghdar] [int] NULL
GO
ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [radif] [int] NULL
GO
ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [code_noa_khedmat] [int] NULL
GO
ALTER TABLE [dbo].[darmanha]
   ALTER COLUMN [code_user] [int] NULL
GO
ALTER TABLE [dbo].[darmanha]
   ALTER COLUMN [post_time] [datetime] NULL
GO

ALTER TABLE [dbo].[noskhehha]
   ADD [sh_parvandeh] [nvarchar] (15) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[noskhehha]
   ADD [sabegheh_bimari] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[noskhehha]
   ADD [bardar] [bit] NULL
GO
ALTER TABLE [dbo].[noskhehha]
   ADD [orzhansi] [bit] NULL
GO
ALTER TABLE [dbo].[noskhehha]
   ADD [code_takhasos] [int] NULL
GO
ALTER TABLE [dbo].[noskhehha]
   ADD [tedad_print] [int] NULL
GO
ALTER TABLE [dbo].[noskhehha]
   ADD [r_azad_kol] [money] NULL
GO
ALTER TABLE [dbo].[noskhehha]
   ADD [r_bimar_kol] [money] NULL
GO
INSERT INTO takhasos (code_takhasos,name_takhasos) VALUES (1,'عمومي')
Go
INSERT INTO takhasos (code_takhasos,name_takhasos) VALUES (2,'متخصص')
Go
INSERT INTO takhasos (code_takhasos,name_takhasos) VALUES (3,'دكترا')
Go
ALTER TABLE [dbo].[kala]
   ADD [hade_taghaza] [float] NULL 
Go
ALTER TABLE [dbo].[kala]
   ALTER COLUMN [hade_taghaza] [float] NULL 
Go
ALTER TABLE [dbo].[kala]
   ADD [First_fi] [money] NULL
GO
ALTER TABLE [dbo].[kala]
   ADD [last_fi] [money] NULL
GO
ALTER TABLE [dbo].[kala]
   ADD [Avarage_fi] [money] NULL
GO
ALTER TABLE [dbo].[kala]
   ADD [min_fi] [money] NULL
GO
ALTER TABLE [dbo].[kala]
   ADD [max_fi] [money] NULL
GO
ALTER TABLE [dbo].[bimeha]
   ADD [saghfe_khanevadeh] [bit] NULL
GO
ALTER TABLE [dbo].[bimeha]
   ADD [saghfe_shakhs] [bit] NULL
GO
ALTER TABLE [dbo].[bimeha]
   ADD [r_saghfe_shakhs] [money] NULL
GO
ALTER TABLE [dbo].[bimeha]
   ADD [r_saghfe_khanevadeh] [money] NULL
GO
ALTER TABLE [dbo].[bimaran]
   ADD [code_tahsilat] [int] NULL
GO
CREATE TABLE [dbo].[tahsilat] (
	[code_tahsilat] [int] NOT NULL ,
	[name_tahsilat] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tahsilat] WITH NOCHECK ADD 
	CONSTRAINT [PK_tahsilat] PRIMARY KEY  CLUSTERED 
	(
		[code_tahsilat]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[users]
   ADD [ab_show_list_paziresh] [bit] NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [show_mabeh_ghabz] [bit] NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [show_bedehi_ghabz] [bit] NULL
GO
ALTER TABLE [dbo].[morajeat]
   ADD [tedad_print] [int] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [print_last_darman_ghabz_vaght] [bit] NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [code_pezeshk_0_0] [char] (10) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [code_pezeshk_1_1] [int] NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [code_pezeshk_2_1] [int] NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [code_pezeshk_2_2] [int] NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [code_pezeshk_2_3] [int] NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [code_pezeshk_3_1] [int] NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [code_pezeshk_4_1] [int] NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [shomareh_nezampezeshki] [int] NULL
GO
ALTER TABLE [dbo].[users]
   ADD [ab_print_tekrari_ghabz] [bit] NULL
GO
ALTER TABLE [dbo].[noskhehha]
   ADD [sharh] [nvarchar] (250) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[darmanha]
   ADD [r_yaraneh] [int] NULL
Go
ALTER TABLE [dbo].[darmanha]
   ADD [r_mokammel] [int] NULL
Go
ALTER TABLE [dbo].[users]
   ADD [restricted_code_pezeshk] [int] NULL
Go
ALTER TABLE [dbo].[users]
   ADD [restricted_code_user] [int] NULL
Go
ALTER TABLE [dbo].[users]
   ADD [restricted_code_user] [int] NULL
Go
ALTER TABLE [dbo].[vaght_dehi]
   ADD [time_come] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[vaght_dehi]
   ADD [done] [bit] NULL
Go
ALTER TABLE [dbo].[vaght_dehi]
   ADD [code_nobat] [int] NULL
Go
ALTER TABLE [dbo].[pezeshkan]
   ADD [tedad_bimar_jadid] [int] NULL
Go
CREATE TABLE [dbo].[Foto_Terapi] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[code_bimar] [int] NOT NULL ,
	[tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NOT NULL ,
	[tarikh_bargasht] [nvarchar] (10) COLLATE Arabic_CI_AS NULL ,
	[use_time] [int] NULL ,
	[code_dastgah] [int] NULL ,
	[sharh] [nvarchar] (200) COLLATE Arabic_CI_AS NULL ,
	[code_user_insert] [int] NULL ,
	[insert_time] [datetime] NULL ,
	[code_user_edit] [int] NULL ,
	[edit_time] [datetime] NULL 
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Foto_Terapi] WITH NOCHECK ADD 
	CONSTRAINT [PK_Foto_Terapi] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

CREATE TABLE [dbo].[dastgah] (
	[code_dastgah] [int] NOT NULL ,
	[name_dastgah] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL ,
	[tarikh_service] [nvarchar] (10) COLLATE Arabic_CI_AS NOT NULL ,
	[time_service] [int] NOT NULL ,
	[time_mandeh] [int] NULL 
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[dastgah] WITH NOCHECK ADD 
	CONSTRAINT [PK_dastgah] PRIMARY KEY  CLUSTERED 
	(
		[code_dastgah]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[darmanha]
   ADD [r_bed] [int] NULL
Go
UPDATE   darmanha  SET  r_azad = 0 WHERE (r_azad IS NULL)
Go
UPDATE   darmanha  SET  r_bimeh = 0 WHERE (r_bimeh IS NULL)
Go
UPDATE   darmanha  SET  r_bimar = 0 WHERE (r_bimar IS NULL)
Go
UPDATE   darmanha  SET  r_mabeh = 0 WHERE (r_mabeh IS NULL)
Go
UPDATE   darmanha  SET  r_takhfif = 0 WHERE (r_takhfif IS NULL)
Go
UPDATE   darmanha  SET  r_pezeshk = 0 WHERE (r_pezeshk IS NULL)
Go
UPDATE   darmanha  SET  r_mokammel = 0 WHERE (r_mokammel IS NULL)
Go
UPDATE   darmanha  SET  r_yaraneh = 0 WHERE (r_yaraneh IS NULL)
Go
UPDATE   darmanha  SET  r_bed = 0 WHERE (r_bed IS NULL)
Go
UPDATE   darmanha  SET  radif = 0 WHERE (radif IS NULL)
Go
UPDATE   darmanha  SET  code_noa_khedmat = 22 WHERE (code_noa_khedmat IS NULL)
Go
UPDATE   darmanha  SET  code_ertebat = 1 WHERE (code_ertebat IS NULL)
Go
UPDATE   darmanha  SET  code_ertebat = 1 WHERE (len(code_ertebat)=0)
Go
UPDATE   darmanha  SET  zarib_k = 1 WHERE (zarib_k IS NULL)
Go
UPDATE   darmanha  SET  code_daro = 1 WHERE (code_daro IS NULL)
Go
UPDATE   darmanha  SET  meghdar = 0 WHERE (meghdar IS NULL)
Go
UPDATE   darmanha  SET  r_bed=r_azad-r_bimeh+r_mabeh-r_takhfif-r_yaraneh-r_mokammel
Go
UPDATE   darmanha  SET  r_a = 0 WHERE (r_a IS NULL)
Go
UPDATE   darmanha  SET  r_d = 0 WHERE (r_d IS NULL)
Go

ALTER TABLE [dbo].[setting]
   ADD [print_ghabz_small] [bit] NULL
GO
ALTER TABLE [dbo].[moshtari]
   ADD [foroshande_kala] [bit] NULL
GO
ALTER TABLE [dbo].[moshtari]
   ADD [tahvil_girandeh_kala] [bit] NULL
GO
ALTER TABLE [dbo].[Anbar_Itm]
   ADD [exp_tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[Kala]
   ADD [exp_tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[Kala]
   ADD [max_taghaza] [float] NULL
GO
ALTER TABLE [dbo].[kala]
   ADD [active] [bit] NULL
GO
ALTER TABLE [dbo].[users]
   ADD [ab_moshahede_alarm] [bit] NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [code_tafzil] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [Emza_Dijital] [image] NULL 
GO
ALTER TABLE [dbo].[tarhe_darman]
   ADD [done] [bit] NULL 
GO
ALTER TABLE [dbo].[labratvar]
   ADD [code_sabt_daem_Labratvar] [int] NULL 
GO
UPDATE   labratvar  SET  sh_factor = 0 WHERE (sh_factor IS NULL)
Go
UPDATE   labratvar  SET  code_sabt_daem_Labratvar = 0 WHERE (code_sabt_daem_Labratvar IS NULL)
Go
ALTER TABLE [dbo].[tabagheh_kala]
   ADD [code_goroh] [int] NULL 
Go
CREATE TABLE [dbo].[moaref] (
	[code_moaref] [int] IDENTITY (1, 1) NOT NULL ,
	[name_moref] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[moaref] WITH NOCHECK ADD 
	CONSTRAINT [PK_moaref] PRIMARY KEY  CLUSTERED 
	(
		[code_moaref]
	)  ON [PRIMARY] 
Go
ALTER TABLE [dbo].[morajeat]
   ADD [Kar_Bargashti] [bit] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [Kar_Erjaei] [bit] NULL 
Go
ALTER TABLE [dbo].[morajeat]
   ADD [Kar_khob] [bit] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [Kar_Bad] [bit] NULL 
Go
ALTER TABLE [dbo].[morajeat]
   ADD [code_moaref] [int] NULL  
Go
ALTER TABLE [dbo].[setting]
   ADD [Enable_tik_sh_bimeh_or_Kargozini] [bit] NULL 
GO
ALTER TABLE [dbo].[setting]
   ADD [sabte_auto_noskheh] [bit] NULL 
GO
ALTER TABLE [dbo].[setting]
   ADD [code_moaref] [int] NULL 
GO
ALTER TABLE [dbo].[tarikh]
   ADD [tatil] [bit] NULL 
GO
CREATE TABLE [dbo].[bimari] (
	[code_bimari] [int] NOT NULL ,
	[name_bimari] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[hadese] (
	[code_hadese] [int] NOT NULL ,
	[name_hadese] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[natije_morajeh] (
	[code_natije_morajeh] [int] NOT NULL ,
	[name_natije_morajeh] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[bimari] ADD 
	CONSTRAINT [PK_bimari] PRIMARY KEY  CLUSTERED 
	(
		[code_bimari]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[hadese] ADD 
	CONSTRAINT [PK_hadese] PRIMARY KEY  CLUSTERED 
	(
		[code_hadese]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[natije_morajeh] ADD 
	CONSTRAINT [PK_natije_morajeh] PRIMARY KEY  CLUSTERED 
	(
		[code_natije_morajeh]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[setting]
   ADD [show_moaref] [bit] NULL 
GO
ALTER TABLE [dbo].[setting]
   ADD [show_elate_natije] [bit] NULL 
GO
ALTER TABLE [dbo].[setting]
   ADD [code_bimari] [int] NULL 
GO
ALTER TABLE [dbo].[setting]
   ADD [code_hadese] [int] NULL 
GO
ALTER TABLE [dbo].[setting]
   ADD [code_natije_morajeh] [int] NULL 
GO
ALTER TABLE [dbo].[morajeat]
   ADD [elate_hadese] [bit] NULL  
GO
ALTER TABLE [dbo].[morajeat]
   ADD [elate_bimari] [bit] NULL  
GO
ALTER TABLE [dbo].[morajeat]
   ADD [code_hadese] [int] NULL  
GO
ALTER TABLE [dbo].[morajeat]
   ADD [code_bimari] [int] NULL  
GO
ALTER TABLE [dbo].[morajeat]
   ADD [code_natije_morajeh] [int] NULL  
GO
ALTER TABLE [dbo].[darmanha]
   ADD [motakhases] [bit] NULL  
GO
ALTER TABLE [dbo].[setting]
   ADD [show_multi_select_darman] [bit] NULL 
GO
CREATE TABLE [dbo].[darmanha_select] (
	[code_darman] [int] NOT NULL ,
	[code_bimeh] [int] NULL ,
	[code_bakhsh] [int] NULL ,
	[code_tabagheh_darman] [int] NULL ,
	[tedad] [int] NOT NULL ,
	[code_pezeshk] [int] NULL ,
	[code_user_insert] [int] NOT NULL ,
	[insert_time] [datetime] NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[darmanha_select] ADD 
	CONSTRAINT [PK_darman_select] PRIMARY KEY  CLUSTERED 
	(
		[code_darman]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[vorod_daro]
   ADD [exp_tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[vorod_daro]
   ADD [Tedad_Out] [int] NULL  
Go
ALTER TABLE [dbo].[vorod_daro]
   ADD [Tedad_Mandeh] [int] NULL  
Go
ALTER TABLE [dbo].[vorod_daro]
   ADD [code_user_insert] [int] NULL  
Go
ALTER TABLE [dbo].[vorod_daro]
   ADD [insert_time] [datetime] NULL  
Go
ALTER TABLE [dbo].[darmanha_select]
   ADD [code_ertebat] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_mablagh_on_paziresh] [bit] NULL 
GO
ALTER TABLE [dbo].[setting]
   ADD [show_Foto_Terapi] [bit] NULL 
GO
ALTER TABLE [dbo].[setting]
   ADD [show_list_on_open_paziresh] [bit] NULL 
GO
ALTER TABLE [dbo].[setting]
   ADD [show_menu_parvandeh] [bit] NULL 
GO
ALTER TABLE [dbo].[setting]
   ADD [show_menu_parvandeh] [bit] NULL 
GO
ALTER TABLE [dbo].[setting]
   ADD [show_parvandeh_dijital] [bit] NULL 
GO
ALTER TABLE [dbo].[setting]
   ADD [show_parvandeh_dijital] [bit] NULL 
GO
ALTER TABLE [dbo].[setting]
   ADD [show_menu_bimaran] [bit] NULL 
GO
ALTER TABLE [dbo].[moshtari]
   ADD [hoghogh_payeh] [money] NULL
GO
ALTER TABLE [dbo].[moshtari]
   ADD [ezafeh_kar_saati] [money] NULL
GO
ALTER TABLE [dbo].[moshtari]
   ADD [kasre_kar_saati] [money] NULL
GO
ALTER TABLE [dbo].[moshtari]
   ADD [kasre_kar_saati] [money] NULL
GO
ALTER TABLE [dbo].[moshtari]
   ADD [saat_vord] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[moshtari]
   ADD [saat_khoroj] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[moshtari]
   ADD [shift_shab] [bit] NULL 
GO
ALTER TABLE [dbo].[moshtari]
   ADD [time_karkerd_rozaneh] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[tarikh]
   ADD [ezafeh_kar] [int] NULL 
GO
ALTER TABLE [dbo].[tarikh]
   ADD [kasre_kar] [int] NULL 
GO
CREATE TABLE [dbo].[Bimaran_Parvandeh] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[code_bimar] [int] NOT NULL ,
	[image_bimar] [image] NOT NULL ,
	[tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NOT NULL ,
	[code_user_insert] [int] NOT NULL ,
	[insert_time] [datetime] NOT NULL ,
	[sharh] [nvarchar] (200) COLLATE Arabic_CI_AS NULL ,
	[code_user_edit] [int] NULL ,
	[edit_time] [datetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[Bimaran_Parvandeh] ADD 
	CONSTRAINT [PK_Bimaran_Parvandeh] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO
CREATE TABLE [dbo].[Karkerd_Personel] (
	[code_mah] [int] NOT NULL ,
	[code_sal] [int] NOT NULL ,
	[code_moshtari] [int] NOT NULL ,
	[hoghogh_payeh] [money] NULL ,
	[karkerd_adi] [int] NULL ,
	[ezafeh_kar] [int] NULL ,
	[mablagh_ezafeh_kar] [money] NULL ,
	[kasre_kar] [int] NULL ,
	[mablagh_kasre_kar] [money] NULL ,
	[bimeh] [money] NULL ,
	[padash] [money] NULL ,
	[pardakhti] [money] NULL ,
	[code_user_insert] [int] NULL ,
	[insert_time] [datetime] NULL ,
	[code_user_edit] [int] NULL ,
	[edit_time] [datetime] NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Karkerd_Personel] ADD 
	CONSTRAINT [PK_Hoghogh_Personel] PRIMARY KEY  CLUSTERED 
	(
		[code_mah],
		[code_sal],
		[code_moshtari]
	)  ON [PRIMARY] 
GO
UPDATE    moshtari SET hoghogh_payeh = 6000000 where hoghogh_payeh is null
GO
UPDATE    moshtari SET kasre_kar_saati = 40000 where kasre_kar_saati is null
GO
UPDATE    moshtari SET ezafeh_kar_saati =30000 where ezafeh_kar_saati is null
GO
UPDATE    moshtari SET saat_vord ='08:00' where saat_vord is null
GO
UPDATE    moshtari SET saat_khoroj ='13:00' where saat_khoroj is null
GO
UPDATE    moshtari SET time_karkerd_rozaneh ='05:00' where time_karkerd_rozaneh is null
GO
ALTER TABLE [dbo].[setting]
   ADD [show_Column_Bimar_tarikh_on_paziresh] [bit] NULL 
GO
UPDATE    setting SET show_Column_Bimar_tarikh_on_paziresh = 1
GO
ALTER TABLE [dbo].[morajeat]
   ADD [saat] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[kala]
   ADD [min_dama] [int] NULL 
Go
ALTER TABLE [dbo].[kala]
   ADD [max_dama] [int] NULL 
Go
CREATE TABLE [dbo].[Auto_SMS] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[SMS_Mobile] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL ,
	[SMS_MSG] [nvarchar] (255) COLLATE Arabic_CI_AS NOT NULL ,
	[tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NOT NULL ,
	[Saat] [nvarchar] (5) COLLATE Arabic_CI_AS NOT NULL ,
	[code_babat] [int] NULL ,
	[code_bimar] [int] NULL ,
	[SendAnswer] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[babat_sms] (
	[code_babat] [int] NOT NULL ,
	[name_babat] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Auto_SMS] ADD 
	CONSTRAINT [PK_Auto_SMS] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[babat_sms] ADD 
	CONSTRAINT [PK_babat_sms] PRIMARY KEY  CLUSTERED 
	(
		[code_babat]
	)  ON [PRIMARY] 
GO
INSERT INTO babat_sms (code_babat,name_babat) VALUES (1,' تاريخ تولد')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (2,' بدهي چند ماهه')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (3,' وقت دهي فردا')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (4,' وقت دهي امروز')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (5,' يادآوري دوره اي')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (6,' درمانهاي ناتمام ')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (7,' وقتهاي فردا پزشك ')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (8,' كليه وقتهاي فردا پزشك')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (10,' دريافت صندوق ')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (11,' پايان شيفت ')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (12,' كلي بيماران ')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (9,' كاركرد ديروز ')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (13,' يادآوري دوره اي ')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (14,' اطلاع تشكيل پرونده ')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (15,' بيماران نيامده سيستم وقت دهي ')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (16,' نظرخواهي رضايت از درمان يا كار انجام شده ')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (17,' ارسال دستي ')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (18,' كاركرد ديروز بيمار براي بيمار ')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (19,' كاركرد ديروز پزشك براي پزشك ')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (20,' اطلاع پزشک معرف از ارجاع درمان ')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (21,' کنسلي وقت به بيمار')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (22,' کنسلي وقت به پزشک')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (23,' سر رسيد چک امروز تا سه روز اينده')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (24,' بدهي بيمار بعد از چند روز مشخص')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (25,' تشکر از تماس شما')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (26,' وقتهاي کلي فرداي  هر پزشک براي مديريت')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (27,' کارکرد ديروز هر پزشک براي مديريت')
Go
INSERT INTO babat_sms (code_babat,name_babat) VALUES (28,' تخفیف اعتباری گروهی')
Go


update babat_sms set name_babat=ltrim(rtrim(name_babat))
Go
ALTER TABLE [dbo].[bimaran]
   ADD [tarikh_etebar_daftar] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[moshtari]
   ADD [adam_namayesh_dar_tafkik_be_hesab] [bit] NULL
Go
ALTER TABLE [dbo].[hesab]
   ADD [adam_namayesh_dar_tafkik_be_hesab] [bit] NULL
Go
ALTER TABLE [dbo].[bimaran]
   ADD [not_finished] [bit] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [masraf_machine_orzhans] [int] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [not_finished_defult_Morajeat] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [ARM_Markaz] [image]  NULL
Go
ALTER TABLE [dbo].[dastyaran]
   ADD [darsad] [float] NULL
Go
ALTER TABLE [dbo].[labratvar]
   ADD [code_dastyar] [int] NULL
Go
UPDATE    moshtari SET  adam_namayesh_dar_tafkik_be_hesab = 0  WHERE   (adam_namayesh_dar_tafkik_be_hesab IS NULL)
GO
UPDATE    hesab SET  adam_namayesh_dar_tafkik_be_hesab = 0  WHERE   (adam_namayesh_dar_tafkik_be_hesab IS NULL)
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Sarjame_Payan_Shift] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Auto_Send_Payment] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Number_Manager] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Auto_Send_Auto_List] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Auto_Send_Time_From] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Auto_Send_Time_To] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Auto_Send_Vaght_Farda] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Vaght_Farda_Time_From] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Vaght_Farda_Time_To] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Auto_Send_Vaght_Emroz] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Vaght_Emroz_Time_From] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Vaght_Emroz_Time_To] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Tarikh_Tavalod] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Tarikh_Tavalod_Time_From] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Tarikh_Tavalod_Time_To] [nvarchar] (5) COLLATE Arabic_CI_AS NULL
Go
UPDATE  setting SET SMS_Host='http://www.tsms.ir' WHERE  (len(rtrim(Ltrim(SMS_Host)))=0) or (SMS_Host is null)
Go
ALTER TABLE [dbo].[auto_sms]
   ADD [code_shift] [int] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [update_list_bimaran_after_insert_morajeat] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [alarm_sar_resid_check] [bit] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [code_takhasos] [int] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [code_ozve] [int] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [tedad_jalase] [int] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [tedad_nahie] [int] NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [DD_Code_Tashkhis] [int] NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [LD_Tarikh_Akhar] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [RD_Tarikh_Aval] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[dastyaran]
   ADD [code_takhasos_dastyar] [int] NULL
Go
UPDATE  dastyaran SET  code_takhasos_dastyar = 1  WHERE   (code_takhasos_dastyar IS NULL)
Go
ALTER TABLE [dbo].[moshtari]
   ADD [sharh_karkerd] [nvarchar] (150) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[moshtari]
   ADD [time_karkerd] [char] (5) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[moshtari]
   ADD [Minute_karkerd] [int] NULL
Go
ALTER TABLE [dbo].[moshtari]
   ADD [ezafeh_kar] [int] NULL
Go
ALTER TABLE [dbo].[moshtari]
   ADD [kasre_kar] [int] NULL
Go
CREATE TABLE [dbo].[sorat_Form_ADS] (
	[id] [int] NOT NULL ,
	[BA] [int] NOT NULL ,
	[BB] [int] NOT NULL ,
	[BE] [int] NULL ,
	[BL] [int] NULL ,
	[BM] [int] NULL ,
	[BS] [int] NULL ,
	[BT] [int] NULL ,
	[BV] [int] NULL ,
	[BX] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[CB] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[EB] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[BY_] [nvarchar] (50) COLLATE Arabic_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[sorat_GLOBAL] (
	[id_GLOBAL] [int] IDENTITY (1, 1) NOT NULL ,
	[id] [int] NOT NULL ,
	[GA] [int] NOT NULL ,
	[GB] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL ,
	[GC] [int] NOT NULL ,
	[GD] [money] NOT NULL ,
	[GE] [money] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[sorat_HOTELING] (
	[id_HOTELING] [int] IDENTITY (1, 1) NOT NULL ,
	[id] [int] NOT NULL ,
	[HA] [int] NOT NULL ,
	[HB] [int] NOT NULL ,
	[HC] [money] NOT NULL ,
	[HD] [money] NOT NULL ,
	[HE] [money] NOT NULL ,
	[HF] [money] NOT NULL ,
	[HG] [money] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[sorat_PAR_HEAD] (
	[id_PAR_HEAD] [int] IDENTITY (1, 1) NOT NULL ,
	[id] [int] NOT NULL ,
	[PA] [int] NOT NULL ,
	[PB] [int] NULL ,
	[PC] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL ,
	[PD] [int] NOT NULL ,
	[PE] [money] NOT NULL ,
	[PF] [money] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[sorat_PHA_HEAD] (
	[id_PHA_HEAD] [int] IDENTITY (1, 1) NOT NULL ,
	[id] [int] NOT NULL ,
	[JA] [int] NOT NULL ,
	[JB] [int] NOT NULL ,
	[JC] [int] NOT NULL ,
	[JD] [int] NOT NULL ,
	[JE] [money] NOT NULL ,
	[JF] [money] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[sorat_SAR_HEAD] (
	[id_SAR_HEAD] [int] IDENTITY (1, 1) NOT NULL ,
	[id] [int] NOT NULL ,
	[KA] [int] NOT NULL ,
	[KB] [int] NOT NULL ,
	[KC] [money] NOT NULL ,
	[KD] [money] NOT NULL ,
	[KE] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL ,
	[KF] [money] NOT NULL ,
	[KG] [int] NOT NULL ,
	[KH] [money] NOT NULL ,
	[KI] [money] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[sorat_hesab_onvan] (
	[id] [int] NOT NULL ,
	[AA] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[AB] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[AC] [int] NULL ,
	[AD] [money] NULL ,
	[AE] [money] NULL ,
	[AF] [nvarchar] (200) COLLATE Arabic_CI_AS NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[sorat_Form_ADS] ADD 
	CONSTRAINT [PK_sorat_Form_ADS] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[sorat_HOTELING] ADD 
	CONSTRAINT [PK_sorat_HOTELING] PRIMARY KEY  CLUSTERED 
	(
		[id_HOTELING]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[sorat_PAR_HEAD] ADD 
	CONSTRAINT [PK_sorat_PAR_HEAD] PRIMARY KEY  CLUSTERED 
	(
		[id_PAR_HEAD]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[sorat_PHA_HEAD] ADD 
	CONSTRAINT [PK_Sorat_PHA_HEAD] PRIMARY KEY  CLUSTERED 
	(
		[id_PHA_HEAD]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[sorat_SAR_HEAD] ADD 
	CONSTRAINT [PK_sorat_SAR_HEAD] PRIMARY KEY  CLUSTERED 
	(
		[id_SAR_HEAD]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[sorat_hesab_onvan] ADD 
	CONSTRAINT [PK_sorat_hesab_onvan] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO
CREATE TABLE [dbo].[Noa_Paziresh_Bimarestan] (
	[Code_Noa_Paziresh] [int] NOT NULL ,
	[Name_Noa_Paziresh] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Noa_Tarkhis_Bimarestan] (
	[Code_Noa_Tarkhis] [int] NOT NULL ,
	[Name_Noa_Tarkhis] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Noa_Paziresh_Bimarestan] ADD 
	CONSTRAINT [PK_Noa_Paziresh_Bimarestan] PRIMARY KEY  CLUSTERED 
	(
		[Code_Noa_Paziresh]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Noa_Tarkhis_Bimarestan] ADD 
	CONSTRAINT [PK_Noa_Tarkhis_Bimarestan] PRIMARY KEY  CLUSTERED 
	(
		[Code_Noa_Tarkhis]
	)  ON [PRIMARY] 
GO
INSERT INTO gens (code_gens,name_gens) VALUES (1,'مرد')
Go
INSERT INTO gens (code_gens,name_gens) VALUES (2,'زن')
Go
INSERT INTO gens (code_gens,name_gens) VALUES (3,'دو جنسي نامشخص')
Go
INSERT INTO gens (code_gens,name_gens) VALUES (4,'تعيين نشده')
Go
INSERT INTO nesbat (code_nesbat,name_nesbat) VALUES (1,'اصلي')
Go
INSERT INTO nesbat (code_nesbat,name_nesbat) VALUES (2,'همسر')
Go
INSERT INTO nesbat (code_nesbat,name_nesbat) VALUES (3,'فرزند پسر')
Go
INSERT INTO nesbat (code_nesbat,name_nesbat) VALUES (4,'فرزند دختر')
Go
INSERT INTO nesbat (code_nesbat,name_nesbat) VALUES (5,'والدين')
Go
INSERT INTO Noa_Paziresh_Bimarestan (Code_Noa_Paziresh,Name_Noa_Paziresh) VALUES (1,'عادي - الكتيو')
Go
INSERT INTO Noa_Paziresh_Bimarestan (Code_Noa_Paziresh,Name_Noa_Paziresh) VALUES (2,'اورژانس')
Go
INSERT INTO Noa_Paziresh_Bimarestan (Code_Noa_Paziresh,Name_Noa_Paziresh) VALUES (3,'عادي تصادفي')
Go
INSERT INTO Noa_Paziresh_Bimarestan (Code_Noa_Paziresh,Name_Noa_Paziresh) VALUES (4,'اورژانس تصادفي')
Go
INSERT INTO Noa_Tarkhis_Bimarestan (Code_Noa_Tarkhis,Name_Noa_Tarkhis) VALUES (1,'بهبود كامل')
Go
INSERT INTO Noa_Tarkhis_Bimarestan (Code_Noa_Tarkhis,Name_Noa_Tarkhis) VALUES (2,'بهبود نسبي')
Go
INSERT INTO Noa_Tarkhis_Bimarestan (Code_Noa_Tarkhis,Name_Noa_Tarkhis) VALUES (3,'ترخيص با ميل شخصي')
Go
INSERT INTO Noa_Tarkhis_Bimarestan (Code_Noa_Tarkhis,Name_Noa_Tarkhis) VALUES (4,'فوت')
Go
INSERT INTO Noa_Tarkhis_Bimarestan (Code_Noa_Tarkhis,Name_Noa_Tarkhis) VALUES (5,'پيگيري')
Go
INSERT INTO Noa_Tarkhis_Bimarestan (Code_Noa_Tarkhis,Name_Noa_Tarkhis) VALUES (6,'انتقال به مركز ديگر')
Go
INSERT INTO Noa_Tarkhis_Bimarestan (Code_Noa_Tarkhis,Name_Noa_Tarkhis) VALUES (7,'فرار')
Go
INSERT INTO Noa_Tarkhis_Bimarestan (Code_Noa_Tarkhis,Name_Noa_Tarkhis) VALUES (9,'غيره')
Go
UPDATE  noskhehha SET  RD_Tarikh_Aval = tarikh_noskheh  WHERE   (RD_Tarikh_Aval IS NULL)
Go
UPDATE  noskhehha SET  LD_Tarikh_Akhar = tarikh_noskheh  WHERE   (LD_Tarikh_Akhar IS NULL)
Go
UPDATE  noskhehha SET  RD_Tarikh_Aval = tarikh_noskheh  WHERE  len(ltrim(rtrim(RD_Tarikh_Aval)))< 5
Go
UPDATE  noskhehha SET  LD_Tarikh_Akhar = tarikh_noskheh  WHERE   len(ltrim(rtrim(LD_Tarikh_Akhar)))< 5
Go
ALTER TABLE [dbo].[setting]
   ADD [dastebandi_pezeshk_bar_asas_bakhsh] [bit] NULL
Go
INSERT INTO sorat_hesab_onvan (id,AA,AB,AC,AD,AE,AF) VALUES (1,'10-20','139201',100,10000000,7000000,'ندارد')
Go
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[darmanha_select]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[darmanha_select]
GO
CREATE TABLE [dbo].[darmanha_select] (
	[code_darman] [int] NOT NULL ,
	[code_user_insert] [int] NOT NULL ,
	[code_bimeh] [int] NULL ,
	[code_bakhsh] [int] NULL ,
	[code_tabagheh_darman] [int] NULL ,
	[tedad] [int] NOT NULL ,
	[code_pezeshk] [int] NULL ,
	[insert_time] [datetime] NOT NULL ,
	[code_ertebat] [nvarchar] (10) COLLATE Arabic_CI_AS NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[darmanha_select] ADD 
	CONSTRAINT [PK_darman_select] PRIMARY KEY  CLUSTERED 
	(
		[code_darman],
		[code_user_insert]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[setting]
   ADD [code_bakhsh_azmayeshgah] [int] NULL
Go
CREATE TABLE [dbo].[pezeshkan_tasvir] (
	[code_pezeshk] [int] NOT NULL ,
	[tasvir_pezeshk] [image] NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[pezeshkan_tasvir] ADD 
	CONSTRAINT [PK_pezeshkan_tasvir] PRIMARY KEY  CLUSTERED 
	(
		[code_pezeshk]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[setting]
   ADD [font_size_namayesh_vaght] [int] NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [font_name_namayesh_vaght] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [onvan_footer_name] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[bimaran]
   ADD [bimari_khas] [nvarchar] (100) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[pezeshkan]
   ADD [name_takhasos] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [font_size_namayesh_vaght_header] [int] NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [font_name_namayesh_vaght_header] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
GO
INSERT INTO Noa_Amal (code_Noa_Amal,name_Noa_Amal) VALUES (1,' گلوبال')
Go
INSERT INTO Noa_Amal (code_Noa_Amal,name_Noa_Amal) VALUES (2,' غير گلوبال')
Go
ALTER TABLE [dbo].[users]
  Add [restricted_code_bakhsh] [int] NULL  
Go
CREATE TABLE [dbo].[Short_Cut_Key] (
	[code_key] [int] NOT NULL ,
	[code_darman] [int] NULL ,
	[tedad_darman] [int] NULL ,
	[code_pezeshk] [int] NULL ,
	[code_dastyar] [int] NULL ,
	[code_bimar] [int] NULL ,
	[code_bimeh] [int] NULL ,
	[code_bakhsh] [int] NULL ,
	[code_takhasos] [int] NULL ,
	[code_yaraneh] [int] NULL ,
	[code_mokammel] [int] NULL ,
	[sharh_darman] [nvarchar] (50) COLLATE Arabic_CI_AS NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Short_Cut_Key] ADD 
	CONSTRAINT [PK_Short_Cut_Key] PRIMARY KEY  CLUSTERED 
	(
		[code_key]
	)  ON [PRIMARY] 
GO
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (1,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (2,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (3,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (4,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (5,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (6,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (7,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (8,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (9,1)
Go
-- INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (10,2)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (11,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (12,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (13,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (14,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (15,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (16,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (17,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (18,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (19,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (20,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (21,1)
Go
INSERT INTO Short_Cut_Key (code_key,tedad_darman) VALUES (22,1)
Go
Delete Short_Cut_Key where code_key=10
Go



ALTER TABLE [dbo].[bimaran]
    ALTER COLUMN[sh_bimeh] [nvarchar] (20) COLLATE Arabic_CI_AS  NULL
Go
ALTER TABLE [dbo].[bimaran]
    ALTER COLUMN[sh_kargozini] [nvarchar] (20) COLLATE Arabic_CI_AS  NULL
Go
ALTER TABLE [dbo].[noskhehha]
    ALTER COLUMN[sh_bimeh] [nvarchar] (20) COLLATE Arabic_CI_AS  NULL
Go
ALTER TABLE [dbo].[morajeat]
    ALTER COLUMN[sh_kargozini] [nvarchar] (20) COLLATE Arabic_CI_AS  NULL
Go
ALTER TABLE [dbo].[morajeat]
    ALTER COLUMN[sh_parvandeh] [nvarchar] (20) COLLATE Arabic_CI_AS  NULL
Go
ALTER TABLE [dbo].[bimeha]
   ADD [selected] [bit] NULL
Go
ALTER TABLE [dbo].[users]
  Add [ab_esterdad_ghabz_paziresh] [bit] NULL  
Go
ALTER TABLE [dbo].[users]
  Add [restricted_to_tarikh] [bit] NULL  
Go
ALTER TABLE [dbo].[morajeat]
  Add [esterdad] [bit] NULL  
Go
ALTER TABLE [dbo].[bimaran]
    ALTER COLUMN[pedar] [nvarchar] (50) COLLATE Arabic_CI_AS  NULL
Go
ALTER TABLE [dbo].[bimaran]
    ALTER COLUMN[code_gens] [int] NULL
Go
ALTER TABLE [dbo].[sorat_hesabe_bimarestan]
    ALTER COLUMN[shomareh_bimeh] [nvarchar] (20) COLLATE Arabic_CI_AS  NULL
Go
ALTER TABLE [dbo].[sorat_hesabe_bimarestan]
    ALTER COLUMN[shomareh_serial_bimeh] [nvarchar] (20) COLLATE Arabic_CI_AS  NULL
Go
ALTER TABLE [dbo].[morajeat]
  Add [select_print] [bit] NULL  
Go
CREATE TABLE [dbo].[Auto_SMS_Manager] (
	[code_year] [int] NOT NULL ,
	[code_month] [int] NOT NULL ,
	[code_babat] [int] NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Auto_SMS_Manager] ADD 
	CONSTRAINT [PK_Auto_SMS_Manager] PRIMARY KEY  CLUSTERED 
	(
		[code_year],
		[code_month],
		[code_babat]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[setting]
   ADD [SMS_Karkerd_Diroz] [bit] NULL
Go
ALTER TABLE [dbo].[vaght_dehi]
    ALTER COLUMN[sharh] [nvarchar] (255) COLLATE Arabic_CI_AS  NULL
Go
update setting set SMS_Karkerd_Diroz=1 where  SMS_Karkerd_Diroz is null
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Vaght_Dehi_Be_Pezeshk] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Vaght_Dehi_Be_Pezeshk_Koli] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [Onvan_Sabet_SMS_Vaght_Farda] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [Onvan_Sabet_SMS_Vaght_Emroz] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
GO
update setting set SMS_Vaght_Dehi_Be_Pezeshk=1 where  SMS_Vaght_Dehi_Be_Pezeshk is null
Go
update setting set SMS_Vaght_Dehi_Be_Pezeshk_Koli=1 where  SMS_Vaght_Dehi_Be_Pezeshk_Koli is null
Go
ALTER TABLE [dbo].[pezeshkan]
   ADD [mobil] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
GO
ALTER TABLE [dbo].[users]
   ADD [ab_view_sandogh_pardakh_daryaft] [bit] NULL
GO
ALTER TABLE [dbo].[users]
   ADD [ab_view_sandogh_daryaft_az_bimar] [bit] NULL
GO
ALTER TABLE [dbo].[hesab]
    ALTER COLUMN[sharh] [nvarchar] (255) COLLATE Arabic_CI_AS  NULL
Go
ALTER TABLE [dbo].[hesab]
   ADD [code_babat_item] [int] NULL
GO
CREATE TABLE [dbo].[babat_item] (
	[code_babat_item] [int] IDENTITY (1, 1) NOT NULL ,
	[code_babat] [int] NOT NULL ,
	[name_babat_item] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[babat_item] ADD 
	CONSTRAINT [PK_babat_item] PRIMARY KEY  CLUSTERED 
	(
		[code_babat_item]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[auto_sms]
   ADD [code_pezeshk] [int] NULL
GO
update Auto_SMS set code_pezeshk=0 where code_pezeshk is null
Go
ALTER TABLE [dbo].[help]
   ADD [code_babat_item] [int] NULL
GO
ALTER TABLE [dbo].[setting]
   ADD [code_bakhsh_darokhaneh] [int] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [show_menu_darokhaneh] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [Show_Arm_on_Ghabz] [bit] NULL
Go
ALTER TABLE [dbo].[darmanha]
   ADD [not_finished] [bit] NULL

Go
ALTER TABLE [dbo].[babat]
   ADD [selected] [bit] NULL

Go
ALTER TABLE [dbo].[babat_item]
   ADD [selected] [bit] NULL

Go
ALTER TABLE [dbo].[pezeshkan]
   ADD [selected] [bit] NULL

Go
ALTER TABLE [dbo].[users]
   ADD [ab_Auto_Sabte_Sanade_Daramad_Paziresh] [bit] NULL

Go
ALTER TABLE [dbo].[setting]
   ADD [Auto_Sabte_Sanad_Daramad_Paziresh] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [Code_Hesab_Daramad] [int] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [Code_Babat_Daramad] [int] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [Code_Babat_Item_Daramad] [int] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [Code_Tafzil_Daramad]  [nvarchar]  (20) COLLATE Arabic_CI_AS  NULL 
Go
ALTER TABLE [dbo].[hesab]
   ADD [sabte_Auto] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [Address_Mobil_Dar_Paziresh_Sari] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [Auto_Sabte_Masraf_Daro_Dar_Anbar] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [Code_Tafzil_Masraf_Daro] [nvarchar]  (20) COLLATE Arabic_CI_AS  NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD [Code_Anbar_Masraf_Daro] [int] NULL
Go
ALTER TABLE [dbo].[users]
   ADD [ab_Auto_Sabte_Masraf_Daro_Dar_Anbar] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [adam_check_and_send_modir] [bit] NULL
Go
ALTER TABLE [dbo].[kala]
   ADD [barcode] [nvarchar]  (50) COLLATE Arabic_CI_AS  NULL 
Go
ALTER TABLE [dbo].[darmanha]
   ADD [barcode] [nvarchar]  (50) COLLATE Arabic_CI_AS  NULL 
Go
UPDATE  setting SET adam_check_and_send_modir=0  WHERE  adam_check_and_send_modir is null
Go
update hesab set sabte_Auto=0 where sabte_Auto is null
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Vaght_Dehi_Be_Pezeshk_Koli_Emroz] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Vaght_Dehi_Be_Modir_Koli_Emroz] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [Last_Edit_Time] [datetime] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [Last_Edit_Time_Users]  [datetime] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD [SMS_Yadavari_Dorei_Roze] [int] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [barcode] [nvarchar]  (50) COLLATE Arabic_CI_AS  NULL 
Go
ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [r_yaraneh]   [int] NULL
Go
ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [r_mokammel]  [int] NULL
Go
ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [r_bed]  [int] NULL
Go
update darmanha  set  barcode='000'  where barcode is null or len(ltrim(Rtrim(barcode)))=0
Go
ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [barcode] [nvarchar]  (50) COLLATE Arabic_CI_AS  NULL 
Go
ALTER TABLE [dbo].[hesab]
  ADD [code_shift] [smallint] NULL 
Go
ALTER TABLE [dbo].[pezeshkan]
  ADD [radif] [int] NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD [sabte_sarie_visit_pezeshk] [bit] NULL
Go
CREATE TABLE [dbo].[visite_pezeshkan] (
	[radif_pezeshk] [int] NOT NULL ,
	[code_bimeh] [int] NOT NULL ,
	[code_bakhsh] [int] NOT NULL ,
	[code_darman] [int] NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[visite_pezeshkan] ADD 
	CONSTRAINT [PK_visite_pezeshkan] PRIMARY KEY  CLUSTERED 
	(
		[radif_pezeshk],
		[code_bimeh],
		[code_bakhsh],
		[code_darman]
	)  ON [PRIMARY] 
GO

CREATE TABLE [dbo].[Reminder] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NULL ,
	[saat] [nvarchar] (5) COLLATE Arabic_CI_AS NULL ,
	[meghdar] [int] NULL ,
	[sharh] [nvarchar] (255) COLLATE Arabic_CI_AS NULL ,
	[insert_time] [datetime] NULL ,
	[code_user_insert] [int] NULL ,
	[edit_time] [datetime] NULL ,
	[code_user_edit] [int] NULL ,
	[code_week] [tinyint] NULL ,
	[done] [bit] NULL ,
	[Code_Person] [int] NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Reminder] ADD 
	CONSTRAINT [PK_Reminder] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[bimeha]
   ADD [Active] [bit] NULL
Go
ALTER TABLE [dbo].[bimaran]
   ADD [Active] [bit] NULL
Go
ALTER TABLE [dbo].[morajeat]
    ALTER COLUMN[code_sharh_darman] [nvarchar] (20) COLLATE Arabic_CI_AS  NULL
Go
ALTER TABLE [dbo].[bimaran]
   ADD [Afrad_Tahte_Takafol] [nvarchar]  (200) COLLATE Arabic_CI_AS  NULL 
Go
ALTER TABLE [dbo].[bimaran]
   ADD [name_bimeh_shodeh_asli] [nvarchar]  (50) COLLATE Arabic_CI_AS  NULL 
Go
ALTER TABLE [dbo].[nameha]
   ADD [code_noa_name] [int] NULL
Go
CREATE TABLE [dbo].[bimeha_detail] (
	[code_bimeh] [int] NOT NULL ,
	[shomareh_gharardad] [nvarchar] (15) COLLATE Arabic_CI_AS NULL ,
	[tarikh_shoro] [nvarchar] (10) COLLATE Arabic_CI_AS NULL ,
	[tarikh_payan] [nvarchar] (10) COLLATE Arabic_CI_AS NULL ,
	[darsad_feranshiz_omomi] [int] NULL ,
	[darsad_feranshiz_takhasosi] [int] NULL ,
	[darsad_khesarat] [int] NULL ,
	[saghf_khesarat_ba_opg] [money] NULL ,
	[saghf_khesarat_bi_opg] [money] NULL ,
	[saghf_morajein] [money] NULL ,
	[maliat_arezsh_afzodeh] [int] NULL ,
	[nahve_pardakht] [nvarchar] (255) COLLATE Arabic_CI_AS NULL ,
	[code_tarefeh] [nvarchar] (15) COLLATE Arabic_CI_AS NULL ,
	[noa_tarh] [nvarchar] (50) COLLATE Arabic_CI_AS NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[bimeha_detail] ADD 
	CONSTRAINT [PK_bimeha_detail] PRIMARY KEY  CLUSTERED 
	(
		[code_bimeh]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[Setting]
   ADD [SMS_Tabrik_Tashkil_Parvandeh] [bit] NULL
Go
ALTER TABLE [dbo].[Setting]
   ADD [Tabrik_Tashkil_Parvandeh_text]  [nvarchar] (100) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[Setting]
   ADD [SMS_Be_BadGholhay_Diroz] [bit] NULL
Go
UPDATE    Setting SET Tabrik_Tashkil_Parvandeh_text ='حضور شما را در اين مركز خير مقدم ميگوئيم'  where Tabrik_Tashkil_Parvandeh_text  is null
Go
UPDATE    bimaran SET  last_tarikh = tarikh  WHERE  (LEN(RTRIM(LTRIM(last_tarikh))) = 0)
Go
ALTER TABLE [dbo].[Setting]
   ADD [SMS_name_bakhsh_Vaght_emroz] [bit] NULL
Go
ALTER TABLE [dbo].[Setting]
   ADD [SMS_name_bakhsh_Vaght_farda] [bit] NULL
Go
ALTER TABLE [dbo].[Setting]
   ADD [SMS_name_afrad_zir_12_Sal]  [nvarchar] (100) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[Setting]
   ADD [SMS_Yadavari_Dorei_text]  [nvarchar] (100) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[Setting]
   ADD [SMS_Yadavari_Dorei_Name_Bimar] [bit] NULL
Go
ALTER TABLE [dbo].[Setting]
   ADD [SMS_Yadavari_Dorei_Name_Bimar_Ba_Pishvand] [bit] NULL
Go
UPDATE    Setting SET SMS_Yadavari_Dorei_text=' يادآوري جهت چك آپ دوره اي'  where SMS_Yadavari_Dorei_text  is null
Go
UPDATE    Setting SET SMS_name_afrad_zir_12_Sal=' سالروز تولد فرزندتان را صميمانه تبريك ميگوئيم'  where SMS_name_afrad_zir_12_Sal  is null
Go
ALTER TABLE [dbo].[users]
   ADD [ab_khali_kardan_vaght] [bit] NULL
Go
ALTER TABLE [dbo].[vaght_dehi]
   ADD [lock] [bit] NULL
Go
ALTER TABLE [dbo].[Setting]
   ADD [Alarm_Reminder] [bit] NULL
Go
ALTER TABLE [dbo].[bimaran]
   ADD [darsad_bimar] [int] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [darsad_bimar] [int] NULL
Go
ALTER TABLE [dbo].[bimaran]
   ADD [saghfe_bimeh] [money] NULL
Go

ALTER TABLE [dbo].[users]
   ADD [ab_sabt_daem_darman_after_print] [bit] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [radif_morajeh] [int] NULL
Go
CREATE TABLE [dbo].[Anbar_Itm_Copy_Past] (
	[code_kala] [int] NOT NULL ,
	[radif] [int] NULL ,
	[code_unit] [int] NULL ,
	[qin] [float] NULL ,
	[qout] [float] NULL ,
	[fi] [money] NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Anbar_Itm_Copy_Past] ADD 
	CONSTRAINT [PK_Anbat_Itm_Copy_Past] PRIMARY KEY  CLUSTERED 
	(
		[code_kala]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[Setting]
   ADD [show_menu_Parvande_Bimar] [bit] NULL
Go
CREATE TABLE [dbo].[Parvandeh_Pezeshki] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[code_bimar] [int] NOT NULL ,
	[eskerin] [bit] NULL ,
	[moayeneh] [bit] NULL ,
	[moredi] [bit] NULL ,
	[tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NOT NULL ,
	[shomare_parvandeh] [nvarchar] (20) COLLATE Arabic_CI_AS NULL ,
	[sabeghe_bimari] [bit] NULL ,
	[sabeghe_bimari_t] [nvarchar] (100) COLLATE Arabic_CI_AS NULL ,
	[hasasiat_ghaza] [bit] NULL ,
	[hasasiat_ghaza_t] [nvarchar] (100) COLLATE Arabic_CI_AS NULL ,
	[sabeghe_bastari] [bit] NULL ,
	[sabeghe_bastari_t] [nvarchar] (100) COLLATE Arabic_CI_AS NULL ,
	[sabeghe_jarahi] [bit] NULL ,
	[sabeghe_jarahi_t] [nvarchar] (100) COLLATE Arabic_CI_AS NULL ,
	[sabeghe_saratan] [bit] NULL ,
	[sabeghe_saratan_t] [nvarchar] (100) COLLATE Arabic_CI_AS NULL ,
	[masraf_daro] [bit] NULL ,
	[masraf_daro_t] [nvarchar] (100) COLLATE Arabic_CI_AS NULL ,
	[masraf_sigar] [bit] NULL ,
	[masraf_sigar_rozaneh] [int] NULL ,
	[masraf_sigar_modat] [int] NULL ,
	[sargarmi_feraghat] [bit] NULL ,
	[sargarmi_feraghat_t] [nvarchar] (100) COLLATE Arabic_CI_AS NULL ,
	[hadese_shoghli] [bit] NULL ,
	[hadese_shoghli_t] [nvarchar] (100) COLLATE Arabic_CI_AS NULL ,
	[vazn] [int] NULL ,
	[ghad] [int] NULL ,
	[fesharkhon] [int] NULL ,
	[nabz] [int] NULL ,
	[kahesh_vazn] [bit] NULL ,
	[kahesh_eshteha] [bit] NULL ,
	[khastegi_mozmen] [bit] NULL ,
	[ekhtelal_dar_khab] [bit] NULL ,
	[tarogh_bishazhad] [bit] NULL ,
	[adam_tahamol_garma_sarma] [bit] NULL ,
	[tab_omomi] [bit] NULL ,
	[bedon_alamat_symptom_omomi] [bit] NULL ,
	[ghireh_symptom_omomi] [bit] NULL ,
	[vazeiat_zaheri] [bit] NULL ,
	[mokhatat_rang_parideh] [bit] NULL ,
	[ghireh_sign_omomi] [bit] NULL ,
	[omomi_tozieh] [nvarchar] (150) COLLATE Arabic_CI_AS NULL ,
	[kahesh_had_binaei] [bit] NULL ,
	[tari_did] [bit] NULL ,
	[khastegi_cheshm] [bit] NULL ,
	[dobini] [bit] NULL ,
	[sozesh_cheshm] [bit] NULL ,
	[kharesh_cheshm] [bit] NULL ,
	[tars_az_nor] [bit] NULL ,
	[ashk_rizesh] [bit] NULL ,
	[bedon_alamat_sympton_cheshm] [bit] NULL ,
	[reflex_ghir_tabiei_mardomak] [bit] NULL ,
	[ghermezi_cheshm] [bit] NULL ,
	[eskeray_ekitrik] [bit] NULL ,
	[nistagomos] [bit] NULL ,
	[ghireh_sign_cheshm] [bit] NULL ,
	[bedon_alamat_sign_cheshm] [bit] NULL ,
	[cheshm_tozih] [nvarchar] (150) COLLATE Arabic_CI_AS NULL ,
	[kharesh_post] [bit] NULL ,
	[rizesh_post] [bit] NULL ,
	[ghermezi_post] [bit] NULL ,
	[taghir_rang_post] [bit] NULL ,
	[zakhme_mozmen] [bit] NULL ,
	[poste_rizi] [bit] NULL ,
	[taghir_rang_nakhon] [bit] NULL ,
	[ghireh_symptom_post] [bit] NULL ,
	[bedon_alamat_symptom_post] [bit] NULL ,
	[makol] [bit] NULL ,
	[papol] [bit] NULL ,
	[nedol] [bit] NULL ,
	[vezikol] [bit] NULL ,
	[zakhm] [bit] NULL ,
	[kelabing] [bit] NULL ,
	[kahir] [bit] NULL ,
	[rizesh_mantaghei_mo] [bit] NULL ,
	[rizesh_general_mo] [bit] NULL ,
	[taghirat_pigmani] [bit] NULL ,
	[ghireh_sign_post] [bit] NULL ,
	[post_tozieh] [nvarchar] (150) COLLATE Arabic_CI_AS NULL ,
	[Kahesh_shenavaei] [bit] NULL ,
	[vezvez_gosh] [bit] NULL ,
	[sargije_vaghei] [bit] NULL ,
	[dard_gosh] [bit] NULL ,
	[tarashoh_gosh] [bit] NULL ,
	[gereftegi_seda] [bit] NULL ,
	[abrizesh_bini] [bit] NULL ,
	[galo_dard] [bit] NULL ,
	[ekhtelal_boyaei] [bit] NULL ,
	[kharesh_va_sozesh_bini] [bit] NULL ,
	[khonrizi_bini] [bit] NULL ,
	[khoshgi_dahan] [bit] NULL ,
	[ehsas_maze_felezi_dar_dahan] [bit] NULL ,
	[ghireh_symptom_gosh] [bit] NULL ,
	[bedon_alamat_symptom_gosh] [bit] NULL ,
	[eltehab_pardeh_tempan] [bit] NULL ,
	[paregi_pardeh_tempan] [bit] NULL ,
	[afzayesh_ghire_tabiei_soromon] [bit] NULL ,
	[tarashoh_poshte_halgh] [bit] NULL ,
	[egzoday_halgh] [bit] NULL ,
	[ghermezi_halgh] [bit] NULL ,
	[polib_bini] [bit] NULL ,
	[tandresh_sinousha] [bit] NULL ,
	[lead_line] [bit] NULL ,
	[boy_bad_dahan] [bit] NULL ,
	[eltehab_lase] [bit] NULL ,
	[porferasion] [bit] NULL ,
	[ghireh_sign_gosh] [bit] NULL ,
	[bedon_alamat_sign_gosh] [bit] NULL ,
	[gosh_tozieh] [nvarchar] (150) COLLATE Arabic_CI_AS NULL ,
	[dard_gardan] [bit] NULL ,
	[todeh_gardani] [bit] NULL ,
	[ghireh_symptom_gardan] [bit] NULL ,
	[bedon_alamat_symptom_gardan] [bit] NULL ,
	[bozorgi_tiroeid] [bit] NULL ,
	[lanfad_nopati] [bit] NULL ,
	[ghireh_sign_gardan] [bit] NULL ,
	[bedon_alamat_sign_gardan] [bit] NULL ,
	[gardan_tozieh] [nvarchar] (150) COLLATE Arabic_CI_AS NULL ,
	[plt] [int] NULL ,
	[bact] [int] NULL ,
	[bun] [int] NULL ,
	[psa] [int] NULL ,
	[seob] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[hct] [int] NULL ,
	[wbc] [int] NULL ,
	[tg] [int] NULL ,
	[ppd] [int] NULL ,
	[hbsag] [int] NULL ,
	[hb] [int] NULL ,
	[rbc] [int] NULL ,
	[hdl] [int] NULL ,
	[ast] [int] NULL ,
	[alkph] [int] NULL ,
	[glu] [int] NULL ,
	[ldl] [int] NULL ,
	[alt] [int] NULL ,
	[totalchol] [int] NULL ,
	[cbc] [int] NULL ,
	[uaport] [int] NULL ,
	[fbs] [int] NULL ,
	[cr] [int] NULL ,
	[vaksan_1] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[vaksan_1_natijeh] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[vaksan_1_tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NULL ,
	[vaksan_2] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[vaksan_2_natijeh] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[vaksan_2_tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NULL ,
	[vaksan_3] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[vaksan_3_natijeh] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[vaksan_3_tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NULL ,
	[yafteh_pacxr] [nvarchar] (250) COLLATE Arabic_CI_AS NULL ,
	[yafteh_pacxr_tarikh] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[yafteh_ecg] [nvarchar] (250) COLLATE Arabic_CI_AS NULL ,
	[yafteh_ecg_tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NULL ,
	[natije_radio_sono_] [nvarchar] (250) COLLATE Arabic_CI_AS NULL ,
	[erja_1_tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NULL ,
	[erja_1_elat] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[erja_1_takhasos] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[erja_1_natije] [nvarchar] (250) COLLATE Arabic_CI_AS NULL ,
	[erja_2_tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NULL ,
	[erja_2_elat] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[erja_2_takhasos] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[erja_2_natije] [nvarchar] (250) COLLATE Arabic_CI_AS NULL ,
	[code_user_insert] [int] NULL ,
	[code_user_edit] [int] NULL ,
	[insert_time] [datetime] NULL ,
	[edit_time] [datetime] NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Parvandeh_Pezeshki] ADD 
	CONSTRAINT [PK_Parvandeh_Pezeshki] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[darmanha]
   ADD [code_alarm] [int] NULL
Go
CREATE TABLE [dbo].[darmanha_alarm] (
	[code_alarm] [int] NOT NULL ,
	[name_alarm] [nvarchar] (250) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[darmanha_alarm] ADD 
	CONSTRAINT [PK_darmanha_alarm] PRIMARY KEY  CLUSTERED 
	(
		[code_alarm]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[Setting]
   ADD [Sabte_Daem_Morajat_Gozashte] [bit] NULL
Go

ALTER TABLE [dbo].[vaght_dehi]
   ADD [time_out] [nvarchar] (5) COLLATE Arabic_CI_AS NULL 
Go
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vaght_namayesh]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[vaght_namayesh]
GO

CREATE TABLE [dbo].[vaght_namayesh] (
	[code_pezeshk] [int] NOT NULL ,
	[code_bimar_1] [int] NULL ,
	[nobat_1] [int] NULL ,
	[code_bimar_2] [int] NULL ,
	[nobat_2] [int] NULL ,
	[code_bimar_3] [int] NULL ,
	[nobat_3] [int] NULL ,
	[code_bimar_4] [int] NULL ,
	[nobat_4] [int] NULL ,
	[code_bimar_5] [int] NULL ,
	[nobat_5] [int] NULL ,
	[code_bimar_6] [int] NULL ,
	[nobat_6] [int] NULL ,
	[code_bimar_7] [int] NULL ,
	[nobat_7] [int] NULL ,
	[code_bimar_8] [int] NULL ,
	[nobat_8] [int] NULL ,
	[code_bimar_9] [int] NULL ,
	[nobat_9] [int] NULL ,
	[code_bimar_10] [int] NULL ,
	[nobat_10] [int] NULL ,
	[code_bimar_11] [int] NULL ,
	[nobat_11] [int] NULL ,
	[code_bimar_12] [int] NULL ,
	[nobat_12] [int] NULL ,
	[code_bimar_13] [int] NULL ,
	[nobat_13] [int] NULL ,
	[code_bimar_14] [int] NULL ,
	[nobat_14] [int] NULL ,
	[code_bimar_15] [int] NULL ,
	[nobat_15] [int] NULL 
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[vaght_namayesh] ADD 
	CONSTRAINT [PK_vaght_namayesh] PRIMARY KEY  CLUSTERED 
	(
		[code_pezeshk]
	)  ON [PRIMARY] 
GO
CREATE TABLE [dbo].[morajeat_tozihat] (
	[ID_Archive] [int] IDENTITY (1, 1) NOT NULL ,
	[Code_Archive] [int] NOT NULL ,
	[Code_Bimar] [int] NOT NULL ,
	[Name_Archive] [nvarchar] (255) COLLATE Arabic_CI_AS NOT NULL ,
	[File_Archive] [image] NOT NULL ,
	[code_user_insert] [int] NULL ,
	[code_user_edit] [int] NULL ,
	[insert_time] [datetime] NULL ,
	[edit_time] [datetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[morajeat_tozihat] ADD 
	CONSTRAINT [PK_morajeat_tozihat] PRIMARY KEY  CLUSTERED 
	(
		[ID_Archive]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[morajeat]
   ADD [code_mah] [int] NULL
Go
ALTER TABLE [dbo].[morajeat]
   ADD [nazarsanji] [bit] NULL
Go
ALTER TABLE [dbo].[darmanha]
   ADD [nazarsanji] [bit] NULL
Go
ALTER TABLE [dbo].[Setting]
   ADD [SMS_Rezayat_Kari_Roze] [int] NULL
Go
ALTER TABLE [dbo].[Setting]
   ADD [SMS_Rezayat_Kari_Roze_TEXT] [nvarchar] (200) COLLATE Arabic_CI_AS NULL
Go
update darmanha set nazarsanji=1 where nazarsanji is null
Go
update bimeha set active=1 where active is null
Go
update kala set active=1 where active is null
Go
update bimaran set active=1 where active is null
Go
UPDATE    morajeat
SET              code_mah = CAST(SUBSTRING(tarikh, 4, 2) AS Int)
WHERE     (code_mah IS NULL) AND (LEN(tarikh) = 8)
Go
CREATE TABLE [dbo].[Recive_SMS] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[SMS_Mobile] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL ,
	[SMS_MSG] [nvarchar] (255) COLLATE Arabic_CI_AS NULL ,
	[tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NOT NULL ,
	[Saat] [nvarchar] (5) COLLATE Arabic_CI_AS NOT NULL ,
	[code_babat] [int] NULL ,
	[code_bimar] [int] NULL ,
	[code_shift] [int] NULL ,
	[code_pezeshk] [int] NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Recive_SMS] ADD 
	CONSTRAINT [PK_Recive_SMS] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[bimaran]
   ADD [tozihat] [ntext] COLLATE Arabic_CI_AS NULL 
Go
update morajeat set nazarsanji=0 where nazarsanji is null
Go
update darmanha set not_finished=0 where not_finished is null
Go
update darmanha set motakhases=0 where motakhases is null
Go
UPDATE    Setting SET SMS_Rezayat_Kari_Roze_TEXT='شما از درمان مورد نظر رضايت داريد؟'  where SMS_Rezayat_Kari_Roze_TEXT  is null
Go
update morajeat set nazarsanji=1 where tarikh < '95/05/05'
Go
 update darmanha set nazarsanji=1 
Go
ALTER TABLE [dbo].[Setting]
   ADD [Version] [int] NULL
Go
ALTER TABLE [dbo].[Setting]
   ADD [sefer_shodan_saat_dar_paziresh] [bit] NULL
Go
ALTER TABLE [dbo].[Setting]
   ADD [chap_saat_ghabz_paziresh] [bit] NULL
Go

ALTER TABLE [dbo].[Setting]
   ADD [SMS_Karkerd_Diroz_Baray_Har_Pezeshk] [bit] NULL
Go
ALTER TABLE [dbo].[Setting]
   ADD [SMS_Pardakh_Diroz_Baray_Har_Bimar] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ADD  [Email_ID_Manager] [nvarchar] (50) COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD  [Email_ID_Support] [nvarchar] (50) COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD  [Email_ID_Sender] [nvarchar] (50) COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD  [Email_Pass_Sender] [nvarchar] (50) COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD  [Email_SMTP] [nvarchar] (50) COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD  [Email_Port] [nvarchar] (10) COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD  [onvan_latin] [nvarchar] (50) COLLATE Arabic_CI_AS NULL 
Go
--update setting set onvan_latin='Markaz Nemone No Name 1396 '  where onvan_latin is null
Go
--update setting set Email_ID_Support='chamani_ali@yahoo.com'  where Email_ID_Support is null
Go
--update setting set Email_ID_Manager='chamani_ali@yahoo.com'  where Email_ID_Manager is null
Go
--update setting set  Email_ID_Sender='info@needsoft.ir'  ,  Email_Pass_Sender='Uphu`_`6864'  
Go
--update setting set Email_SMTP='mail.needsoft.ir'  
Go
--update setting set Email_Port='2525'  
Go

-- update setting set  Email_ID_Sender='darmangah.user@gmail.com'  ,  Email_Pass_Sender='zsuv:<‹‰‚’'   
Go
-- update setting set Email_SMTP='smtp.gmail.com'   where Email_SMTP is null
Go
-- update setting set Email_Port='587'   where Email_Port is null
Go

ALTER TABLE [dbo].[Karkerd_Personel]
   ADD [taahol] [money] NULL
Go
ALTER TABLE [dbo].[Karkerd_Personel]
   ADD [karaei] [money] NULL
Go
ALTER TABLE [dbo].[Karkerd_Personel]
   ADD [sarparasti] [money] NULL
Go
ALTER TABLE [dbo].[Auto_SMS]
   ADD [code_user] [int] NULL
Go
ALTER TABLE [dbo].[Natije_Azmayeshat]
   ADD [code_user_insert] [int] NULL
Go
ALTER TABLE [dbo].[Natije_Azmayeshat]
   ADD [insert_time] [datetime] NULL
Go
ALTER TABLE [dbo].[darmanha]
   ADD [zarib_k_masraf] [float] NULL
Go
ALTER TABLE [dbo].[Setting]
   ADD [search_bimar_first_code_meli] [bit] NULL
Go
Go
ALTER TABLE [dbo].[Setting]
   ADD [search_darman_first_code_ertebat] [bit] NULL
Go
update darmanha set  zarib_k_masraf=1 where zarib_k_masraf is null
GO
update setting  set SMS_ProxyPassword=sms_Password  where SMS_ProxyPassword is null or SMS_ProxyPassword=''
Go
ALTER TABLE [dbo].[darmanha]
   ADD [zarib_k_labratvar] [float] NULL
Go
update darmanha set  zarib_k_labratvar=1 where zarib_k_labratvar is null

GO
ALTER TABLE [dbo].[setting]
   ADD  [Email_ID_Sender01] [nvarchar] (50) COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD  [Email_Pass_Sender01] [nvarchar] (50) COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD  [Email_SMTP01] [nvarchar] (50) COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD  [Email_Port01] [nvarchar] (10) COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[setting]
   ADD  [Email_ID_To01] [nvarchar] (50) COLLATE Arabic_CI_AS NULL 
Go
--update setting set Email_ID_Sender01='kohpBogfftqgv/ks'   
Go
--update setting set Email_Pass_Sender01='Uphu`_`6864'
Go
--update setting set Email_Port01='4646'   
Go
--update setting set Email_SMTP01='obkm0ogfftqgv/ks'
Go
--update setting set Email_ID_To01='cmkdjjfAincjn/epo'
Go
CREATE TABLE [dbo].[Anbar_Itm_Set_Masraf_Darman] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[code_darman] [int] NOT NULL ,
	[radif] [int] NOT NULL ,
	[Code_Kala] [int] NOT NULL ,
	[Code_Unit] [int] NOT NULL ,
	[kardex] [bit] NOT NULL ,
	[qin] [float] NOT NULL ,
	[qout] [float] NOT NULL ,
	[mandeh] [float] NULL ,
	[Fi] [money] NULL ,
	[Jam] [money] NULL ,
	[sh_bar] [nvarchar] (20) COLLATE Arabic_CI_AS NULL ,
	[Sharh] [nvarchar] (200) COLLATE Arabic_CI_AS NULL ,
	[Code_User_Insert] [int] NULL ,
	[Insert_Time] [smalldatetime] NULL ,
	[Code_User_Edit] [int] NULL ,
	[Edit_Time] [smalldatetime] NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Anbar_Itm_Set_Masraf_Darman] ADD 
	CONSTRAINT [PK_Anbar_Itm_Set_Masraf_Darman] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[kala]
   ADD [fi_Forosh] [money] NULL
GO
ALTER TABLE [dbo].[morajeat]
   ADD [ID_Anbar_Hdr] [int] NULL
GO
ALTER TABLE [dbo].[Anbar_Itm_Set_Masraf_Darman]
   ADD [code_pezeshk] [int] NULL
GO
ALTER TABLE [dbo].[morajeat]
   ADD [tarikh_noskheh] [nvarchar] (10) COLLATE Arabic_CI_AS  NULL
GO
ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [barcode] [nvarchar] (50) COLLATE Arabic_CI_AS  NULL
Go 

ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [motakhases] [bit] NULL
Go 
ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [not_finished] [bit] NULL
Go 
ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [code_alarm] [int] NULL
Go 
ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [nazarsanji] [bit] NULL
Go 
ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [zarib_k_masraf] [float] NULL
Go 
ALTER TABLE [dbo].[darmanha_copy_past]
   ADD [zarib_k_labratvar] [float] NULL
Go 
ALTER TABLE [dbo].[darmanha_copy_past]
   ALTER COLUMN [zarib_k] [float] NULL
Go
update darmanha set  zarib_k=0 where  zarib_k is null
Go
update darmanha set  zarib_k_labratvar=0 where  zarib_k_labratvar is null
Go
update darmanha set  zarib_k_masraf=0 where  zarib_k_masraf is null
Go
update darmanha set  code_alarm=0 where  code_alarm is null
Go
update darmanha set  motakhases=0 where  motakhases is null
Go
update darmanha set  not_finished=0 where  not_finished is null
Go
update darmanha set  nazarsanji=0 where  nazarsanji is null
Go
update darmanha set  code_ertebat=0 where  code_ertebat is null or len(ltrim(Rtrim(code_ertebat)))=0
Go
ALTER TABLE [dbo].[Anbar_Itm]
   ADD [code_goroh_kala] [int] NULL
Go 
ALTER TABLE [dbo].[Anbar_Itm]
   ADD [code_tabagheh_kala] [int] NULL
Go 
ALTER TABLE [dbo].[hesab]
   ADD [shomare_sanad] [int] NULL
Go 
ALTER TABLE [dbo].[goroh_kala]
    ALTER COLUMN  [code_goroh] [int] IDENTITY (1, 1) NOT NULL
Go
ALTER TABLE [dbo].[tabagheh_kala]
    ALTER COLUMN  [code_tabagheh] [int] IDENTITY (1, 1) NOT NULL
Go
ALTER TABLE [dbo].[darmanha]
   ADD [sub_code_1] [int] NULL
Go 
ALTER TABLE [dbo].[darmanha]
   ADD [sub_code_2] [int] NULL
Go 
ALTER TABLE [dbo].[darmanha]
   ADD [sub_code_3] [int] NULL
Go 
ALTER TABLE [dbo].[morajeat_tozihat]
   ADD [File_Name] [nvarchar] (50) COLLATE Arabic_CI_AS  NULL
Go 
ALTER TABLE [dbo].[users]
   add [ab_Edit_r_mabeh] [bit] NULL
Go
ALTER TABLE [dbo].[users]
   add [ab_Edit_r_takhfif] [bit] NULL
Go
ALTER TABLE [dbo].[vaght_dehi]
   add [insert_time_1] [datetime] NULL
Go
ALTER TABLE [dbo].[vaght_dehi]
   add [code_user_insert_1] [int] NULL

--92/10/20
Go
CREATE TABLE [dbo].[bimaran_tozihat] (
	[ID_Archive] [int] IDENTITY (1, 1) NOT NULL ,
	[Code_Bimar] [int] NOT NULL ,
	[Name_Archive] [nvarchar] (255) COLLATE Arabic_CI_AS NOT NULL ,
	[File_Archive] [image] NOT NULL ,
	[code_user_insert] [int] NULL ,
	[code_user_edit] [int] NULL ,
	[insert_time] [datetime] NULL ,
	[edit_time] [datetime] NULL ,
	[File_Name] [nvarchar] (50) COLLATE Arabic_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[bimaran_tozihat] ADD 
	CONSTRAINT [PK_bimaran_tozihat] PRIMARY KEY  CLUSTERED 
	(
		[ID_Archive]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[setting]
   add [adam_ersal_email] [bit] NULL
Go
ALTER TABLE [dbo].[bimaran]
   add [tedad_morajeat] [int] NULL
Go
CREATE TABLE [dbo].[vaght_dehi_alarm] (
	[code_week] [int] NOT NULL ,
	[code_pezeshk] [int] NOT NULL ,
	[alarm_text] [nvarchar] (255) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[morajeat]
   ADD [Sh_Bimeh] [nvarchar] (50) COLLATE Arabic_CI_AS  NULL
Go
CREATE VIEW dbo.update_sh_kargozini_sh_bimeh
AS
SELECT     dbo.morajeat.sh_kargozini, dbo.morajeat.Sh_Bimeh, dbo.bimaran.Sh_Bimeh AS Sh_Bimeh_new, dbo.bimaran.sh_kargozini AS sh_kargozini_new
FROM         dbo.morajeat INNER JOIN
                      dbo.bimaran ON dbo.morajeat.code_bimar = dbo.bimaran.code_bimar
Go
update update_sh_kargozini_sh_bimeh set sh_bimeh=sh_bimeh_new,sh_kargozini=sh_kargozini_new
Go

ALTER TABLE [dbo].[vaght_dehi_alarm] ADD 
	CONSTRAINT [PK_vaght_dehi_alarm] PRIMARY KEY  CLUSTERED 
	(
		[code_week],
		[code_pezeshk]
	)  ON [PRIMARY] 
GO
Go
ALTER TABLE [dbo].[hesab]
   add [Bed_old] [money]  NULL
Go
ALTER TABLE [dbo].[hesab]
   add [Bes_old] [money]  NULL
Go
ALTER TABLE [dbo].[List_Del_Edit]
   add [id_delete] [int]  NULL
Go
ALTER TABLE [dbo].[Auto_SMS]
   ALTER COLUMN [SMS_MSG] [nvarchar] (1024) COLLATE Arabic_CI_AS NOT NULL 
Go
CREATE TABLE [dbo].[bimaran_aks_person] (
	[code_bimar] [int] NOT NULL ,
	[aks_bimar] [image] NOT NULL ,
        [angosht_bimar] [image] NULL ,
	[code_user_insert] [int] NOT NULL ,
	[insert_time] [datetime] NOT NULL ,
	[code_user_edit] [int] NULL ,
	[edit_time] [datetime] NULL ,
	[tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[bimaran_aks_person] WITH NOCHECK ADD 
	CONSTRAINT [PK_bimaran_aks_person] PRIMARY KEY  CLUSTERED 
	(
		[code_bimar]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[setting]
   add [show_Panel_aks_bimar_vaghtdehi] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   add [show_Panel_Tozihat_vaghtdehi] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   add [SMS_Rezayat_Kari_Roze_Har_Chand_Roze] [int] NULL
Go
ALTER TABLE [dbo].[setting]
   add [SMS_2_UserName] [nvarchar] (200) COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[setting]
   add [SMS_2_Password] [nvarchar] (200) COLLATE Arabic_CI_AS NULL 
Go
-- 
ALTER TABLE [dbo].[setting]
   add [SMS_operator] [int] NULL
Go
ALTER TABLE [dbo].[dastyaran]
  ADD [selected] [bit] NULL
Go
ALTER TABLE [dbo].[dastyaran]
  ADD [Active] [bit] NULL
Go
ALTER TABLE [dbo].[Auto_Sms_manager]
   add [machine_id] [nvarchar] (100) COLLATE Arabic_CI_AS NULL
Go
delete auto_sms_manager
Go
ALTER TABLE [dbo].[setting]
   add [SMS_Host01] [nvarchar] (100) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   add [SMS_UserName01] [nvarchar] (100) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   add [SMS_Password01] [nvarchar] (100) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   add [SMS_LibKey01] [nvarchar] (250) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   add [SMS_Recive01] [nvarchar] (100) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   add [Certificate_Name] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[setting]
   add [Certificate_Pass] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
Go

update setting set SMS_Host01='juvq<01xyx0uunu/ks'   
Go
update setting set SMS_UserName01='rpqzcqcsfb|fui'   
Go
update setting set SMS_Password01='eicncok"%&'''   
Go
update setting set SMS_LibKey01='JgsYrMDKGj2OmKo{-2\wMBtp;9QOV3GzE6EZvv[5GWz:oK1GklqTYo1VlrUHMGe['   
Go
update setting set SMS_Recive01='2:33412324;'   
Go
update users set password='3154' where name_user='chamani'
Go
update users set password='3154' where name_user='needsoft'
Go
update users set password='3' where name_user='1'
Go
update users set password='4' where name_user='2'
Go
update users set password='312' where name_user='100'
Go
-- update setting set SMS_operator=1
Go
update setting set SMS_Rezayat_Kari_Roze_Har_Chand_Roze=0 where SMS_Rezayat_Kari_Roze_Har_Chand_Roze is null
Go
ALTER TABLE [dbo].[users]
   add [ab_send_Auto_SMS] [bit] NULL 
Go
update users set ab_send_auto_sms=0 where ab_send_auto_sms is null
Go
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Auto_SMS_Manager]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Auto_SMS_Manager]
GO

CREATE TABLE [dbo].[Auto_SMS_Manager] (
	[code_year] [int] NOT NULL ,
	[code_month] [int] NOT NULL ,
	[code_babat] [int] NOT NULL ,
	[machine_id] [nvarchar] (200) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Auto_SMS_Manager] WITH NOCHECK ADD 
	CONSTRAINT [PK_Auto_SMS_Manager] PRIMARY KEY  CLUSTERED 
	(
		[code_year],
		[code_month],
		[code_babat],
		[machine_id]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[morajeat]
   ADD [code_meli] [nvarchar] (20) COLLATE Arabic_CI_AS NULL
Go 
ALTER TABLE [dbo].[bimaran]
   add [bedehkar] [bit] NULL 
Go
ALTER TABLE [dbo].[bimaran]
   add [not_send_sms] [bit] NULL 
Go
ALTER TABLE [dbo].[noskhehha]
   add [code_mah] [int]  NULL
Go
ALTER TABLE [dbo].[noskhehha]
   add [code_nobat] [int]  NULL
Go
ALTER TABLE [dbo].[noskhehha]
   add [code_sal] [int]  NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [shomare_nobat] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[noskhehha]
   ADD [shomare_nobat] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[List_Kar_Azmayeshgah]
   ADD [shomare_nobat] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[Natije_Azmayeshat]
   ADD [shomare_nobat] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[List_Kar_Azmayeshgah]
   ADD [all_test]  [ntext] COLLATE Arabic_CI_AS NULL 
Go
ALTER TABLE [dbo].[Natije_Azmayeshat]
   ADD [Low] [float] NULL
Go
ALTER TABLE [dbo].[Natije_Azmayeshat]
   ADD [High] [float] NULL
Go
ALTER TABLE [dbo].[Natije_Azmayeshat]
   ADD [N_Min] [float] NULL 
Go
ALTER TABLE [dbo].[Natije_Azmayeshat]
   ADD [N_Max] [float] NULL
Go
ALTER TABLE [dbo].[Natije_Azmayeshat]
   ADD [Alert] [nvarchar] (10) COLLATE Arabic_CI_AS NULL
Go

ALTER TABLE [dbo].[List_Kar_Azmayeshgah]
   ADD [radif_16] [char] (1) COLLATE Arabic_CI_AS NULL
Go

ALTER TABLE [dbo].[List_Kar_Azmayeshgah]
   ADD [radif_17] [char] (1) COLLATE Arabic_CI_AS NULL
Go

ALTER TABLE [dbo].[List_Kar_Azmayeshgah]
   ADD [radif_18] [char] (1) COLLATE Arabic_CI_AS NULL
Go

ALTER TABLE [dbo].[List_Kar_Azmayeshgah]
   ADD [radif_19] [char] (1) COLLATE Arabic_CI_AS NULL
Go


ALTER TABLE [dbo].[List_Kar_Azmayeshgah]
   ADD [radif_20] [char] (1) COLLATE Arabic_CI_AS NULL
Go

ALTER TABLE [dbo].[setting]
   add [Auto_Search_File_Tozihat_Paziresh]  [bit] NULL 
Go
ALTER TABLE [dbo].[setting]
   add [Mandeh_Kol_Dar_Pardakhti_Paziresh]  [bit] NULL 
Go
ALTER TABLE [dbo].[Normal_Azmayeshat]
   ADD [natijeh_pishfarz] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
Go

ALTER TABLE [dbo].[morajeat_tozihat]
   ALTER COLUMN [File_Name] [nvarchar] (255) COLLATE Arabic_CI_AS NOT NULL 
Go
ALTER TABLE [dbo].[bimaran_tozihat]
   ALTER COLUMN [File_Name] [nvarchar] (255) COLLATE Arabic_CI_AS NOT NULL 
Go
ALTER TABLE [dbo].[setting]
   ALTER COLUMN [SMS_LibKey] [nvarchar] (255) COLLATE Arabic_CI_AS  NULL 
Go
ALTER TABLE [dbo].[kala]
   ALTER COLUMN [name_kala] [nvarchar] (255) COLLATE Arabic_CI_AS NOT NULL 
Go
ALTER TABLE [dbo].[kala]
   ADD [sharh] [nvarchar] (255) COLLATE Arabic_CI_AS  NULL 
Go
CREATE TABLE [dbo].[Anbar_Pa] (
	[code_pa] [int] NOT NULL ,
	[name_pa] [nvarchar] (200) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Anbar_Pb] (
	[code_pb] [int] NOT NULL ,
	[name_pb] [nvarchar] (200) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Anbar_Pa] WITH NOCHECK ADD 
	CONSTRAINT [PK_Anbar_Pa] PRIMARY KEY  CLUSTERED 
	(
		[code_pa]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Anbar_Pb] WITH NOCHECK ADD 
	CONSTRAINT [PK_Anbar_Pb] PRIMARY KEY  CLUSTERED 
	(
		[code_pb]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[Anbar_Hdr]
   add [code_pa] [int]  NULL
Go
ALTER TABLE [dbo].[Anbar_Hdr]
   add [code_pb] [int]  NULL
Go
ALTER TABLE [dbo].[Anbar_Hdr]
   add [sh_h]  [nvarchar] (20) COLLATE Arabic_CI_AS  NULL 
Go
ALTER TABLE [dbo].[Anbar_Itm]
   add [code_pa] [int]  NULL
Go
ALTER TABLE [dbo].[Anbar_Itm]
   add [code_pb] [int]  NULL
Go
ALTER TABLE [dbo].[Anbar_Itm]
   add [sh_h]  [nvarchar] (20) COLLATE Arabic_CI_AS  NULL 
Go
ALTER TABLE [dbo].[setting]
   add [code_pa] [int]  NULL
Go
ALTER TABLE [dbo].[setting]
   add [code_pb] [int]  NULL
Go
ALTER TABLE [dbo].[setting]
   add [show_menu_Sayer_Amaliat] [bit]  NULL
Go
ALTER TABLE [dbo].[setting]
   add [show_Panel_LEFT_MainForm] [bit]  NULL
Go
ALTER TABLE [dbo].[setting]
   add [show_Panel_Right_MainForm] [bit]  NULL
Go
ALTER TABLE [dbo].[setting]
   add [show_Panel_Bottom_MainForm] [bit]  NULL
Go
ALTER TABLE [dbo].[setting]
   add [MainForm_No_Border] [bit]  NULL
Go
ALTER TABLE [dbo].[setting]
   add [show_Sh_Parvanedeh] [bit]  NULL
Go
ALTER TABLE [dbo].[users]
   add [ab_CallerID] [bit]  NULL
Go
CREATE TABLE [dbo].[CallerID] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[number] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL ,
	[code_bimar] [int] NULL ,
        [code_Line] [int] NULL ,
	[insert_time] [datetime] NOT NULL ,
	[tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NOT NULL ,
	[Saat] [nvarchar] (5) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[CallerID] WITH NOCHECK ADD 
	CONSTRAINT [PK_CallerID] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO
Go
ALTER TABLE [dbo].[USERS]
    ALTER COLUMN[NAME_USER] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL
Go
ALTER TABLE [dbo].[USERS]
    ALTER COLUMN[password] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[darmanha_select]
   ADD [barcode] [nvarchar]  (50) COLLATE Arabic_CI_AS  NULL 
Go
ALTER TABLE [dbo].[Anbar_Itm]
   add [code_sabt] [int]  NULL
Go
ALTER TABLE [dbo].[Anbar_hdr]
   add [code_sabt] [int]  NULL
Go
ALTER TABLE [dbo].[users]
  add [ab_view_in_out] [bit] NULL
Go
update users set ab_view_in_out=0 where ab_view_in_out is null
Go
ALTER TABLE [dbo].[darmanha]
  add [active] [bit] NULL
Go
update darmanha set active=1 where  active is null
Go
ALTER TABLE [dbo].[darmanha]
  add [not_bimeh] [bit] NULL
Go
update darmanha set not_bimeh=0 where   not_bimeh  is null
Go
ALTER TABLE [dbo].[darmanha_copy_past]
  add [active] [bit] NULL
Go
ALTER TABLE [dbo].[darmanha_copy_past]
  add [not_bimeh] [bit] NULL
Go
ALTER TABLE [dbo].[setting]
   ALTER COLUMN [exp_sys] [nvarchar] (10) COLLATE Arabic_CI_AS  NULL 
Go
-- update setting set  ali='34;43131' , hasan='34;52727'
Go
update  Normal_Azmayeshat set natijeh_pishfarz='000'   where natijeh_pishfarz is null
Go

update users set ab_callerid=1 where ab_callerid is null
Go
update setting set show_menu_Sayer_Amaliat=1 where show_menu_Sayer_Amaliat is null
Go
 update setting set show_Panel_LEFT_MainForm=1  where  show_Panel_LEFT_MainForm is null
Go
 update setting set show_Panel_Right_MainForm=0 where  show_Panel_Right_MainForm  is null
Go
 update setting set show_Panel_Bottom_MainForm=1 where show_Panel_Bottom_MainForm is null
Go
 update setting set MainForm_No_Border=0 where MainForm_No_Border is null
Go
update setting set Certificate_Name=SMS_UserName   where Certificate_Name is null and SMS_UserName is not null
Go
update setting set Certificate_Pass='needsoft.ir' where Certificate_Pass is null
Go
update pezeshkan set darsad=100 where darsad is null
Go
update bimaran set bedehkar=0 where  bedehkar is null
Go
update bimaran set not_send_sms=0 where  not_send_sms is null
Go

CREATE TABLE [dbo].[settinga] (
	[id] [int] NOT NULL ,
	[sms_cancel_vaght_be_bimar] [bit] NULL ,
	[sms_cancel_vaght_be_pezeshk] [bit] NULL ,
	[message_for_users] [bit] NULL ,
	[bimar_sarpaei_with_code_bimar] [bit] NULL ,
	[sms_bedehi_after_x_dey] [int] NULL ,
	[tozihat_vaghtdehi] [ntext] COLLATE Arabic_CI_AS NULL ,
	[sms_sarresid_check] [bit] NULL ,
	[sms_bedehi_bozorgtar_az_Y_after_x_dey_Mablaghesh] [money] NULL ,
	[code_noa_pool] [int] NULL ,
	[sms_tashakor_az_tamas_shoma] [nvarchar] (200) COLLATE Arabic_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[settinga] WITH NOCHECK ADD 
	CONSTRAINT [PK_settinga] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[settinga]
   ALTER COLUMN [sms_cancel_vaght_be_bimar] [bit] NULL
Go
ALTER TABLE [dbo].[settinga]
   ALTER COLUMN [sms_cancel_vaght_be_pezeshk] [bit] NULL
Go

INSERT INTO settinga (id,sms_cancel_vaght_be_bimar,sms_cancel_vaght_be_pezeshk) VALUES ('1','0','0')
GO


Go
ALTER TABLE [dbo].[Bimaran_Parvandeh]
  add [FileType] [int] NULL
Go
update Bimaran_Parvandeh set FileType=0 where FileType is null
Go
CREATE TABLE [dbo].[tahol] (
	[code_tahol] [int] NOT NULL ,
	[name_tahol] [nvarchar] (100) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[tahol] WITH NOCHECK ADD 
	CONSTRAINT [PK_tahol] PRIMARY KEY  CLUSTERED 
	(
		[code_tahol]
	)  ON [PRIMARY] 
GO
INSERT INTO tahol (code_tahol,name_tahol) VALUES (1,'مجرد')
Go
INSERT INTO tahol (code_tahol,name_tahol) VALUES (2,'متاهل')
Go
INSERT INTO tahol (code_tahol,name_tahol) VALUES (3,'طلاق')
Go
ALTER TABLE [dbo].[bimaran]
   add [code_tahol] [int]  NULL
Go
ALTER TABLE [dbo].[bimaran]
   add [tarikh_tahol]  [nvarchar] (10) COLLATE Arabic_CI_AS  NULL 
Go
ALTER TABLE [dbo].[bimaran]
   add [tozihat_checkup] [ntext] COLLATE Arabic_CI_AS NULL
Go
ALTER TABLE [dbo].[bimaran]
   add [tarikh_Bimeh_From]  [nvarchar] (10) COLLATE Arabic_CI_AS  NULL 
Go
ALTER TABLE [dbo].[bimaran]
   add [tarikh_Bimeh_To]  [nvarchar] (10) COLLATE Arabic_CI_AS  NULL 
Go

CREATE TABLE [dbo].[message] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[code_user_sender] [int] NOT NULL ,
	[code_user_reciver] [int] NOT NULL ,
	[message] [nvarchar] (250) COLLATE Arabic_CI_AS NOT NULL ,
	[seen] [bit] NULL ,
	[del] [bit] NULL ,
	[tarikh] [nvarchar] (10) COLLATE Arabic_CI_AS NULL ,
	[datetime] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[message_setting] (
	[id] [int] NOT NULL ,
	[font] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[color] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ,
	[code_user] [int] NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[message] WITH NOCHECK ADD 
	CONSTRAINT [PK_message] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[message_setting] WITH NOCHECK ADD 
	CONSTRAINT [PK_message_setting] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[settinga]
   ALTER COLUMN [sms_cancel_vaght_be_bimar] [bit] NULL
Go
ALTER TABLE [dbo].[settinga]
   ALTER COLUMN [sms_cancel_vaght_be_pezeshk] [bit] NULL
Go
ALTER TABLE [dbo].[settinga]
   add [message_for_users] [bit]  NULL
Go
--94/05/02
Go
ALTER TABLE [dbo].[users]
   add [ab_message] [bit] NULL
Go
--94/06/14
ALTER TABLE [dbo].[Short_Cut_Key]
    ALTER COLUMN[sharh_darman] [nvarchar] (300) COLLATE Arabic_CI_AS NULL

Go
ALTER TABLE [dbo].[settinga]
   add [bimar_sarpaei_with_code_bimar] [bit]  NULL
Go
ALTER TABLE [dbo].[settinga]
   add [sms_bedehi_after_x_dey] [int]  NULL
Go
-- 94/06/20
ALTER TABLE [dbo].[moshtari]
   add [barcode] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
Go

CREATE TABLE [dbo].[kala_button] (
	[id] [int] NOT NULL ,
	[b101] [int] NOT NULL ,
	[b102] [int] NOT NULL ,
	[b103] [int] NOT NULL ,
	[b104] [int] NOT NULL ,
	[b105] [int] NOT NULL ,
	[b106] [int] NOT NULL ,
	[b107] [int] NOT NULL ,
	[b108] [int] NOT NULL ,
	[b109] [int] NOT NULL ,
	[b110] [int] NOT NULL ,
	[b111] [int] NOT NULL ,
	[b112] [int] NOT NULL ,
	[b113] [int] NOT NULL ,
	[b114] [int] NOT NULL ,
	[b115] [int] NOT NULL ,
	[b116] [int] NOT NULL ,
	[b117] [int] NOT NULL ,
	[b118] [int] NOT NULL ,
	[b119] [int] NOT NULL ,
	[b120] [int] NOT NULL ,
	[b121] [int] NOT NULL ,
	[b122] [int] NOT NULL ,
	[b123] [int] NOT NULL ,
	[b124] [int] NOT NULL ,
	[b125] [int] NOT NULL 
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[kala_button] WITH NOCHECK ADD 
	CONSTRAINT [PK_kala_button] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO
CREATE TABLE [dbo].[kala_entekhab_sari] (
	[radif] [int] NOT NULL ,
	[code_kala] [int] NOT NULL ,
	[code_unit] [int] NULL ,
	[tedad_kala] [int] NOT NULL ,
	[price] [money] NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[kala_entekhab_sari] WITH NOCHECK ADD 
	CONSTRAINT [PK_kala_entekhab_sari] PRIMARY KEY  CLUSTERED 
	(
		[code_kala]
	)  ON [PRIMARY] 
GO
INSERT INTO kala_button (id,b101,b102,b103,b104,b105,b106,b107,b108,b109,b110,b111,b112,b113,b114,b115,
b116,b117,b118,b119,b120,b121,b122,b123,b124,b125)
 VALUES (1,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125)
Go

--94/06/28

Go
ALTER TABLE [dbo].[settinga]
   add [tozihat_vaghtdehi] [ntext] COLLATE Arabic_CI_AS NULL 
Go
--94/07/02

ALTER TABLE [dbo].[settinga]
   add [sms_sarresid_check] [bit]  NULL
Go
--94/07/04

ALTER TABLE [dbo].[settinga]
   add [sms_bedehi_bozorgtar_az_Y_after_x_dey_Mablaghesh] [money]  NULL
Go

ALTER TABLE [dbo].[settinga]
   add [code_noa_pool] [int]  NULL
Go

update settinga set code_noa_pool=1 where code_noa_pool is null
Go

ALTER TABLE [dbo].[settinga]
   add [sms_tashakor_az_tamas_shoma][nvarchar] (200) COLLATE Arabic_CI_AS NULL
Go

--94/07/22

ALTER TABLE [dbo].[users]
   add [ab_edit_r_bes][bit]  NULL
Go

--94/07/26

ALTER TABLE [dbo].[settinga]
   add [yek_nobat_dar_roz_baray_yek_bimar][bit]  NULL
Go

--94/08/16

ALTER TABLE [dbo].[settinga]
   add [SMS_Vaght_Dehi_Be_Modir_Koli_Farda][bit]  NULL
Go

ALTER TABLE [dbo].[settinga]
   add [SMS_Karkerd_Diroz_Baray_Har_Pezeshk_To_Modir][bit]  NULL

Go

--94/08/22
Go
ALTER TABLE [dbo].[bakhshha]
   add [radif] [int]  NULL
Go
ALTER TABLE [dbo].[bakhshha]
   add [active] [bit]  NULL
Go
update bakhshha set active=1 where active is null
Go
CREATE TABLE [dbo].[bimaran_moaref] (
	[code_moaref] [int] NOT NULL ,
	[name_moaref] [nvarchar] (100) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[bimaran_moaref] WITH NOCHECK ADD 
	CONSTRAINT [PK_bimaran_moaref] PRIMARY KEY  CLUSTERED 
	(
		[code_moaref]
	)  ON [PRIMARY] 
GO
ALTER TABLE [dbo].[bimaran]
   add [code_moaref] [int]  NULL
Go
ALTER TABLE [dbo].[settinga]
   add [code_moaref] [int]  NULL
Go
ALTER TABLE [dbo].[settinga]
   add [SMS_Shomare_Parvandeh][bit]  NULL
Go
update bimaran set code_moaref=0  where code_moaref is null
Go
INSERT INTO bimaran_moaref (code_moaref,name_moaref) VALUES (1,'وب سایت')
Go
INSERT INTO bimaran_moaref (code_moaref,name_moaref) VALUES (2,'پیامک')
Go
INSERT INTO bimaran_moaref (code_moaref,name_moaref) VALUES (3,'تلگرام')
Go
INSERT INTO bimaran_moaref (code_moaref,name_moaref) VALUES (4,'اینستاگرام')
Go
INSERT INTO bimaran_moaref (code_moaref,name_moaref) VALUES (5,'پیک برتر')
Go
INSERT INTO bimaran_moaref (code_moaref,name_moaref) VALUES (6,'بیماران')
Go
INSERT INTO bimaran_moaref (code_moaref,name_moaref) VALUES (7,'پزشکان')
Go
INSERT INTO bimaran_moaref (code_moaref,name_moaref) VALUES (8,'گذری')
Go
INSERT INTO bimaran_moaref (code_moaref,name_moaref) VALUES (9,'غیره')
Go

--94/08/30
Go
ALTER TABLE [dbo].[settinga]
   add [code_moaref_not_null][bit]  NULL
Go
--94/09/04
Go
ALTER TABLE [dbo].[settinga]
   add [On_ApplicationEventsException_Exit][bit]  NULL
Go
--  94/10/24
ALTER TABLE [dbo].[users]
   ADD [ab_Sabte_Daem_tarhe_darman] [bit] NULL
Go
ALTER TABLE [dbo].[users]
   ADD [ab_Done_tarhe_darman] [bit] NULL
Go
ALTER TABLE [dbo].[users]
   ADD [ab_edit_tarhe_darman_user] [bit] NULL
Go
ALTER TABLE [dbo].[users]
   ADD [ab_del_tarhe_darman_user] [bit] NULL
Go
-- drop table Tarhe_Dandan
--941104

CREATE TABLE [dbo].[Tarhe_Dandan] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[code_bimar] [int] NOT NULL ,
	[code_tarhe_dandan] [int] NOT NULL ,
	[code_pezeshk] [int] NOT NULL ,
	[tarikh] [char] (10) COLLATE Arabic_CI_AS NOT NULL ,
	[insert_time] [datetime] NULL ,
	[edit_time] [datetime] NULL ,
	[insert_user] [int] NULL ,
	[edit_user] [int] NULL ,
	[editable] [bit] NULL ,
	[d11] [bit] NULL ,
	[d12] [bit] NULL ,
	[d13] [bit] NULL ,
	[d14] [bit] NULL ,
	[d15] [bit] NULL ,
	[d16] [bit] NULL ,
	[d17] [bit] NULL ,
	[d18] [bit] NULL ,
	[d19] [smallint] NULL ,
	[d21] [bit] NULL ,
	[d22] [bit] NULL ,
	[d23] [bit] NULL ,
	[d24] [bit] NULL ,
	[d25] [bit] NULL ,
	[d26] [bit] NULL ,
	[d27] [bit] NULL ,
	[d28] [bit] NULL ,
	[d29] [smallint] NULL ,
	[d31] [bit] NULL ,
	[d32] [bit] NULL ,
	[d33] [bit] NULL ,
	[d34] [bit] NULL ,
	[d35] [bit] NULL ,
	[d36] [bit] NULL ,
	[d37] [bit] NULL ,
	[d38] [bit] NULL ,
	[d39] [smallint] NULL ,
	[d41] [bit] NULL ,
	[d42] [bit] NULL ,
	[d43] [bit] NULL ,
	[d44] [bit] NULL ,
	[d45] [bit] NULL ,
	[d46] [bit] NULL ,
	[d47] [bit] NULL ,
	[d48] [bit] NULL ,
	[d49] [smallint] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Tarhe_Dandan_sharh] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[code_bimar] [int] NOT NULL ,
	[code_pezeshk] [int] NOT NULL ,
	[tarikh] [char] (10) COLLATE Arabic_CI_AS NOT NULL ,
	[insert_time] [datetime] NULL ,
	[edit_time] [datetime] NULL ,
	[insert_user] [int] NULL ,
	[edit_user] [int] NULL ,
	[editable] [bit] NULL ,
	[sharh] [nvarchar] (600) COLLATE Arabic_CI_AS NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Tarhe_Dandan] WITH NOCHECK ADD 
	CONSTRAINT [PK_Tarhe_Dandan] PRIMARY KEY  CLUSTERED 
	(
		[code_bimar],
		[code_tarhe_dandan],
		[code_pezeshk],
		[tarikh]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Tarhe_Dandan_sharh] WITH NOCHECK ADD 
	CONSTRAINT [PK_Tarhe_Dandan_sharh] PRIMARY KEY  CLUSTERED 
	(
		[code_bimar],
		[code_pezeshk],
		[tarikh]
	)  ON [PRIMARY] 
GO

CREATE TABLE [dbo].[Tarhe_Dandan_Itm] (
	[code_tarhe_dandan] [int] NOT NULL ,
	[name_tarhe_dandan] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Tarhe_Dandan_Itm] WITH NOCHECK ADD 
	CONSTRAINT [PK_Tarhe_Dandan_Itm] PRIMARY KEY  CLUSTERED 
	(
		[code_tarhe_dandan]
	)  ON [PRIMARY] 
GO
INSERT INTO Tarhe_Dandan_Itm (code_tarhe_dandan,name_tarhe_dandan) VALUES (1,'ترمیم')
GO
INSERT INTO Tarhe_Dandan_Itm (code_tarhe_dandan,name_tarhe_dandan) VALUES (2,'کشیدن')
GO
INSERT INTO Tarhe_Dandan_Itm (code_tarhe_dandan,name_tarhe_dandan) VALUES (3,'عصب کشی')
GO
INSERT INTO Tarhe_Dandan_Itm (code_tarhe_dandan,name_tarhe_dandan) VALUES (4,'جراحی')
GO
INSERT INTO Tarhe_Dandan_Itm (code_tarhe_dandan,name_tarhe_dandan) VALUES (5,'پروتز')
GO
INSERT INTO Tarhe_Dandan_Itm (code_tarhe_dandan,name_tarhe_dandan) VALUES (6,'ایمپلنت')
GO

Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d19] [smallint] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d29] [smallint] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d39] [smallint] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d49] [smallint] NULL
Go
ALTER TABLE [dbo].[users]
   ADD [saghf_darsad_takhfif] [smallint] NULL
Go
ALTER TABLE [dbo].[users]
   ADD [mohasebe_mandeh_dar_khat_paziresh] [bit] NULL
Go
ALTER TABLE [dbo].[settinga]
   add [adam_pardakhti_dar_entekhab_chantaei][bit]  NULL
Go
update users set mohasebe_mandeh_dar_khat_paziresh=1 where mohasebe_mandeh_dar_khat_paziresh is null
Go
ALTER TABLE [dbo].[morajeat]
   ADD [darsad_takhfif] [smallint] NULL
Go
-- 94/12/01
ALTER TABLE [dbo].[Tarhe_Dandan_sharh]
   ADD [Adult] [bit] NULL
Go
update Tarhe_Dandan_sharh set Adult=1 where  Adult is NULL
Go


--95/01/28


ALTER TABLE [dbo].[settinga]
   add [Ersal_Email_Info_Date_Miladi][bit]  NULL
Go
update settinga set Ersal_Email_Info_Date_Miladi=1  where Ersal_Email_Info_Date_Miladi is NULL
Go

ALTER TABLE [dbo].[settinga]
   add [Time_Shift_24_Email_Info] [char] (8) Null
Go
update settinga set Time_Shift_24_Email_Info='08:00:00'  where Time_Shift_24_Email_Info is NULL
Go

ALTER TABLE [dbo].[settinga]
   add [Time_Ersal_24_Email_Info_From] [char] (5) Null
Go
update settinga set Time_Ersal_24_Email_Info_From='09:00'  where Time_Ersal_24_Email_Info_From is NULL
Go

ALTER TABLE [dbo].[settinga]
   add [Time_Ersal_24_Email_Info_To] [char] (5) Null
Go
update settinga set Time_Ersal_24_Email_Info_To='18:00'   where  Time_Ersal_24_Email_Info_To is NULL
GO


CREATE TABLE [dbo].[Send_Email_List] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[ins_time] [datetime] NOT NULL ,
	[tarikh] [char] (10) COLLATE Arabic_CI_AS NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Send_Email_List] WITH NOCHECK ADD 
	CONSTRAINT [PK_Send_Email_List] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

--95/01/30

ALTER TABLE [dbo].[list_code_ertebat]
   ADD [selected] [bit] NULL
Go


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[update_code_ertabat_morajeat]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[update_code_ertabat_morajeat]
GO


CREATE VIEW dbo.update_code_ertabat_morajeat
AS
SELECT     dbo.morajeat.code_morajeh, dbo.morajeat.code_darman, dbo.morajeat.code_ertebat, dbo.darmanha.code_ertebat AS code_ertebat_new
FROM         dbo.morajeat INNER JOIN
                      dbo.darmanha ON dbo.morajeat.code_darman = dbo.darmanha.code_darman

GO

update  update_code_ertabat_morajeat set code_ertebat=code_ertebat_new

Go

--95/02/16

ALTER TABLE [dbo].[darmanha_select]
    add [sharh_darman] [nvarchar] (200) COLLATE Arabic_CI_AS NULL
Go

ALTER TABLE [dbo].[morajeat_tozihat]
    Alter COLUMN [File_Name] [nvarchar] (500) COLLATE Arabic_CI_AS NULL
Go
 -- 95/02/18
Go
ALTER TABLE [dbo].[users]
   ADD [Eijad_Etebar_Takhfif_Bimaran] [bit] NULL
Go

-- 95/02/24
ALTER TABLE [dbo].[bimaran]
   ADD [name_sarparast] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
Go

ALTER TABLE [dbo].[noskhehha]
   ADD [sh_hologram] [nvarchar] (20) COLLATE Arabic_CI_AS NULL
Go

--95/03/08

ALTER TABLE [dbo].[settinga]
   add [children_age][int]  NULL
Go
update settinga set children_age=9 where children_age is null
Go
-- اگر تعداد پزشکان کمتر از 1000 تا بود 

if ((select count(*)  pezeshkan ) <1000) 
begin
 update pezeshkan set radif=1
end

Go
ALTER TABLE [dbo].[settinga]
   add [code_darman_daryaft_sandogh][int]  NULL
Go
update settinga set code_darman_daryaft_sandogh=-1111 where code_darman_daryaft_sandogh is null
GO

ALTER TABLE [dbo].[settinga]
   add [code_darman_takhfif_etebari][int]  NULL
Go
ALTER TABLE [dbo].[settinga]
   add [code_bimeh_takhfif_etebari][int]  NULL
Go
ALTER TABLE [dbo].[settinga]
   add [code_bakhsh_takhfif_etebari][int]  NULL
Go
ALTER TABLE [dbo].[settinga]
   add [code_pezeshk_takhfif_etebari][int]  NULL
Go


update settinga set code_darman_takhfif_etebari=-1111 where code_darman_takhfif_etebari is null
Go
update settinga set code_bimeh_takhfif_etebari=-1111 where code_bimeh_takhfif_etebari is null
Go
update settinga set code_bakhsh_takhfif_etebari=-1111 where code_bakhsh_takhfif_etebari is null
Go
update settinga set code_pezeshk_takhfif_etebari=-1111 where code_pezeshk_takhfif_etebari is null
Go

--95/03/15
ALTER TABLE [dbo].[settinga]
   add [email_after_backup_time_on_close][bit]  NULL
Go
update settinga set email_after_backup_time_on_close=0 where email_after_backup_time_on_close is null
Go
ALTER TABLE [dbo].[settinga]
   add [link_search][bit]  NULL
Go
update settinga set link_search=1 where link_search is null
Go
ALTER TABLE [dbo].[settinga]
   add [link_search_evrey_close][bit]  NULL
Go
update settinga set link_search_evrey_close=1 where link_search_evrey_close is null
Go
CREATE TABLE [dbo].[list_link] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[active] [bit] NOT NULL ,
	[link_st] [nvarchar] (500) COLLATE Arabic_CI_AS NOT NULL ,
	[sharh] [nvarchar] (200) COLLATE Arabic_CI_AS NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[list_link] ADD 
	CONSTRAINT [PK_link_list] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO
insert list_link (active,link_st,sharh) values (1,'https://www.google.com/?gws_rd=ssl#q=%D9%85%D8%B7%D8%A8+%D9%86%DB%8C%D8%AF+%D8%B3%D8%A7%D9%81%D8%AA','مطب نید سافت')
Go
insert list_link (active,link_st,sharh) values (1,'https://www.google.com/?gws_rd=ssl#q=%DA%A9%D9%84%DB%8C%D9%86%DB%8C%DA%A9+%D9%86%DB%8C%D8%AF+%D8%B3%D8%A7%D9%81%D8%AA','کلینیک نید سافت')
Go

--95/03/18

ALTER TABLE [dbo].[darmanha]
   add [adam_mohasebe_dar_karkerd][bit]  NULL
Go
update darmanha set adam_mohasebe_dar_karkerd=0 where adam_mohasebe_dar_karkerd is null
Go
ALTER TABLE [dbo].[morajeat]
   add [adam_mohasebe_dar_karkerd][bit]  NULL
Go
update morajeat set adam_mohasebe_dar_karkerd=0 where adam_mohasebe_dar_karkerd is null
Go
ALTER TABLE [dbo].[settinga]
   add [adam_mohasebe_dar_karkerd][bit]  NULL
Go
update settinga set adam_mohasebe_dar_karkerd=0 where adam_mohasebe_dar_karkerd is null
Go

-- 95/03/20

Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d11c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d12c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d13c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d14c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d15c] [bit] NULL
Go


ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d21c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d22c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d23c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d24c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d25c] [bit] NULL
Go



ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d31c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d32c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d33c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d34c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d35c] [bit] NULL
Go


ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d41c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d42c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d43c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d44c] [bit] NULL
Go
ALTER TABLE [dbo].[Tarhe_Dandan] 
   ADD [d45c] [bit] NULL
Go

ALTER TABLE [dbo].[users]
   add [ab_del_all_noskheh] [bit] NULL 
Go

--95/04/20

ALTER TABLE [dbo].[bimaran]
   ADD [sh_hologram] [nvarchar] (20) COLLATE Arabic_CI_AS NULL
Go


-- 95/05/18

CREATE TABLE [dbo].[link_program](
	[code_link_program] [int] NOT NULL,
	[name_link_program] [nvarchar](200) NOT NULL,
	[active] [bit] NOT NULL,
 CONSTRAINT [PK_link_program] PRIMARY KEY CLUSTERED 
(
	[code_link_program] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO

INSERT INTO link_program  (code_link_program,name_link_program,Active)
     VALUES (4,'EsayDent4',1)
GO
INSERT INTO link_program  (code_link_program,name_link_program,Active)
     VALUES (5,'EzDenti',0)
GO
INSERT INTO link_program  (code_link_program,name_link_program,Active)
     VALUES (6,'DrSuni',0)
GO

-- 95/06/10

Go
ALTER TABLE [dbo].[bakhshha]
   add [selected] [bit]  NULL
Go
ALTER TABLE [dbo].[bimaran]
   add [barcode] [varchar](100) NULL
Go

-- 95/06/12

ALTER TABLE [dbo].[users]
   ADD [ab_show_tarikh_paziresh] [bit] NULL
Go

--95/06/14

ALTER TABLE [dbo].[noskhehha]
   ADD [name_sarparast] [nvarchar] (50) COLLATE Arabic_CI_AS NULL
Go
--95/06/26

ALTER TABLE [dbo].[users]
   ADD [ab_alarm_print_paziresh] [bit] NULL
Go
 update users set ab_alarm_print_paziresh=1 where ab_alarm_print_paziresh is null
Go
ALTER TABLE [dbo].[settinga]
   add [Show_Application_Error][bit]  NULL
Go
Update settinga set Show_Application_Error=1 where Show_Application_Error is null
Go

CREATE TABLE [dbo].[darmanha_restriction](
	[code_ertebat] [nvarchar](10) NOT NULL,
	[days] [int] NULL,
	[repeat_num] [int] NULL,
	[code_bimeh] [int] NULL,
	[description] [nvarchar](500) NULL,
 CONSTRAINT [PK_darmanha_restriction] PRIMARY KEY CLUSTERED 
(
	[code_ertebat] ASC
) ON [PRIMARY]
) ON [PRIMARY]

Go

ALTER TABLE [dbo].[settinga]
   add [darsad_takhfif_etebari][int]  NULL
Go
ALTER TABLE [dbo].[settinga]
   add [saghf_takhfif_etebari][int]  NULL
Go
ALTER TABLE [dbo].[settinga]
   add [active_takhfif_etebari][bit]  NULL
Go
--95/07/02
ALTER TABLE [dbo].[settinga]
   add [auto_save_takhfif_etebari][bit]  NULL
Go
ALTER TABLE [dbo].[settinga]
   add [takhfif_etebari_allow_with_Card][bit]  NULL
Go

--95/07/06

GO
CREATE TABLE [dbo].[EasyDent4](
	[id] [int] NOT NULL,
	[active] [bit] NULL,
	[instance_name] [nvarchar](100) NULL,
	[database_name] [nvarchar](100) NULL,
	[imagefiles_path] [nvarchar](500) NULL,
	[destination_path] [nvarchar](500) NULL,
	[count_img] [int] NULL,
 CONSTRAINT [PK_EasyDent4] PRIMARY KEY CLUSTERED 
(
	[id] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO

INSERT INTO  EasyDent4(id,
            active
            ,instance_name
            ,database_name
           ,imagefiles_path
           ,destination_path
           ,count_img)
     VALUES
           (1
           ,1
           ,'.'
           ,'TSFD'
           ,'D:\NS\Source_Image\'
           ,'D:\NS\Destination_Image\'
           ,10)
GO

--95/08/20
ALTER TABLE [dbo].[morajeat]
   add [barcode][varchar] (100) NULL
Go
ALTER TABLE [dbo].[morajeat]
   add [sh_hologram][nvarchar](20) NULL
Go

--95/09/02

ALTER TABLE [dbo].[settinga]
   add [mode_callerid][int]  NULL
Go
update settinga set mode_callerid=1 where  mode_callerid is NULL
GO
CREATE TABLE [dbo].[numberlist](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[line] [int] NOT NULL,
	[number] [varchar](50) NOT NULL,
 CONSTRAINT [PK_numberlist] PRIMARY KEY CLUSTERED 
(
	[id] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO

-- 95/09/12

ALTER TABLE [dbo].[users]
   add [ab_tarikh_kochektar] [bit] NULL 
Go
update users  set ab_tarikh_kochektar=1 where ab_tarikh_kochektar is null
Go
ALTER TABLE [dbo].[users]
   add [restricted_code_bakhshha]  [varchar] (200) NULL
Go

-- code_bakhsh=12 or code_bakhsh=13

GO
CREATE TABLE [dbo].[sql_text_log](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[sql_text] [nvarchar](500) NOT NULL,
	[ins_time] [datetime] NOT NULL,
 CONSTRAINT [PK_sql_text_log] PRIMARY KEY CLUSTERED 
(
	[id] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[pezeshkan]
   ADD  [selectp] [bit] NULL 

Go

update pezeshkan set selectp=0 where selectp is null

Go

ALTER TABLE [dbo].[users]
   add [ab_del_sandogh] [bit] NULL 
Go

ALTER TABLE [dbo].[settinga]
   add [adam_namayesh_sandogh_dar_karkerd][bit]  NULL
Go

 --95/09/18

ALTER TABLE [dbo].[users]
   add [show_paziresh_after_del_noskheh] [bit] NULL 
Go

 --95/09/20

ALTER TABLE [dbo].[users]
   add [ab_ebtal_noskheh] [bit] NULL 
Go

--95/09/28

ALTER TABLE [dbo].[settinga]
   add [table_name_call_log][nvarchar](50) NULL
Go

--95/09/30

ALTER TABLE [dbo].[Callerid]
   add [id_update] [int] NULL 
Go

--95/10/02
CREATE TABLE [dbo].[pos_tarakonesh](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[tarikh] [char](10) NOT NULL,
	[mablagh] [money] NOT NULL,
	[sh_kart] [char](20) NOT NULL,
	[sdate] [char](20) NOT NULL,
 CONSTRAINT [PK_pos_tarakonesh] PRIMARY KEY CLUSTERED 
(
	[id] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[pos_bank](
	[code_pos] [int] NOT NULL,
	[name_pos] [nvarchar](100) NOT NULL,
	[pos_external_file_name] [varchar](50) NULL,
	[pos_ip] [varchar](50) NULL,
	[sender_form_class] [varchar](50) NULL,
	[row_id] [int] NULL,
	[active] [bit] NULL,
 CONSTRAINT [PK_pos_bank] PRIMARY KEY CLUSTERED 
(
	[code_pos] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT INTO pos_bank  (code_pos,name_pos,pos_external_file_name,pos_ip,sender_form_class,row_id,active)
     VALUES (1,'bank shahr','shahr.exe','192.168.1.50','TMainForm',1,1)
GO




-- for darsad
--  update morajeat set r_pezeshk=((r_azad*100)/85)-r_azad where code_morajeh < -1

-- update bimaran set sharh=' .. ' where  (sharh is null) or (len(rtrim(ltrim(sharh)))=0)
-- update bimaran set elat_morajeh=' .. ' where  (elat_morajeh is null) or (len(rtrim(ltrim(elat_morajeh)))=0)
-- update bimaran set tozihat_checkup=sharh+'   '+elat_morajeh

-- SELECT     auto AS code_hadese, tashkhis AS name_hadese
-- INTO            hadese1
-- FROM         _tashkhis 

-- SELECT     auto AS code_natije_morajeh, tashkhis AS name_natije_morajeh
-- INTO            natije_morajeh1
-- FROM         _tashkhis 








update setting set Last_Edit_Time='2016/06/08'
Go
update hesab set Bed_Old=Bed , Bes_old=Bes
Go
update morajeat set code_bimar=code_bimar_0 where code_bimar=0 and code_bimar_0 > 0
Go
update morajeat set code_pezeshk=code_pezeshk_0 where code_pezeshk=0 and code_pezeshk_0 > 0
Go
update morajeat set code_darman=code_darman_0 where code_darman=0 and code_darman_0 > 0
Go
update setting set adam_ersal_email=0
Go
update setting set adam_check_and_send_modir=0 
Go
update setting set version=940510
Go
UPDATE setting set nasbe_sys=''
Go
UPDATE setting set Entrance_Data=0
Go


--update users set ab_Auto_Sabte_Masraf_Daro_Dar_Anbar=0
Go
-- update darmanha set barcode=code_ertebat where (barcode is null) or ( len(barcode)=0) or (barcode='000') or (barcode='00000') 
Go
-- UPDATE MORAJEAT SET ID_ANBAR_HDR=NULL
Go
-- update noskhehha set  LD_Tarikh_Akhar=tarikh_noskheh  
Go
-- update noskhehha set  RD_Tarikh_Aval=tarikh_noskheh  
Go
-- update noskhehha set  DD_Code_Tashkhis=0 
GO
-- update noskhehha set  LD_Tarikh_Akhar=tarikh_noskheh  where LD_Tarikh_Akhar is null or len(ltrim(Rtrim(LD_Tarikh_Akhar)))=0
Go
-- update noskhehha set  RD_Tarikh_Aval=tarikh_noskheh  where RD_Tarikh_Aval is null or len(ltrim(Rtrim(RD_Tarikh_Aval)))=0
Go
-- update noskhehha set  DD_Code_Tashkhis=0 where DD_Code_Tashkhis is null or len(ltrim(Rtrim(DD_Code_Tashkhis)))=0
Go
-- update setting set show_menu_Sayer_Amaliat=0
Go
-- update setting set show_Panel_LEFT_MainForm=0
Go
-- update setting set show_Panel_Right_MainForm=0
Go
-- update setting set show_Panel_Bottom_MainForm=0
Go
-- update setting set MainForm_No_Border=0
Go
-- UPDATE    setting SET show_paziresh = 1
go
-- UPDATE    setting SET show_tanzimat = 1
go
-- UPDATE    setting SET show_gozareshat_bimeh = 1
GO
-- UPDATE    setting SET show_vaght_dehi=1
GO
-- UPDATE    setting SET show_menu_parvandeh = 1
GO
-- UPDATE    setting SET show_parvandeh_dijital = 1
GO
-- UPDATE    setting SET show_mablagh_on_paziresh = 1
GO
-- UPDATE    setting SET show_list_on_open_paziresh = 1
Go
-- UPDATE setting SET Sabte_Daem_Morajat_Gozashte=1 where id=1
Go


-- DAROKHANEH
--update users set ab_Auto_Sabte_Masraf_Daro_Dar_Anbar=0
Go
-- update darmanha set barcode=code_ertebat where (barcode is null) or ( len(barcode)=0) or (barcode='000') or (barcode='00000') 
Go
-- UPDATE MORAJEAT SET ID_ANBAR_HDR=NULL
Go
-- DAROKHANEH

-- SELECT  *  INTO List_Del_Edit_93  FROM   List_Del_Edit
-- DELETE FROM List_Del_Edit
-- update users set ab_edit_darman=0 , ab_delete_darman=0  , ab_edit_price=0 , ab_del_darman_users=0 , ab_edit_darman_users=0 , ab_tanzimat=0 , ab_tarif_darman=0


Go
-- update morajeat set code_pezeshk=909090 where code_pezeshk=808080
Go
-- update vaght_dehi set code_pezeshk=909090 where code_pezeshk=808080
Go
-- update noskhehha set code_pezeshk=909090 where code_pezeshk=808080
Go
--delete in_out_person where tarikh > '99/12/29'
Go

Go
--ALTER TABLE [dbo].[Bimaran]
--   add [tel_old]  [nvarchar] (50) COLLATE Arabic_CI_AS  NULL 
Go
--ALTER TABLE [dbo].[Bimaran]
--  add [tel2_old]  [nvarchar] (50) COLLATE Arabic_CI_AS  NULL 
Go
--update bimaran set tel_old=Ltrim(Rtrim(tel))
Go
---update bimaran set tel2_old=Ltrim(Rtrim(tel2))
Go
--update bimaran set tel='021'+Ltrim(Rtrim(tel)) where len(Ltrim(Rtrim(tel)))=8
Go
--update bimaran set tel2='021'+Ltrim(Rtrim(tel2)) where len(Ltrim(Rtrim(tel2)))=8
Go

-- update morajeat set tarikh=tarikh_noskheh where tarikh_noskheh between '99/01/01' and '99/02/02'

--  update morajeat set tarikh=tarikh_noskheh where tarikh_noskheh is not null and len(ltrim(rtrim(tarikh_noskheh)))=8

-- update noskhehha set tarikh=tarikh_noskheh where tarikh_noskheh is not null and len(ltrim(rtrim(tarikh_noskheh)))=8

-- UPDATE   darmanha  SET  r_bed=r_azad-r_bimeh+r_mabeh-r_takhfif-r_yaraneh-r_mokammel
Go
-- update setting set Last_Edit_Time='2015/04/01'
GO
--  UPDATE   users  SET  password='' where admin=1
Go
--  UPDATE   users  SET  admin=1
Go
--  INSERT INTO users (code_user,name_user,password,admin) VALUES ('1','1','3','1')
Go
