USE [darokhanedb]
GO
/****** Object:  Table [dbo].[darokhane_t]    Script Date: 01/09/2015 18:58:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[darokhane_t](
	[id_d] [int] NOT NULL,
	[name] [nvarchar](50) NULL,
	[sh_mojavez] [nvarchar](50) NULL,
	[address] [nvarchar](300) NULL,
 CONSTRAINT [PK_darokhane_t] PRIMARY KEY CLUSTERED 
(
	[id_d] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[karknan_darokhane]    Script Date: 01/09/2015 18:58:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[karknan_darokhane](
	[id_k] [int] NOT NULL,
	[id_d] [int] NULL,
	[name_k] [nvarchar](100) NULL,
	[lname] [nvarchar](100) NULL,
	[kode_meli] [nvarchar](10) NULL,
	[jens] [nvarchar](10) NULL,
	[tarikh_tavalod] [nvarchar](50) NULL,
	[semat] [nvarchar](50) NULL,
 CONSTRAINT [PK_karknan_darokhane] PRIMARY KEY CLUSTERED 
(
	[id_k] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[pezeshk_t]    Script Date: 01/09/2015 18:58:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[pezeshk_t](
	[code_pezeshk] [int] NOT NULL,
	[name_p] [nvarchar](50) NULL,
	[lname] [nvarchar](50) NULL,
	[madrak] [nvarchar](50) NULL,
	[takhasos] [nvarchar](50) NULL,
	[id_d] [int] NULL,
 CONSTRAINT [PK_pezeshk_t] PRIMARY KEY CLUSTERED 
(
	[code_pezeshk] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[moshtari_t]    Script Date: 01/09/2015 18:58:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[moshtari_t](
	[id_moshtari] [int] NOT NULL,
	[name] [nvarchar](100) NULL,
	[lname] [nvarchar](100) NULL,
	[sh_shenasname] [nvarchar](10) NULL,
	[tarikh_tavalod] [nvarchar](10) NULL,
	[jens] [nvarchar](10) NULL,
	[id_d] [int] NULL,
 CONSTRAINT [PK_moshtari_t] PRIMARY KEY CLUSTERED 
(
	[id_moshtari] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  StoredProcedure [dbo].[insert_darokhane_t]    Script Date: 01/09/2015 18:59:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create Procedure [dbo].[insert_darokhane_t]
@id_d	int,
@name	nvarchar(50),
@sh_mojavez	nvarchar(50),
@address	nvarchar(300)
	
	
As
Begin
	Insert Into darokhane_t
		(id_d,name,sh_mojavez,address)
	Values
		(@id_d,@name,@sh_mojavez,@address)
End
GO
/****** Object:  Table [dbo].[daro]    Script Date: 01/09/2015 18:58:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[daro](
	[id_daro] [int] NOT NULL,
	[name] [nvarchar](50) NULL,
	[sherkat] [nvarchar](50) NULL,
	[mojodi] [nvarchar](10) NULL,
	[darsad_bime] [int] NULL,
	[gheimat] [float] NULL,
	[tarikh_tolid] [nvarchar](50) NULL,
	[tarikh_masraf] [nvarchar](50) NULL,
	[id_d] [int] NULL,
 CONSTRAINT [PK_daro] PRIMARY KEY CLUSTERED 
(
	[id_daro] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  View [dbo].[daro_gheimat]    Script Date: 01/09/2015 18:58:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[daro_gheimat]
AS
SELECT     name, id_daro, sherkat, mojodi, darsad_bime, gheimat, tarikh_tolid, tarikh_masraf
FROM         dbo.daro
WHERE     (gheimat > 10000)
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "daro"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 216
               Right = 198
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'daro_gheimat'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'daro_gheimat'
GO
/****** Object:  StoredProcedure [dbo].[insert_moshtari_t]    Script Date: 01/09/2015 18:59:01 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create Procedure [dbo].[insert_moshtari_t]
@id_moshtari	int,
@name	nvarchar(100),
@lname	nvarchar(100),
@sh_shenasname	nvarchar(10),
@tarikh_tavalod	nvarchar(10),
@jens	nvarchar(10),
@id_d	int
	

As
Begin
	Insert Into moshtari_t
		(id_moshtari,name,lname,sh_shenasname,tarikh_tavalod,jens,id_d)
	Values
		(@id_moshtari,@name,@lname,@sh_shenasname,@tarikh_tavalod,@jens,@id_d)
End
GO
/****** Object:  StoredProcedure [dbo].[insert_karknan_darokhane]    Script Date: 01/09/2015 18:59:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create Procedure [dbo].[insert_karknan_darokhane]
@id_k	int,
@id_d	int,
@name_k	nvarchar(100),
@lname	nvarchar(100),
@kode_meli	nvarchar(10),
@jens	nvarchar(10),
@tarikh_tavalod	nvarchar(50),
@semat	nvarchar(50)
	
	
As
Begin
	Insert Into karknan_darokhane
		(id_k,id_d,name_k,lname,kode_meli,jens,tarikh_tavalod,semat)
	Values
		(@id_k,@id_d,@name_k,@lname,@kode_meli,@jens,@tarikh_tavalod,@semat)
End
GO
/****** Object:  StoredProcedure [dbo].[delete_moshtari_t]    Script Date: 01/09/2015 18:59:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create Procedure [dbo].[delete_moshtari_t]
	@id_moshtari int
As
Begin
	Delete moshtari_t
	Where
		[id_moshtari] = @id_moshtari

End
GO
/****** Object:  StoredProcedure [dbo].[delete_daro]    Script Date: 01/09/2015 18:59:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create Procedure [dbo].[delete_daro]
	@id_daro int
As
Begin
	Delete daro
	Where
		[id_daro] = @id_daro

End
GO
/****** Object:  StoredProcedure [dbo].[insert_daro]    Script Date: 01/09/2015 18:59:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create Procedure [dbo].[insert_daro]
@id_daro	int,
@name	nvarchar(50),
@sherkat	nvarchar(50),
@mojodi	nvarchar(10),
@darsad_bime	int,
@gheimat	float,
@tarikh_tolid	nvarchar(50),
@tarikh_masraf	nvarchar(50),
@id_d	int
	
As
Begin
	Insert Into daro
		(id_daro,name,sherkat,mojodi,darsad_bime,gheimat,tarikh_tolid,tarikh_masraf,id_d)
	Values
		(@id_daro,@name,@sherkat,@mojodi,@darsad_bime,@gheimat,@tarikh_tolid,@tarikh_masraf,@id_d)
End
GO
/****** Object:  View [dbo].[doctor motekhasese post]    Script Date: 01/09/2015 18:58:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[doctor motekhasese post]
AS
SELECT     code_pezeshk
FROM         dbo.pezeshk_t
WHERE     (madrak = 'دکترا') AND (takhasos = 'پوست')
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "pezeshk_t"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 168
               Right = 198
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'doctor motekhasese post'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'doctor motekhasese post'
GO
/****** Object:  View [dbo].[list moshtarian_be tartibe esm]    Script Date: 01/09/2015 18:58:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[list moshtarian_be tartibe esm]
AS
SELECT     TOP (100) PERCENT name, lname, sh_shenasname, tarikh_tavalod, jens
FROM         dbo.moshtari_t
ORDER BY name
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[41] 4[20] 2[12] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "moshtari_t"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 196
               Right = 204
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'list moshtarian_be tartibe esm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'list moshtarian_be tartibe esm'
GO
/****** Object:  Table [dbo].[noskhe_t]    Script Date: 01/09/2015 18:58:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[noskhe_t](
	[id_noskhe] [int] NOT NULL,
	[id_bimar] [int] NULL,
	[code_pezeshk] [int] NULL,
	[gheimat] [float] NULL,
	[darsad_bime] [int] NULL,
	[darsad_takhfif] [int] NULL,
	[id_d] [int] NULL,
 CONSTRAINT [PK_noskhe_t] PRIMARY KEY CLUSTERED 
(
	[id_noskhe] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  StoredProcedure [dbo].[insert_pezeshk_t]    Script Date: 01/09/2015 18:59:01 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create Procedure [dbo].[insert_pezeshk_t]
@code_pezeshk	int,
@name_p	nvarchar(50),
@lname	nvarchar(50),
@madrak	nvarchar(50),
@takhasos	nvarchar(50),
@id_d	int
	
	
As
Begin
	Insert Into pezeshk_t
		(code_pezeshk,name_p,lname,madrak,takhasos,id_d)
	Values
		(@code_pezeshk,@name_p,@lname,@madrak,@takhasos,@id_d)
End
GO
/****** Object:  StoredProcedure [dbo].[update_daro]    Script Date: 01/09/2015 18:59:01 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create Procedure [dbo].[update_daro]
	@id_daro	int,
	@name	nvarchar(50),
	@sherkat	nvarchar(50),
	@mojodi	nvarchar(10),
	@darsad_bime	int,
	@gheimat	float,
	@tarikh_tolid	nvarchar(50),
	@tarikh_masraf	nvarchar(50),
	@id_d	int
	
As
Begin
Update daro
Set
	id_daro=@id_daro,
	name=@name	,
	sherkat=@sherkat	,
	mojodi=@mojodi	,
	darsad_bime=@darsad_bime	,
	gheimat=@gheimat	,
	tarikh_tolid=@tarikh_tolid	,
	tarikh_masraf=@tarikh_masraf	,
	id_d=@id_d	
Where		
		[id_daro] = @id_daro

End
GO
/****** Object:  View [dbo].[sum_moshtarian]    Script Date: 01/09/2015 18:58:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[sum_moshtarian]
AS
SELECT     COUNT(id_moshtari) AS sum_moshtarian
FROM         dbo.moshtari_t
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "moshtari_t"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 194
               Right = 204
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 12
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'sum_moshtarian'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'sum_moshtarian'
GO
/****** Object:  View [dbo].[View_mojodi_daro]    Script Date: 01/09/2015 18:58:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[View_mojodi_daro]
AS
SELECT     id_daro, name, sherkat, gheimat, darsad_bime, tarikh_tolid, tarikh_masraf
FROM         dbo.daro
WHERE     (mojodi = 'yes')
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[41] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "daro"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 207
               Right = 198
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'View_mojodi_daro'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'View_mojodi_daro'
GO
/****** Object:  View [dbo].[View_mojodi]    Script Date: 01/09/2015 18:58:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[View_mojodi]
AS
SELECT     id_daro, name, sherkat, gheimat, darsad_bime, tarikh_tolid, tarikh_masraf
FROM         dbo.daro
WHERE     (mojodi = 'yes')
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[41] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "daro"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 207
               Right = 198
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'View_mojodi'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'View_mojodi'
GO
/****** Object:  StoredProcedure [dbo].[update_noskhe_t]    Script Date: 01/09/2015 18:59:01 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create Procedure [dbo].[update_noskhe_t]
@id_noskhe	int,
@id_bimar	int,
@code_pezeshk	int,
@gheimat	float,
@darsad_bime	int,
@darsad_takhfif	int,
@id_d	int
	
	
As
Begin
Update noskhe_t
Set
id_bimar=@id_bimar,
code_pezeshk=@code_pezeshk,
gheimat=@gheimat,
darsad_bime=@darsad_bime,
darsad_takhfif=@darsad_takhfif,
id_d=@id_d

Where		
		[id_noskhe] = @id_noskhe

End
GO
/****** Object:  StoredProcedure [dbo].[insert_noskhe_t]    Script Date: 01/09/2015 18:59:01 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create Procedure [dbo].[insert_noskhe_t]
@id_noskhe	int,
@id_bimar	int,
@code_pezeshk	int,
@gheimat	float,
@darsad_bime	int,
@darsad_takhfif	int,
@id_d	int
	
	
As
Begin
	Insert Into noskhe_t
		(id_noskhe,id_bimar,code_pezeshk,gheimat,darsad_bime,darsad_takhfif,id_d)
	Values
		(@id_noskhe,@id_bimar,@code_pezeshk,@gheimat,@darsad_bime,@darsad_takhfif,@id_d)
End
GO
/****** Object:  View [dbo].[moshakhast_noskhe_pezeshk]    Script Date: 01/09/2015 18:58:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[moshakhast_noskhe_pezeshk]
AS
SELECT     dbo.moshtari_t.name, dbo.moshtari_t.lname, dbo.moshtari_t.jens, dbo.noskhe_t.id_noskhe, dbo.noskhe_t.gheimat, dbo.pezeshk_t.name_p, 
                      dbo.pezeshk_t.lname AS Expr1
FROM         dbo.noskhe_t INNER JOIN
                      dbo.moshtari_t ON dbo.noskhe_t.id_bimar = dbo.moshtari_t.id_moshtari INNER JOIN
                      dbo.pezeshk_t ON dbo.noskhe_t.code_pezeshk = dbo.pezeshk_t.code_pezeshk
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[24] 2[32] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "noskhe_t"
            Begin Extent = 
               Top = 8
               Left = 265
               Bottom = 185
               Right = 425
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "moshtari_t"
            Begin Extent = 
               Top = 2
               Left = 46
               Bottom = 204
               Right = 212
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "pezeshk_t"
            Begin Extent = 
               Top = 6
               Left = 463
               Bottom = 157
               Right = 623
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 14
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'moshakhast_noskhe_pezeshk'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'moshakhast_noskhe_pezeshk'
GO
/****** Object:  StoredProcedure [dbo].[delete_noskhe_t]    Script Date: 01/09/2015 18:59:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create Procedure [dbo].[delete_noskhe_t]
	@id_noskhe int
As
Begin
	Delete noskhe_t
	Where
		[id_noskhe] = @id_noskhe

End
GO
/****** Object:  View [dbo].[avg_gheimat]    Script Date: 01/09/2015 18:58:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[avg_gheimat]
AS
SELECT     AVG(gheimat) AS miangin_gheimat
FROM         dbo.noskhe_t
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "noskhe_t"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 196
               Right = 198
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 12
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'avg_gheimat'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'avg_gheimat'
GO
/****** Object:  Check [CK_daro]    Script Date: 01/09/2015 18:58:55 ******/
ALTER TABLE [dbo].[daro]  WITH CHECK ADD  CONSTRAINT [CK_daro] CHECK  (([gheimat]>(0)))
GO
ALTER TABLE [dbo].[daro] CHECK CONSTRAINT [CK_daro]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'قیمت باید مقداری بزرگتر از صفر داشته باشد' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'daro', @level2type=N'CONSTRAINT',@level2name=N'CK_daro'
GO
/****** Object:  Check [CK_moshtari_t]    Script Date: 01/09/2015 18:58:55 ******/
ALTER TABLE [dbo].[moshtari_t]  WITH CHECK ADD  CONSTRAINT [CK_moshtari_t] CHECK  (([sh_shenasname]<(10000000000.)))
GO
ALTER TABLE [dbo].[moshtari_t] CHECK CONSTRAINT [CK_moshtari_t]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'error.sh_shenasname<11' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'moshtari_t', @level2type=N'CONSTRAINT',@level2name=N'CK_moshtari_t'
GO
/****** Object:  ForeignKey [FK_daro_darokhane_t]    Script Date: 01/09/2015 18:58:55 ******/
ALTER TABLE [dbo].[daro]  WITH CHECK ADD  CONSTRAINT [FK_daro_darokhane_t] FOREIGN KEY([id_d])
REFERENCES [dbo].[darokhane_t] ([id_d])
GO
ALTER TABLE [dbo].[daro] CHECK CONSTRAINT [FK_daro_darokhane_t]
GO
/****** Object:  ForeignKey [FK_karknan_darokhane_darokhane_t]    Script Date: 01/09/2015 18:58:55 ******/
ALTER TABLE [dbo].[karknan_darokhane]  WITH CHECK ADD  CONSTRAINT [FK_karknan_darokhane_darokhane_t] FOREIGN KEY([id_d])
REFERENCES [dbo].[darokhane_t] ([id_d])
GO
ALTER TABLE [dbo].[karknan_darokhane] CHECK CONSTRAINT [FK_karknan_darokhane_darokhane_t]
GO
/****** Object:  ForeignKey [FK_moshtari_t_darokhane_t]    Script Date: 01/09/2015 18:58:55 ******/
ALTER TABLE [dbo].[moshtari_t]  WITH CHECK ADD  CONSTRAINT [FK_moshtari_t_darokhane_t] FOREIGN KEY([id_d])
REFERENCES [dbo].[darokhane_t] ([id_d])
GO
ALTER TABLE [dbo].[moshtari_t] CHECK CONSTRAINT [FK_moshtari_t_darokhane_t]
GO
/****** Object:  ForeignKey [FK_noskhe_t_darokhane_t]    Script Date: 01/09/2015 18:58:55 ******/
ALTER TABLE [dbo].[noskhe_t]  WITH CHECK ADD  CONSTRAINT [FK_noskhe_t_darokhane_t] FOREIGN KEY([id_d])
REFERENCES [dbo].[darokhane_t] ([id_d])
GO
ALTER TABLE [dbo].[noskhe_t] CHECK CONSTRAINT [FK_noskhe_t_darokhane_t]
GO
/****** Object:  ForeignKey [FK_noskhe_t_moshtari_t]    Script Date: 01/09/2015 18:58:55 ******/
ALTER TABLE [dbo].[noskhe_t]  WITH CHECK ADD  CONSTRAINT [FK_noskhe_t_moshtari_t] FOREIGN KEY([id_bimar])
REFERENCES [dbo].[moshtari_t] ([id_moshtari])
GO
ALTER TABLE [dbo].[noskhe_t] CHECK CONSTRAINT [FK_noskhe_t_moshtari_t]
GO
/****** Object:  ForeignKey [FK_noskhe_t_pezeshk_t]    Script Date: 01/09/2015 18:58:55 ******/
ALTER TABLE [dbo].[noskhe_t]  WITH CHECK ADD  CONSTRAINT [FK_noskhe_t_pezeshk_t] FOREIGN KEY([code_pezeshk])
REFERENCES [dbo].[pezeshk_t] ([code_pezeshk])
GO
ALTER TABLE [dbo].[noskhe_t] CHECK CONSTRAINT [FK_noskhe_t_pezeshk_t]
GO
/****** Object:  ForeignKey [FK_pezeshk_t_darokhane_t]    Script Date: 01/09/2015 18:58:55 ******/
ALTER TABLE [dbo].[pezeshk_t]  WITH CHECK ADD  CONSTRAINT [FK_pezeshk_t_darokhane_t] FOREIGN KEY([id_d])
REFERENCES [dbo].[darokhane_t] ([id_d])
GO
ALTER TABLE [dbo].[pezeshk_t] CHECK CONSTRAINT [FK_pezeshk_t_darokhane_t]
GO
