CREATE TABLE [dbo].[Tb_BankaTanim](
	[BntId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[BntKod] [nvarchar](10) NULL,
	[BntAd] [nvarchar](50) NULL,
 CONSTRAINT [PK_Tb_BankaTanim] PRIMARY KEY CLUSTERED 
(
	[BntId] 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
CREATE TABLE [dbo].[Tb_Beden](
	[BedBeden] [nvarchar](10) NULL,
	[BedAd] [nvarchar](50) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tb_BirimTanim](
	[BirBirim] [nvarchar](10) NULL,
	[BirAd] [nvarchar](20) NULL,
	[BirUls] [nvarchar](10) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tb_FiyatBaslik](
	[FybKod] [nvarchar](10) NULL,
	[FybAd] [nvarchar](50) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tb_Grup](
	[GrpKod] [nvarchar](5) NULL,
	[GrpAd] [nvarchar](50) NULL,
	[GrpTip] [tinyint] NULL,
	[Modul] [tinyint] NULL,
	[GrpSira] [tinyint] NULL,
	[GrpYazici] [nvarchar](200) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tb_GunlKur](
	[GnkId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[GnkAnaDoviz] [nvarchar](4) NULL,
	[GnkTarih] [date] NULL,
	[GnkIsaret] [nvarchar](4) NULL,
	[GnkKur] [nvarchar](10) NULL,
	[GnkKurTip] [nvarchar](5) NULL,
 CONSTRAINT [PK_Tb_GunlKur] PRIMARY KEY CLUSTERED 
(
	[GnkId] 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
CREATE TABLE [dbo].[Tb_IlceTanim](
	[IlcId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[IlcKod] [nvarchar](10) NULL,
	[IlcAd] [nvarchar](50) NULL,
	[IlcIlId] [decimal](18, 0) NULL,
 CONSTRAINT [PK_Tb_IlceTanim] PRIMARY KEY CLUSTERED 
(
	[IlcId] 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
CREATE TABLE [dbo].[Tb_IlTanim](
	[IltId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[IltKod] [nvarchar](10) NULL,
	[IltAd] [nvarchar](50) NULL,
	[IltUlkeId] [decimal](18, 0) NULL,
 CONSTRAINT [PK_Tb_IlTanim] PRIMARY KEY CLUSTERED 
(
	[IltId] 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
CREATE TABLE [dbo].[Tb_KolonTanim](
	[KltId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[KltTanId] [int] NULL,
	[KltAd] [nvarchar](50) NULL,
	[KltBoy] [smallint] NULL,
	[KltGor] [tinyint] NULL,
	[KltSira] [tinyint] NULL,
 CONSTRAINT [PK_Tb_KolonTanim] PRIMARY KEY CLUSTERED 
(
	[KltId] 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
CREATE TABLE [dbo].[Tb_Kullanici](
	[Referans] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[Kod] [nvarchar](20) NULL,
	[Ad] [nvarchar](50) NULL,
	[Sifre] [nvarchar](50) NULL,
	[Sirket] [nvarchar](50) NULL,
	[Pref] [decimal](18, 0) NULL,
	[Padi] [nvarchar](50) NULL,
	[Dref] [decimal](18, 0) NULL,
	[Dadi] [nvarchar](50) NULL,
	[Kref] [decimal](18, 0) NULL,
	[Kadi] [nvarchar](50) NULL,
	[SabP] [tinyint] NULL,
	[SabK] [tinyint] NULL,
	[SabD] [tinyint] NULL,
	[SabS] [tinyint] NULL,
	[Yazc] [nvarchar](100) NULL,
	[Madi] [nvarchar](50) NULL,
	[SabM] [tinyint] NULL,
	[Mref] [decimal](18, 0) NULL,
	[CRef] [decimal](18, 0) NULL,
	[SabC] [tinyint] NULL,
	[CrAd] [nvarchar](100) NULL,
 CONSTRAINT [PK_DrTbl_Kullanici] PRIMARY KEY CLUSTERED 
(
	[Referans] 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
CREATE TABLE [dbo].[Tb_KulYetki](
	[KlYId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[KlYAd] [nvarchar](50) NULL,
	[KlYKd] [nvarchar](10) NULL,
	[KlYKKod] [nvarchar](20) NULL,
	[KlYKId] [decimal](18, 0) NULL,
 CONSTRAINT [PK_Tb_KulYetki] PRIMARY KEY CLUSTERED 
(
	[KlYId] 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
CREATE TABLE [dbo].[Tb_Kur](
	[Isaret] [nvarchar](4) NULL,
	[KurAd] [nvarchar](30) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tb_KurTip](
	[KtpKod] [nvarchar](5) NULL,
	[KtpAciklama] [nvarchar](30) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tb_Lisans](
	[TerminalNo] [tinyint] NULL,
	[Data] [nvarchar](50) NULL,
	[DataEk] [nvarchar](500) NULL,
	[UniqId] [nvarchar](50) NULL,
	[Kontrol] [nvarchar](50) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tb_ListeBaslik](
	[Referans] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[Tablo] [nvarchar](50) NULL,
	[KayitSayisi] [smallint] NULL,
	[SQLCumlesi] [text] NULL,
	[WhereCumlesi] [text] NULL,
	[JoinCumlesi] [text] NULL,
	[Deg1] [nvarchar](50) NULL,
	[Ad1] [nvarchar](50) NULL,
	[Tip1] [tinyint] NULL,
	[Deg2] [nvarchar](50) NULL,
	[Ad2] [nvarchar](50) NULL,
	[Tip2] [tinyint] NULL,
	[Deg3] [nvarchar](50) NULL,
	[Ad3] [nvarchar](50) NULL,
	[Tip3] [tinyint] NULL,
	[Deg4] [nvarchar](50) NULL,
	[Ad4] [nvarchar](50) NULL,
	[Tip4] [tinyint] NULL,
	[Deg5] [nvarchar](50) NULL,
	[Ad5] [nvarchar](50) NULL,
	[Tip5] [tinyint] NULL,
	[SiralamaDeg] [nvarchar](50) NULL,
	[SiralamaTip] [tinyint] NULL,
	[IndexDeg] [nvarchar](50) NULL,
	[Ad] [nvarchar](50) NULL,
	[KontrolDeg] [nvarchar](50) NULL,
	[LsBZemRnKl] [tinyint] NULL,
	[LsBZemRenk] [int] NULL,
	[LsBZmRnFrm] [nvarchar](100) NULL,
	[LsBYazRnKl] [tinyint] NULL,
	[LsBYazRenk] [int] NULL,
	[LsBYzRnFrm] [nvarchar](100) NULL,
	[LsBFontKul] [tinyint] NULL,
	[LsBFontAdi] [nvarchar](50) NULL,
	[LsBFontSiz] [tinyint] NULL,
	[LsBFontSty] [tinyint] NULL,
	[LsBFontFrm] [nvarchar](100) NULL,
 CONSTRAINT [PK_Tb_ListeBaslik] PRIMARY KEY CLUSTERED 
(
	[Referans] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tb_ListeKalem](
	[Referans] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[BaslikReferans] [decimal](18, 0) NULL,
	[Deg] [nvarchar](2000) NULL,
	[Ad] [nvarchar](50) NULL,
	[Boy] [smallint] NULL,
	[Tip] [tinyint] NULL,
 CONSTRAINT [PK_Tb_ListeKalem] PRIMARY KEY CLUSTERED 
(
	[Referans] 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
CREATE TABLE [dbo].[Tb_Magaza](
	[Referans] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[Kod] [nvarchar](20) NULL,
	[Ad] [nvarchar](50) NULL,
	[Yetk] [nvarchar](50) NULL,
	[Il] [nvarchar](50) NULL,
	[Ilce] [nvarchar](50) NULL,
	[Telf] [nvarchar](50) NULL,
	[Fax] [nvarchar](50) NULL,
	[Acik] [nvarchar](100) NULL,
	[Adres] [nvarchar](100) NULL,
	[Alan] [money] NULL,
 CONSTRAINT [PK_Tb_Magz] PRIMARY KEY CLUSTERED 
(
	[Referans] 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
CREATE TABLE [dbo].[Tb_Meslek](
	[MslKod] [nvarchar](10) NULL,
	[MslAd] [nvarchar](50) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tb_Oran](
	[OranId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[Oran] [money] NULL,
	[Aciklama] [nvarchar](50) NULL,
	[OranTip] [tinyint] NULL,
 CONSTRAINT [PK_Tb_Oran] PRIMARY KEY CLUSTERED 
(
	[OranId] 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
CREATE TABLE [dbo].[Tb_OzelKod](
	[OzelKod] [nvarchar](20) NULL,
	[Aciklama] [nvarchar](50) NULL,
	[OzelKodTip] [tinyint] NULL,
	[Modul] [tinyint] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tb_RaporBolum](
	[RbId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[RbRaporId] [decimal](18, 0) NULL,
	[RbBolTipi] [tinyint] NULL,
	[RbSnrCizg] [nvarchar](4) NULL,
	[RbSnrRenk] [int] NULL,
	[RbSnrCzKl] [tinyint] NULL,
	[RbZemRnKl] [tinyint] NULL,
	[RbZemRenk] [int] NULL,
	[RbZmRnFrm] [nvarchar](200) NULL,
	[RbYazRnKl] [tinyint] NULL,
	[RbYazRenk] [int] NULL,
	[RbYzRnFrm] [nvarchar](200) NULL,
	[RbFontKul] [tinyint] NULL,
	[RbFontAdi] [nvarchar](50) NULL,
	[RbFontSiz] [tinyint] NULL,
	[RbFontSty] [tinyint] NULL,
	[RbFontFrm] [nvarchar](200) NULL,
	[RbIkiRnKl] [tinyint] NULL,
	[RbIlkRenk] [int] NULL,
	[RbIkiRenk] [int] NULL,
 CONSTRAINT [PK_Tb_RaporBolum] PRIMARY KEY CLUSTERED 
(
	[RbId] 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
CREATE TABLE [dbo].[Tb_RaporKriter](
	[RkId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[RkRaporId] [decimal](18, 0) NULL,
	[RkTipi] [nvarchar](15) NULL,
	[RkBaslik] [nvarchar](50) NULL,
	[RkData] [nvarchar](50) NULL,
	[RkDataTip] [nvarchar](10) NULL,
	[RkVeriTip] [nvarchar](20) NULL,
	[RkVeriKay] [nvarchar](1000) NULL,
	[RkSira] [smallint] NULL,
 CONSTRAINT [PK_Tb_RaporKriter] PRIMARY KEY CLUSTERED 
(
	[RkId] 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
CREATE TABLE [dbo].[Tb_Raporlar](
	[RpId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[RpAd] [nvarchar](100) NULL,
	[RpTip] [tinyint] NULL,
	[RpModul] [tinyint] NULL,
	[RpKagit] [tinyint] NULL,
	[RpBasim] [tinyint] NULL,
	[RpUst] [int] NULL,
	[RpSol] [int] NULL,
	[RpGrp] [int] NULL,
	[RpPnl0] [int] NULL,
	[RpPnl1] [int] NULL,
	[RpPnl2] [int] NULL,
	[RpPnl3] [int] NULL,
	[RpPnl4] [int] NULL,
	[RpPnl5] [int] NULL,
	[RpPnl6] [int] NULL,
	[RpSql] [ntext] NULL,
	[RpKon] [nvarchar](50) NULL,
	[RpHrT] [tinyint] NULL,
	[RpSirl] [nvarchar](50) NULL,
	[RpMerkezId] [int] NULL,
	[RpEkAln1] [nvarchar](200) NULL,
	[RpEkAln2] [nvarchar](50) NULL,
	[RpSatirSay] [tinyint] NULL,
	[RpAltBos] [tinyint] NULL,
	[RpSayfaBoy] [money] NULL,
	[RpDefYzc] [nvarchar](100) NULL,
	[RpSag] [int] NULL,
	[RpFavori] [tinyint] NULL
 CONSTRAINT [PK_Tb_Raporlar] PRIMARY KEY CLUSTERED 
(
	[RpId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tb_RaporLink](
	[RlId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[RlRaporId] [decimal](18, 0) NULL,
	[RlTablo1] [nvarchar](50) NULL,
	[RlTablo2] [nvarchar](50) NULL,
	[RlSaha1] [nvarchar](50) NULL,
	[RlSaha2] [nvarchar](50) NULL,
 CONSTRAINT [PK_Tb_RaporLink] PRIMARY KEY CLUSTERED 
(
	[RlId] 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
CREATE TABLE [dbo].[Tb_RaporObje](
	[RoId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[RoRaporId] [decimal](18, 0) NULL,
	[RoUst] [int] NULL,
	[RoSol] [int] NULL,
	[RoGen] [int] NULL,
	[RoYuk] [int] NULL,
	[RoZemin] [int] NULL,
	[RoYazi] [int] NULL,
	[RoFont] [nvarchar](50) NULL,
	[RoSize] [int] NULL,
	[RoStyle] [int] NULL,
	[RoHiza] [int] NULL,
	[RoData] [nvarchar](50) NULL,
	[RoDataTip] [tinyint] NULL,
	[RoParcaSay] [tinyint] NULL,
	[RoParcaBoy] [int] NULL,
	[RoPanel] [nvarchar](5) NULL,
	[RoTipi] [tinyint] NULL,
	[RoYazRes] [nvarchar](500) NULL,
	[RoFormul] [nvarchar](2000) NULL,
	[RoKenar] [nvarchar](4) NULL,
	[RoKnRnk] [int] NULL,
	[RoKnBoy] [tinyint] NULL,
CONSTRAINT [PK_Tb_RaporObje] PRIMARY KEY CLUSTERED 
(
	[RoId] 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
CREATE TABLE [dbo].[Tb_RaporTablo](
	[RtId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[RtAd] [nvarchar](50) NULL,
	[RtRpAd] [nvarchar](50) NULL,
	[RtRaporId] [decimal](18, 0) NULL,
	[RtData] [nvarchar](50) NULL,
 CONSTRAINT [PK_Tb_RaporTablo] PRIMARY KEY CLUSTERED 
(
	[RtId] 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
CREATE TABLE [dbo].[Tb_RaporTemp](
	[TmpKod1] [nvarchar](20) NULL,
	[TmpKod2] [nvarchar](20) NULL,
	[TmpAd1] [nvarchar](500) NULL,
	[TmpAd2] [nvarchar](500) NULL,
	[TmpTut1] [money] NULL,
	[TmpTut2] [money] NULL,
	[TmpTarih] [date] NULL,
	[TmpId] [decimal](18, 0) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tb_RaporRnFr](
	[RfId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[RfRaporId] [decimal](18, 0) NULL,
	[RfKaynakTipi] [nvarchar](6) NULL,
	[RfKaynak] [nvarchar](50) NULL,
	[RfKontrolTipi] [nvarchar](6) NULL,
	[RfKontrol] [nvarchar](50) NULL,
	[RfKosul] [nvarchar](2) NULL,
	[RfHedefTipi] [nvarchar](6) NULL,
	[RfHedef] [nvarchar](50) NULL,
	[RfRenkFr] [int] NULL,
	[RfRenkBc] [int] NULL,
	[RfFont] [nvarchar](100) NULL,
	[RfSize] [int] NULL,
	[RfStyle] [int] NULL,
	[RfDataTipi] [tinyint] NULL,
 CONSTRAINT [PK_Tb_RaporRnFr] PRIMARY KEY CLUSTERED 
(
	[RfId] 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
CREATE TABLE [dbo].[Tb_Renk](
	[RenId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[RenKod] [nvarchar](12) NULL,
	[RenAd] [nvarchar](50) NULL,
	[RenDeger] [nvarchar](12) NULL,
 CONSTRAINT [PK_Tb_Renk] PRIMARY KEY CLUSTERED 
(
	[RenId] 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
CREATE TABLE [dbo].[Tb_SahaTur](
	[ShtId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[ShtAd] [nvarchar](50) NULL,
	[ShtDeger] [tinyint] NULL,
	[ShtKolon] [nvarchar](50) NULL,
	[ShtKosul] [tinyint] NULL,
 CONSTRAINT [PK_Tb_SahaTur] PRIMARY KEY CLUSTERED 
(
	[ShtId] 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
CREATE TABLE [dbo].[Tb_Sektor](
	[SekId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[SekKod] [nvarchar](10) NULL,
	[SekAd] [nvarchar](50) NULL,
 CONSTRAINT [PK_Tb_Sektor] PRIMARY KEY CLUSTERED 
(
	[SekId] 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
CREATE TABLE [dbo].[Tb_SeriBaslik](
	[SeriId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[SeriKod] [nvarchar](10) NULL,
	[SeriAd] [nvarchar](50) NULL,
 CONSTRAINT [PK_Tb_SeriBaslik] PRIMARY KEY CLUSTERED 
(
	[SeriId] 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
CREATE TABLE [dbo].[Tb_SeriSatir](
	[SeriKlId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[SeriBaslikId] [decimal](18, 0) NULL,
	[SrRenkId] [decimal](18, 0) NULL,
	[SrBeden] [nvarchar](10) NULL,
 CONSTRAINT [PK_Tb_SeriSatir] PRIMARY KEY CLUSTERED 
(
	[SeriKlId] 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
CREATE TABLE [dbo].[Tb_Sirket](
	[Kod] [nvarchar](50) NULL,
	[Ad] [nvarchar](50) NULL,
	[Yil] [nvarchar](50) NULL,
	[Gorunur] [bit] NULL,
	[Aciklama1] [nvarchar](50) NULL,
	[Aciklama2] [nvarchar](50) NULL,
	[Adres1] [nvarchar](50) NULL,
	[Adres2] [nvarchar](50) NULL,
	[SirKasaId] [decimal](18,0) NULL,
	[SirCariId] [decimal](18,0) NULL,
	[Son] [tinyint] NULL,
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tb_SubeTanim](
	[SbTId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[SbTKod] [nvarchar](10) NULL,
	[SbTAd] [nvarchar](50) NULL,
	[SbTBankaId] [decimal](18, 0) NULL,
 CONSTRAINT [PK_Tb_SubeTanim] PRIMARY KEY CLUSTERED 
(
	[SbTId] 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
CREATE TABLE [dbo].[Tb_Tanimlar](
	[TanimKod] [tinyint] NULL,
	[Tanim] [ntext] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tb_TatilTanim](
	[TtnTarih] [date] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tb_Ulke](
	[UlkId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[UlkKod] [nvarchar](10) NULL,
	[UlkAd] [nvarchar](50) NULL,
 CONSTRAINT [PK_Tb_Ulke] PRIMARY KEY CLUSTERED 
(
	[UlkId] 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
CREATE TABLE [dbo].[Tb_UrTd](
	[UrtId] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[UrtKod] [nvarchar](10) NULL,
	[UrtUnvan] [nvarchar](50) NULL,
 CONSTRAINT [PK_Tb_UrTd] PRIMARY KEY CLUSTERED 
(
	[UrtId] 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
CREATE PROCEDURE [dbo].[Sp_KullKayit]
@Referans		decimal,
@Kod			nvarchar(10),
@Ad			nvarchar(50),
@Sifre			nvarchar(10),
@Sirket			nvarchar(10),
@Pref			decimal,
@Padi			nvarchar(50),
@Dref			decimal,
@Dadi			nvarchar(50),
@Kref			decimal,
@Kadi			nvarchar(50),
@Mref			decimal,
@Madi			nvarchar(50),
@SabP			tinyint,
@SabK			tinyint,
@SabD			tinyint,
@SabS			tinyint,
@SabM			tinyint,
@CRef			decimal,
@CrAd			nvarchar(100),
@SabC			tinyint,
@Yazc			nvarchar(100),
@Yeni			tinyint
AS
BEGIN
if @Yeni = 0
	BEGIN
	INSERT Tb_Kullanici(
		Kod,Ad,Sifre,Sirket,Pref,Padi,Dref,Dadi,Kref,Kadi,SabP,
		SabK,SabD,SabS,Yazc,Mref,Madi,SabM,CRef,CrAd,SabC
		) VALUES (
		@Kod,@Ad,@Sifre,@Sirket,@Pref,@Padi,@Dref,@Dadi,@Kref,
		@Kadi,@SabP,@SabK,@SabD,@SabS,@Yazc,@Mref,@Madi,@SabM,@CRef,@CrAd,@SabC
		)
	END
	ELSE
	BEGIN
		UPDATE Tb_Kullanici SET
		Kod=@Kod,Ad=@Ad,Sifre=@Sifre,Sirket=@Sirket,Pref=@Pref,
		Padi=@Padi,Dref=@Dref,Dadi=@Dadi,Kref=@Kref,Kadi=@Kadi,SabP=@SabP,SabK=@SabK,
		SabD=@SabD,SabS=@SabS,Yazc=@Yazc,Mref=@Mref,Madi=@Madi,SabM=@SabM,
		CRef=@CRef,CrAd=@CrAd,SabC=@SabC
		WHERE Referans=@Referans 
	END
END
GO
CREATE PROCEDURE [dbo].[Sp_ListeBaslikKayit] (    

        @Referans decimal,
        @KayitSayisi smallint,
        @SQLCumlesi nvarchar (4000),
        @WhereCumlesi nvarchar (4000),
        @JoinCumlesi nvarchar (4000),
        @Deg1 nvarchar (50),
        @Ad1 nvarchar (50),
        @Tip1 tinyint,
        @Deg2 nvarchar (50),
        @Ad2 nvarchar (50),
        @Tip2 tinyint,
        @Deg3 nvarchar (50),
        @Ad3 nvarchar (50),
        @Tip3 tinyint,
        @Deg4 nvarchar (50),
        @Ad4 nvarchar (50),
        @Tip4 tinyint,
        @Deg5 nvarchar (50),
        @Ad5 nvarchar (50),
        @Tip5 tinyint,
        @SiralamaDeg nvarchar (50),
        @SiralamaTip tinyint,
        @IndexDeg nvarchar (50),
        @Ad nvarchar (50),
		@LsBZemRnKl tinyint,
		@LsBZemRenk int,
		@LsBZmRnFrm varchar(100),
		@LsBYazRnKl tinyint,
		@LsBYazRenk int,
		@LsBYzRnFrm nvarchar(100),
		@LsBFontKul tinyint,
		@LsBFontAdi nvarchar(50),
		@LsBFontSiz tinyint,
		@LsBFontSty tinyint,
		@LsBFontFrm nvarchar(100)
    )
    
    AS

    UPDATE Tb_ListeBaslik SET 
         
        KayitSayisi=@KayitSayisi,
        SQLCumlesi=@SQLCumlesi,
        WhereCumlesi=@WhereCumlesi,
        JoinCumlesi=@JoinCumlesi,
        Deg1=@Deg1,
        Ad1=@Ad1,
        Tip1=@Tip1,
        Deg2=@Deg2,
        Ad2=@Ad2,
        Tip2=@Tip2,
        Deg3=@Deg3,
        Ad3=@Ad3,
        Tip3=@Tip3,
        Deg4=@Deg4,
        Ad4=@Ad4,
        Tip4=@Tip4,
        Deg5=@Deg5,
        Ad5=@Ad5,
        Tip5=@Tip5,
        SiralamaDeg=@SiralamaDeg,
        SiralamaTip=@SiralamaTip,
        IndexDeg=@IndexDeg,
        Ad=@Ad,
	LsBZemRnKl=@LsBZemRnKl,
	LsBZemRenk=@LsBZemRenk,
	LsBZmRnFrm=@LsBZmRnFrm,
	LsBYazRnKl=@LsBYazRnKl,
	LsBYazRenk=@LsBYazRenk,
	LsBYzRnFrm=@LsBYzRnFrm,
	LsBFontKul=@LsBFontKul,
	LsBFontAdi=@LsBFontAdi,
	LsBFontSiz=@LsBFontSiz,
	LsBFontSty=@LsBFontSty,
	LsBFontFrm=@LsBFontFrm
WHERE Referans=@Referans
GO
CREATE PROCEDURE [dbo].[Sp_ListeKalemKayit](    

        @BaslikReferans decimal,
        @Deg nvarchar (1000),
        @Ad nvarchar (50),
        @Boy smallint,
        @Tip tinyint
        	
    )
    AS
    INSERT INTO Tb_ListeKalem(BaslikReferans,Deg,Ad,Boy,Tip) VALUES (@BaslikReferans,@Deg,@Ad,@Boy,@Tip)
GO
CREATE PROCEDURE [dbo].[Sp_MagazaKayit]
@Referans	decimal,
@Kod		nvarchar(10),
@Ad			nvarchar(50),
@Yetk		nvarchar(50),
@Il			nvarchar(50),
@Ilce		nvarchar(50),
@Telf		nvarchar(50),
@Fax		nvarchar(50),
@Acik		nvarchar(100),
@Adres		nvarchar(100),
@Alan		money,
@Yeni		tinyint
AS
BEGIN
if @Yeni = 0
	BEGIN
	INSERT Tb_Magaza(
		Kod,Ad,Yetk,Il,Ilce,Telf,Fax,Acik,Adres,Alan
		) VALUES (
		@Kod,@Ad,@Yetk,@Il,@Ilce,@Telf,@Fax,@Acik,@Adres,@Alan		
		)
	END
	ELSE
	BEGIN
		UPDATE Tb_Magaza SET
		Kod=@Kod,Ad=@Ad,Yetk=@Yetk,Il=@Il,Ilce=@Ilce,Telf=@Telf,Fax=@Fax,
		Acik=@Acik,Adres=@Adres,Alan=@Alan		
		WHERE Referans=@Referans 
	END
END
GO