WWW.DISSERS.RU


...
    !

Pages:     | 1 | 2 ||

...

-- [ 3 ] --

14. /****** Object: Table [dbo].[MonthCount] Script Date: 15.01.2004 15:40:41 ******/ CREATE TABLE [dbo].[MonthCount] ( [id_month_count] [int] IDENTITY (1, 1) NOT NULL, [count_name] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[accounts] Script Date: 15.01.2004 15:40:41 ******/ CREATE TABLE [dbo].[accounts] ( [id_account] [int] IDENTITY (2000, 5) NOT NULL, [username] [nvarchar] (30) COLLATE Cyrillic_General_CI_AS NOT NULL, [email] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL, [password] [nvarchar] (20) COLLATE Cyrillic_General_CI_AS NOT NULL, [when_registered] [datetime] NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[business] Script Date: 15.01.2004 15:40:41 ******/ CREATE TABLE [dbo].[business] ( [id_business] [int] IDENTITY (1, 1) NOT NULL, [business_name] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL, [notes] [ntext] COLLATE Cyrillic_General_CI_AS NULL, [priority] [int] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO /****** Object: Table [dbo].[city_types] Script Date: 15.01.2004 15:40:42 ******/ CREATE TABLE [dbo].[city_types] ( [id_city_type] [int] NOT NULL, [city_type_name] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[contacts_at] Script Date: 15.01.2004 15:40:42 ******/ CREATE TABLE [dbo].[contacts_at] ( [id_at] [int] IDENTITY (1, 1) NOT NULL, [at_name] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[contacts_pt] Script Date: 15.01.2004 15:40:42 ******/ CREATE TABLE [dbo].[contacts_pt] ( [id_pt] [int] IDENTITY (1, 1) NOT NULL, [pt_name] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[countries] Script Date: 15.01.2004 15:40:42 ******/ CREATE TABLE [dbo].[countries] ( [id_country] [int] IDENTITY (1, 1) NOT NULL, [country_name] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[ed_izm] Script Date: 15.01.2004 15:40:43 ******/ CREATE TABLE [dbo].[ed_izm] ( [id_ed_izm] [int] IDENTITY (1, 1) NOT NULL, [ez_izm_name] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL, [priority] [int] NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[group_types] Script Date: 15.01.2004 15:40:43 ******/ CREATE TABLE [dbo].[group_types] ( [id_group_type] [int] NOT NULL, [group_type_name] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL, [notes] [char] (10) COLLATE Cyrillic_General_CI_AS NULL, [priority] [int] NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[guarantee] Script Date: 15.01.2004 15:40:43 ******/ CREATE TABLE [dbo].[guarantee] ( [id_guarantee_type] [int] IDENTITY (1, 1) NOT NULL, [guarantee_name] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[money_type] Script Date: 15.01.2004 15:40:43 ******/ CREATE TABLE [dbo].[money_type] ( [id_money_type] [int] IDENTITY (1, 1) NOT NULL, [money_name] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL, [money_name_short] [nvarchar] (10) COLLATE Cyrillic_General_CI_AI NULL, [priority] [int] NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[owner_form_names] Script Date: 15.01.2004 15:40:43 ******/ CREATE TABLE [dbo].[owner_form_names] ( [id_of] [int] IDENTITY (1, 1) NOT NULL, [of_name] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL, [priority] [int] NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[price_type] Script Date: 15.01.2004 15:40:44 ******/ CREATE TABLE [dbo].[price_type] ( [id_price_type] [int] IDENTITY (1, 1) NOT NULL, [price_type_name] [nvarchar] (100) COLLATE Cyrillic_General_CI_AS NOT NULL, [priority] [int] NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[redirection] Script Date: 15.01.2004 15:40:44 ******/ CREATE TABLE [dbo].[redirection] ( [id_redir] [int] NOT NULL, [redir_name] [varchar] (250) COLLATE Cyrillic_General_CI_AS NOT NULL, [redir_dest] [varchar] (250) COLLATE Cyrillic_General_CI_AS NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[accounts_ip] Script Date: 15.01.2004 15:40:44 ******/ CREATE TABLE [dbo].[accounts_ip] ( [id_ip] [int] IDENTITY (1, 1) NOT NULL, [id_account] [int] NOT NULL, [date_time] [smalldatetime] NOT NULL, [ip] [varchar] (15) COLLATE Cyrillic_General_CI_AS NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[business_sub] Script Date: 15.01.2004 15:40:44 ******/ CREATE TABLE [dbo].[business_sub] ( [id_subbusiness] [int] IDENTITY (1, 1) NOT NULL, [id_business] [int] NOT NULL, [sb_name] [nvarchar] (80) COLLATE Cyrillic_General_CI_AS NOT NULL, [notes] [ntext] COLLATE Cyrillic_General_CI_AS NULL, [priority] [int] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO /****** Object: Table [dbo].[regions] Script Date: 15.01.2004 15:40:45 ******/ CREATE TABLE [dbo].[regions] ( [id_region] [int] IDENTITY (1, 1) NOT NULL, [id_country] [int] NOT NULL, [region_name] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[cities] Script Date: 15.01.2004 15:40:45 ******/ CREATE TABLE [dbo].[cities] ( [id_city] [int] IDENTITY (1, 1) NOT NULL, [id_region] [int] NOT NULL, [id_city_type] [int] NOT NULL, [city_name] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL, [priority] [int] NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[contacts] Script Date: 15.01.2004 15:40:45 ******/ CREATE TABLE [dbo].[contacts] ( [id_contact] [int] IDENTITY (1, 1) NOT NULL, [id_account] [int] NOT NULL, [calling] [nvarchar] (40) COLLATE Cyrillic_General_CI_AS NULL, [first_name] [nvarchar] (40) COLLATE Cyrillic_General_CI_AS NOT NULL, [middle_name] [nvarchar] (40) COLLATE Cyrillic_General_CI_AS NULL, [laste_name] [nvarchar] (40) COLLATE Cyrillic_General_CI_AS NOT NULL, [suffix] [nvarchar] (3) COLLATE Cyrillic_General_CI_AS NULL, [job] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NULL, [organization] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NULL, [show_as] [int] NOT NULL, [id_city] [int] NULL, [zip] [int] NULL, [street] [nvarchar] (40) COLLATE Cyrillic_General_CI_AS NULL, [otdel] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NULL, [room] [nvarchar] (10) COLLATE Cyrillic_General_CI_AS NULL, [profession] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NULL, [pseudonim] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NULL, [wife] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NULL, [birthday] [smalldatetime] NULL, [godovshina] [smalldatetime] NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[organizations] Script Date: 15.01.2004 15:40:46 ******/ CREATE TABLE [dbo].[organizations] ( [id_organization] [int] IDENTITY (1, 1) NOT NULL, [id_account] [int] NOT NULL, [id_city] [int] NOT NULL, [id_of] [int] NULL, [organization_name] [nvarchar] (100) COLLATE Cyrillic_General_CI_AS NOT NULL, [address] [ntext] COLLATE Cyrillic_General_CI_AS NOT NULL, [phone] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL, [fax] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NULL, [www] [nvarchar] (100) COLLATE Cyrillic_General_CI_AS NULL, [email] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NULL, [add_info] [ntext] COLLATE Cyrillic_General_CI_AS NULL, [when_added] [smalldatetime] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO /****** Object: Table [dbo].[contacts_address] Script Date: 15.01.2004 15:40:46 ******/ CREATE TABLE [dbo].[contacts_address] ( [id_aa] [int] IDENTITY (1, 1) NOT NULL, [id_at] [int] NOT NULL, [id_contact] [int] NOT NULL, [id_city] [int] NOT NULL, [zip] [varchar] (10) COLLATE Cyrillic_General_CI_AS NULL, [street_home] [ntext] COLLATE Cyrillic_General_CI_AS NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO /****** Object: Table [dbo].[contacts_phones] Script Date: 15.01.2004 15:40:46 ******/ CREATE TABLE [dbo].[contacts_phones] ( [id_phone] [int] IDENTITY (1, 1) NOT NULL, [id_pt] [int] NOT NULL, [id_contact] [int] NOT NULL, [id_country] [int] NOT NULL, [zip] [nvarchar] (10) COLLATE Cyrillic_General_CI_AS NULL, [number] [varchar] (15) COLLATE Cyrillic_General_CI_AS NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[organizations_subbusinesses] Script Date: 15.01.2004 15:40:46 ******/ CREATE TABLE [dbo].[organizations_subbusinesses] ( [id_os] [int] IDENTITY (1, 1) NOT NULL, [id_organization] [int] NOT NULL, [id_subbusiness] [int] NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[price_groups] Script Date: 15.01.2004 15:40:47 ******/ CREATE TABLE [dbo].[price_groups] ( [id_price_group] [int] IDENTITY (1, 1) NOT NULL, [id_group_type] [int] NULL, [id_organization] [int] NULL, [group_title] [nvarchar] (200) COLLATE Cyrillic_General_CI_AS NOT NULL, [notes] [ntext] COLLATE Cyrillic_General_CI_AS NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO /****** Object: Table [dbo].[prices] Script Date: 15.01.2004 15:40:47 ******/ CREATE TABLE [dbo].[prices] ( [id_price] [int] IDENTITY (1, 1) NOT NULL, [id_organization] [int] NOT NULL, [id_price_group] [int] NOT NULL, [product_name] [nvarchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL, [product_description] [ntext] COLLATE Cyrillic_General_CI_AS NULL, [product_price] [real] NULL, [product_price_melk] [real] NULL, [product_price_krupn] [char] (10) COLLATE Cyrillic_General_CI_AS NULL, [product_price_mt] [int] NULL, [product_price_melk_mt] [int] NULL, [product_price_krupn_mt] [int] NULL, [product_price_type] [int] NULL, [product_price_melk_type] [int] NULL, [product_price_krupn_type] [int] NULL, [id_ed_izm] [int] NULL, [guarantee_name] [real] NULL, [id_guarantee_type] [int] NULL, [dostavka] [ntext] COLLATE Cyrillic_General_CI_AS NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO /****** Object: Table [dbo].[price_pictures] Script Date: 15.01.2004 15:40:48 ******/ CREATE TABLE [dbo].[price_pictures] ( [id_pp] [int] IDENTITY (1, 1) NOT NULL, [id_price] [int] NOT NULL, [picture] [image] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO ALTER TABLE [dbo].[accounts] WITH NOCHECK ADD CONSTRAINT [PK_accounts] PRIMARY KEY CLUSTERED ( [id_account] ) ON [PRIMARY] GO ALTER TABLE [dbo].[business] WITH NOCHECK ADD CONSTRAINT [PK_business] PRIMARY KEY CLUSTERED ( [id_business] ) ON [PRIMARY] GO ALTER TABLE [dbo].[city_types] WITH NOCHECK ADD CONSTRAINT [PK_city_types] PRIMARY KEY CLUSTERED ( [id_city_type] ) ON [PRIMARY] GO ALTER TABLE [dbo].[contacts_at] WITH NOCHECK ADD CONSTRAINT [PK_contacts_at] PRIMARY KEY CLUSTERED ( [id_at] ) ON [PRIMARY] GO ALTER TABLE [dbo].[contacts_pt] WITH NOCHECK ADD CONSTRAINT [PK_contacts_pt] PRIMARY KEY CLUSTERED ( [id_pt] ) ON [PRIMARY] GO ALTER TABLE [dbo].[countries] WITH NOCHECK ADD CONSTRAINT [PK_countries] PRIMARY KEY CLUSTERED ( [id_country] ) ON [PRIMARY] GO ALTER TABLE [dbo].[ed_izm] WITH NOCHECK ADD CONSTRAINT [PK_ed_izm] PRIMARY KEY CLUSTERED ( [id_ed_izm] ON [PRIMARY] ) GO ALTER TABLE [dbo].[group_types] WITH NOCHECK ADD CONSTRAINT [PK_group_types] PRIMARY KEY CLUSTERED ( [id_group_type] ) ON [PRIMARY] GO ALTER TABLE [dbo].[guarantee] WITH NOCHECK ADD CONSTRAINT [PK_guarantee] PRIMARY KEY CLUSTERED ( [id_guarantee_type] ) ON [PRIMARY] GO ALTER TABLE [dbo].[money_type] WITH NOCHECK ADD CONSTRAINT [PK_money_type] PRIMARY KEY CLUSTERED ( [id_money_type] ) ON [PRIMARY] GO ALTER TABLE [dbo].[owner_form_names] WITH NOCHECK ADD CONSTRAINT [PK_owner_form_names] PRIMARY KEY CLUSTERED ( [id_of] ) ON [PRIMARY] GO ALTER TABLE [dbo].[price_type] WITH NOCHECK ADD CONSTRAINT [PK_price_type] PRIMARY KEY CLUSTERED ( [id_price_type] ) ON [PRIMARY] GO ALTER TABLE [dbo].[accounts_ip] WITH NOCHECK ADD CONSTRAINT [PK_accounts_ip] PRIMARY KEY CLUSTERED ( [id_ip] ) ON [PRIMARY] GO ALTER TABLE [dbo].[business_sub] WITH NOCHECK ADD CONSTRAINT [PK_business_sub] PRIMARY KEY CLUSTERED ( [id_subbusiness] ) ON [PRIMARY] GO ALTER TABLE [dbo].[regions] WITH NOCHECK ADD CONSTRAINT [PK_regions] PRIMARY KEY CLUSTERED ( [id_region] ) ON [PRIMARY] GO ALTER TABLE [dbo].[cities] WITH NOCHECK ADD CONSTRAINT [PK_cities] PRIMARY KEY CLUSTERED ( [id_city] ) ON [PRIMARY] GO ALTER TABLE [dbo].[contacts] WITH NOCHECK ADD CONSTRAINT [PK_contacts] PRIMARY KEY CLUSTERED ( [id_contact] ) ON [PRIMARY] GO ALTER TABLE [dbo].[organizations] WITH NOCHECK ADD CONSTRAINT [PK_organizations] PRIMARY KEY CLUSTERED ( [id_organization] ) ON [PRIMARY] GO ALTER TABLE [dbo].[contacts_address] WITH NOCHECK ADD CONSTRAINT [PK_contacts_address] PRIMARY KEY CLUSTERED ( [id_aa] ) ON [PRIMARY] GO ALTER TABLE [dbo].[contacts_phones] WITH NOCHECK ADD CONSTRAINT [PK_contacts_phones] PRIMARY KEY CLUSTERED ( [id_phone] ) ON [PRIMARY] GO ALTER TABLE [dbo].[organizations_subbusinesses] WITH NOCHECK ADD CONSTRAINT [PK_organizations_subbusinesses] PRIMARY KEY CLUSTERED ( [id_os] ) ON [PRIMARY] GO ALTER TABLE [dbo].[price_groups] WITH NOCHECK ADD CONSTRAINT [PK_price_groups] PRIMARY KEY CLUSTERED ( [id_price_group] ) ON [PRIMARY] GO ALTER TABLE [dbo].[prices] WITH NOCHECK ADD CONSTRAINT [PK_prices] PRIMARY KEY CLUSTERED ( [id_price] ) ON [PRIMARY] GO ALTER TABLE [dbo].[price_pictures] WITH NOCHECK ADD CONSTRAINT [PK_price_pictures] PRIMARY KEY CLUSTERED ( [id_pp] ) ON [PRIMARY] GO ALTER TABLE [dbo].[accounts] ADD CONSTRAINT [DF_accounts_when_registered] DEFAULT (getdate()) FOR [when_registered], CONSTRAINT [IX_accounts] UNIQUE NONCLUSTERED ( [username] ) ON [PRIMARY] GO ALTER TABLE [dbo].[business] ADD CONSTRAINT [DF_business_priority] DEFAULT (5) FOR [priority] GO ALTER TABLE [dbo].[ed_izm] ADD CONSTRAINT [DF_ed_izm_priority] DEFAULT (5) FOR [priority] GO ALTER TABLE [dbo].[group_types] ADD CONSTRAINT [DF_group_types_priority] DEFAULT (5) FOR [priority] GO ALTER TABLE [dbo].[money_type] ADD CONSTRAINT [DF_money_type_priority] DEFAULT (5) FOR [priority] GO ALTER TABLE [dbo].[owner_form_names] ADD CONSTRAINT [DF_owner_form_names_priority] DEFAULT (5) FOR [priority] GO ALTER TABLE [dbo].[price_type] ADD CONSTRAINT [DF_price_type_priority] DEFAULT (5) FOR [priority] GO ALTER TABLE [dbo].[accounts_ip] ADD CONSTRAINT [DF_accounts_ip_date_time] DEFAULT (getdate()) FOR [date_time] GO ALTER TABLE [dbo].[business_sub] ADD CONSTRAINT [DF_business_sub_priority] DEFAULT (5) FOR [priority] GO ALTER TABLE [dbo].[cities] ADD CONSTRAINT [DF_cities_id_region] DEFAULT (1) FOR [id_region], CONSTRAINT [DF_cities_id_city_type] DEFAULT (1) FOR [id_city_type], CONSTRAINT [DF_cities_priority] DEFAULT (5) FOR [priority] GO ALTER TABLE [dbo].[organizations] ADD CONSTRAINT [DF_organizations_when_added] DEFAULT (getdate()) FOR [when_added], CONSTRAINT [IX_organizations] UNIQUE NONCLUSTERED ( [organization_name] ) ON [PRIMARY] GO ALTER TABLE [dbo].[contacts_phones] ADD CONSTRAINT [DF_contacts_phones_id_country] DEFAULT (1) FOR [id_country] GO ALTER TABLE [dbo].[prices] ADD CONSTRAINT [DF_prices_product_price_mt] DEFAULT (3) FOR [product_price_mt], CONSTRAINT [DF_prices_product_price_melk_mt] DEFAULT (3) FOR [product_price_melk_mt], CONSTRAINT [DF_prices_product_price_krupn_mt] DEFAULT (3) FOR [product_price_krupn_mt], CONSTRAINT [DF_prices_product_price_type] DEFAULT (10) FOR [product_price_type], CONSTRAINT [DF_prices_product_price_melk_type] DEFAULT (10) FOR [product_price_melk_type], CONSTRAINT [DF_prices_product_price_krupn_type] DEFAULT (10) FOR [product_price_krupn_type] GO ALTER TABLE [dbo].[accounts_ip] ADD CONSTRAINT [FK_accounts_ip_accounts] FOREIGN KEY ( [id_account] ) REFERENCES [dbo].[accounts] ( [id_account] ) ON DELETE CASCADE ON UPDATE CASCADE GO ALTER TABLE [dbo].[business_sub] ADD CONSTRAINT [FK_business_sub_business] FOREIGN KEY ( [id_business] ) REFERENCES [dbo].[business] ( [id_business] ) ON DELETE CASCADE ON UPDATE CASCADE GO ALTER TABLE [dbo].[regions] ADD CONSTRAINT [FK_regions_countries] FOREIGN KEY ( [id_country] ) REFERENCES [dbo].[countries] ( [id_country] ) ON DELETE CASCADE ON UPDATE CASCADE GO ALTER TABLE [dbo].[cities] ADD CONSTRAINT [FK_cities_city_types] FOREIGN KEY ( [id_city_type] ) REFERENCES [dbo].[city_types] ( [id_city_type] ) ON UPDATE CASCADE, CONSTRAINT [FK_cities_regions] FOREIGN KEY ( [id_region] ) REFERENCES [dbo].[regions] ( [id_region] ) ON DELETE CASCADE ON UPDATE CASCADE GO ALTER TABLE [dbo].[contacts] ADD CONSTRAINT [FK_contacts_accounts] FOREIGN KEY ( [id_account] ) REFERENCES [dbo].[accounts] ( [id_account] ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT [FK_contacts_cities] FOREIGN KEY ( [id_city] ) REFERENCES [dbo].[cities] ( [id_city] ) GO ALTER TABLE [dbo].[organizations] ADD CONSTRAINT [FK_organizations_accounts] FOREIGN KEY ( [id_account] ) REFERENCES [dbo].[accounts] ( [id_account] ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT [FK_organizations_cities] FOREIGN KEY ( [id_city] ) REFERENCES [dbo].[cities] ( [id_city] ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT [FK_organizations_owner_form_names] FOREIGN KEY ( [id_of] ) REFERENCES [dbo].[owner_form_names] ( [id_of] ) ON DELETE CASCADE ON UPDATE CASCADE GO ALTER TABLE [dbo].[contacts_address] ADD CONSTRAINT [FK_contacts_address_cities] FOREIGN KEY ( [id_city] ) REFERENCES [dbo].[cities] ( [id_city] ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT [FK_contacts_address_contacts] FOREIGN KEY ( [id_contact] ) REFERENCES [dbo].[contacts] ( [id_contact] ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT [FK_contacts_address_contacts_at] FOREIGN KEY ( [id_at] ) REFERENCES [dbo].[contacts_at] ( [id_at] ) ON DELETE CASCADE ON UPDATE CASCADE GO ALTER TABLE [dbo].[contacts_phones] ADD CONSTRAINT [FK_contacts_phones_contacts] FOREIGN KEY ( [id_contact] ) REFERENCES [dbo].[contacts] ( [id_contact] ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT [FK_contacts_phones_contacts_pt] FOREIGN KEY ( [id_pt] ) REFERENCES [dbo].[contacts_pt] ( [id_pt] ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT [FK_contacts_phones_countries] FOREIGN KEY ( [id_country] ) REFERENCES [dbo].[countries] ( [id_country] ) ON DELETE CASCADE ON UPDATE CASCADE GO ALTER TABLE [dbo].[organizations_subbusinesses] ADD CONSTRAINT [FK_organizations_subbusinesses_business_sub] FOREIGN KEY ( [id_subbusiness] ) REFERENCES [dbo].[business_sub] ( [id_subbusiness] ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT [FK_organizations_subbusinesses_organizations] FOREIGN KEY ( [id_organization] ) REFERENCES [dbo].[organizations] ( [id_organization] ) ON DELETE CASCADE ON UPDATE CASCADE GO ALTER TABLE [dbo].[price_groups] ADD CONSTRAINT [FK_price_groups_group_types] FOREIGN KEY ( [id_group_type] ) REFERENCES [dbo].[group_types] ( [id_group_type] ) ON UPDATE CASCADE, CONSTRAINT [FK_price_groups_organizations] FOREIGN KEY ( [id_organization] ) REFERENCES [dbo].[organizations] ( [id_organization] ) ON DELETE CASCADE ON UPDATE CASCADE GO ALTER TABLE [dbo].[prices] ADD CONSTRAINT [FK_prices_ed_izm] FOREIGN KEY ( [id_ed_izm] ) REFERENCES [dbo].[ed_izm] ( [id_ed_izm] ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT [FK_prices_guarantee] FOREIGN KEY ( [id_guarantee_type] ) REFERENCES [dbo].[guarantee] ( [id_guarantee_type] ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT [FK_prices_money_type] FOREIGN KEY ( [product_price_mt] ) REFERENCES [dbo].[money_type] ( [id_money_type] ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT [FK_prices_money_type1] FOREIGN KEY ( [product_price_melk_mt] ) REFERENCES [dbo].[money_type] ( [id_money_type] ), CONSTRAINT [FK_prices_money_type2] FOREIGN KEY ( [product_price_krupn_mt] ) REFERENCES [dbo].[money_type] ( [id_money_type] ), CONSTRAINT [FK_prices_organizations] FOREIGN KEY ( [id_organization] ) REFERENCES [dbo].[organizations] ( [id_organization] ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT [FK_prices_price_groups] FOREIGN KEY ( [id_price_group] ) REFERENCES [dbo].[price_groups] ( [id_price_group] ), CONSTRAINT [FK_prices_price_type] FOREIGN KEY ( [product_price_type] ) REFERENCES [dbo].[price_type] ( [id_price_type] ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT [FK_prices_price_type1] FOREIGN KEY ( [product_price_melk_type] ) REFERENCES [dbo].[price_type] ( [id_price_type] ), CONSTRAINT [FK_prices_price_type2] FOREIGN KEY ( [product_price_krupn_type] ) REFERENCES [dbo].[price_type] ( [id_price_type] ) GO alter table [dbo].[prices] nocheck constraint [FK_prices_price_groups] GO ALTER TABLE [dbo].[price_pictures] ADD CONSTRAINT [FK_price_pictures_prices] FOREIGN KEY ( [id_price] ) REFERENCES [dbo].[prices] ( [id_price] ) ON DELETE CASCADE ON UPDATE CASCADE GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO /****** Object: View dbo.sysconstraints Script Date: 15.01.2004 15:40:48 ******/ CREATE VIEW sysconstraints AS SELECT constid = convert(int, id), id = convert(int, parent_obj), colid = convert(smallint, info), spare1 = convert(tinyint, 0), status = convert(int, CASE xtype WHEN 'PK' THEN 1 WHEN 'UQ' THEN 2 WHEN 'F' THEN 3 WHEN 'C' THEN 4 WHEN 'D' THEN 5 ELSE 0 END + CASE WHEN info != 0 -- CNST_COLUMN / CNST_TABLE THEN (16) ELSE (32) END + CASE WHEN (status & 16)!=0 -- CNST_CLINDEX THEN (512) ELSE 0 END + CASE WHEN (status & 32)!=0 -- CNST_NCLINDEX THEN (1024) ELSE 0 END + (2048) -- CNST_NOTDEFERRABLE + CASE WHEN (status & 256)!=0 -- CNST_DISABLE THEN (16384) ELSE 0 END + CASE WHEN (status & 512)!=0 -- CNST_ENABLE THEN (32767) ELSE 0 END + CASE WHEN (status & 4)!=0 -- CNST_NONAME THEN (131072) ELSE 0 END + CASE WHEN (status & 1)!=0 -- CNST_NEW THEN (1048576) ELSE 0 END + CASE WHEN (status & 1024)!=0 -- CNST_REPL THEN (2097152) ELSE 0 END), actions = convert(int, 4096), error = convert(int, 0) FROM sysobjects WHERE xtype in ('C', 'F', 'PK', 'UQ', 'D') AND (status & 64) = 0 GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO /****** Object: View dbo.viewAccountOrganization Script Date: 15.01.2004 15:40:48 ******/ CREATE VIEW dbo.viewAccountOrganization AS SELECT dbo.accounts.id_account, dbo.accounts.username, dbo.accounts.password, dbo.organizations.id_organization FROM dbo.accounts INNER JOIN dbo.organizations ON dbo.accounts.id_account = dbo.organizations.id_account GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO /****** Object: View dbo.view_prices_full Script Date: 15.01.2004 15:40:49 ******/ CREATE VIEW dbo.view_prices_full AS SELECT dbo.prices.id_organization, dbo.prices.id_price_group, dbo.prices.product_name, dbo.prices.product_description, dbo.prices.product_price, dbo.prices.product_price_melk, dbo.prices.product_price_krupn, dbo.prices.product_price_mt, dbo.prices.product_price_melk_mt, dbo.prices.product_price_krupn_mt, dbo.prices.product_price_type, dbo.prices.product_price_melk_type, dbo.prices.product_price_krupn_type, dbo.prices.id_ed_izm, dbo.prices.guarantee_name, dbo.prices.id_guarantee_type, dbo.prices.dostavka, dbo.guarantee.guarantee_name AS guarantee_name_real, dbo.prices.id_price FROM dbo.prices LEFT OUTER JOIN dbo.guarantee ON dbo.prices.id_guarantee_type = dbo.guarantee.id_guarantee_type GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO /****** Object: View dbo.view_subbiz_organizations Script Date: 15.01.2004 15:40:49 ******/ CREATE VIEW dbo.view_subbiz_organizations AS SELECT dbo.organizations.id_organization, dbo.organizations.id_account, dbo.organizations_subbusinesses.id_subbusiness FROM dbo.organizations INNER JOIN dbo.organizations_subbusinesses ON dbo.organizations.id_organization = dbo.organizations_subbusinesses.id_organization GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO /****** Object: Stored Procedure dbo.GetRList Script Date: 15.01.2004 15:40:49 ******/ CREATE PROCEDURE GetRList @id_firm int, @rlist varchar(255) output AS BEGIN DECLARE @firm_count integer DECLARE @id_subbiz integer DECLARE rlist_cursor CURSOR FOR SELECT id_subbusiness FROM view_subbiz_organizations where id_organization = @id_firm set @rlist = '' open rlist_cursor FETCH NEXT FROM rlist_cursor into @id_subbiz WHILE (@@FETCH_STATUS <> -1) BEGIN set @rlist = @rlist + cast(@id_subbiz as varchar(10)) + ';

' FETCH NEXT FROM rlist_cursor into @id_subbiz END CLOSE rlist_cursor DEALLOCATE rlist_cursor print @rlist END GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO /****** Object: Trigger dbo.PriceGroupDelete Script Date: 15.01.2004 15:40:49 ******/ CREATE TRIGGER PriceGroupDelete ON [dbo].[price_groups] FOR DELETE AS delete from prices where id_price_group in (select id_price_group from deleted) GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'business', N'column', N'business_name' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'contacts_at', N'column', N'at_name' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'contacts_pt', N'column', N'pt_name' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'ed_izm', N'column', N'ez_izm_name' GO exec sp_addextendedproperty N'MS_Description', N' (, ...)', N'user', N'dbo', N'table', N'group_types', N'column', N'group_type_name' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'money_type', N'column', N'money_name' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'money_type', N'column', N'money_name_short' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'owner_form_names', N'column', N'of_name' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'price_type', N'column', N'price_type_name' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'business_sub', N'column', N'sb_name' GO exec sp_addextendedproperty N'MS_Description', N', ...', N'user', N'dbo', N'table', N'regions', N'column', N'region_name' GO exec sp_addextendedproperty N'MS_Description', N'...', N'user', N'dbo', N'table', N'cities', N'column', N'id_city' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'cities', N'column', N'id_city_type' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'contacts', N'column', N'birthday' GO exec sp_addextendedproperty N'MS_Description', N'', N'user', N'dbo', N'table', N'contacts', N'column', N'calling' GO exec sp_addextendedproperty N'MS_Description', N'', N'user', N'dbo', N'table', N'contacts', N'column', N'first_name' GO exec sp_addextendedproperty N'MS_Description', N'', N'user', N'dbo', N'table', N'contacts', N'column', N'godovshina' GO exec sp_addextendedproperty N'MS_Description', N'', N'user', N'dbo', N'table', N'contacts', N'column', N'id_city' GO exec sp_addextendedproperty N'MS_Description', N'', N'user', N'dbo', N'table', N'contacts', N'column', N'job' GO exec sp_addextendedproperty N'MS_Description', N'', N'user', N'dbo', N'table', N'contacts', N'column', N'laste_name' GO exec sp_addextendedproperty N'MS_Description', N'', N'user', N'dbo', N'table', N'contacts', N'column', N'middle_name' GO exec sp_addextendedproperty N'MS_Description', N'', N'user', N'dbo', N'table', N'contacts', N'column', N'organization' GO exec sp_addextendedproperty N'MS_Description', N'', N'user', N'dbo', N'table', N'contacts', N'column', N'otdel' GO exec sp_addextendedproperty N'MS_Description', N'', N'user', N'dbo', N'table', N'contacts', N'column', N'profession' GO exec sp_addextendedproperty N'MS_Description', N'', N'user', N'dbo', N'table', N'contacts', N'column', N'pseudonim' GO exec sp_addextendedproperty N'MS_Description', N'', N'user', N'dbo', N'table', N'contacts', N'column', N'room' GO exec sp_addextendedproperty N'MS_Description', N' ...', N'user', N'dbo', N'table', N'contacts', N'column', N'show_as' GO exec sp_addextendedproperty N'MS_Description', N'', N'user', N'dbo', N'table', N'contacts', N'column', N'street' GO exec sp_addextendedproperty N'MS_Description', N' - I, II, III, Jr...', N'user', N'dbo', N'table', N'contacts', N'column', N'suffix' GO exec sp_addextendedproperty N'MS_Description', N'()', N'user', N'dbo', N'table', N'contacts', N'column', N'wife' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'contacts', N'column', N'zip' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'organizations', N'column', N'id_of' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'contacts_address', N'column', N'id_at' GO exec sp_addextendedproperty N'MS_Description', N'', N'user', N'dbo', N'table', N'contacts_phones', N'column', N'zip' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'price_groups', N'column', N'group_title' GO exec sp_addextendedproperty N'MS_Description', N'1,2,10 , . .', N'user', N'dbo', N'table', N'prices', N'column', N'guarantee_name' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'prices', N'column', N'id_ed_izm' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'prices', N'column', N'product_description' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'prices', N'column', N'product_name' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'prices', N'column', N'product_price' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'prices', N'column', N'product_price_krupn' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'prices', N'column', N'product_price_krupn_mt' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'prices', N'column', N'product_price_krupn_type' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'prices', N'column', N'product_price_melk' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'prices', N'column', N'product_price_melk_mt' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'prices', N'column', N'product_price_melk_type' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'prices', N'column', N'product_price_mt' GO exec sp_addextendedproperty N'MS_Description', N' ', N'user', N'dbo', N'table', N'prices', N'column', N'product_price_type' GO exec sp_addextendedproperty N'MS_Description', N' ()', N'user', N'dbo', N'table', N'price_pictures', N'column', N'picture' GO - }

3

[ ] [

"> ] [

"> ] [ (Opera) ]

[

"> ] [

"> / ]

: 3

!!!
Can edit firm?

Editing Category... Editing PriceLine... :
:

3 if Session("new_user_error") then Session("new_user_error") = false Response.Write("
.
") else Response.Write("
.
") end if %>
3
2011 www.dissers.ru -

, .
, , , , 1-2 .