LOCOSOFT_import_Create.sql 103 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388
  1. USE [LOCOSOFT]
  2. GO
  3. CREATE SCHEMA import
  4. GO
  5. /****** Object: Table [import].[absence_calendar] Script Date: 02.10.2019 13:41:13 ******/
  6. SET ANSI_NULLS ON
  7. GO
  8. SET QUOTED_IDENTIFIER ON
  9. GO
  10. CREATE TABLE [import].[absence_calendar](
  11. [employee_number] [int] NOT NULL,
  12. [date] [datetime] NOT NULL,
  13. [unique_dummy] [int] NOT NULL,
  14. [type] [varchar](10) NULL,
  15. [is_payed] [smallint] NULL,
  16. [day_contingent] [numeric](4, 2) NULL,
  17. [reason] [varchar](10) NULL,
  18. [booking_flag] [varchar](10) NULL,
  19. CONSTRAINT [absence_calendar_temp_20180403051118_pkey] PRIMARY KEY CLUSTERED
  20. (
  21. [employee_number] ASC,
  22. [date] ASC,
  23. [unique_dummy] ASC
  24. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  25. ) ON [PRIMARY]
  26. GO
  27. /****** Object: Table [import].[absence_reasons] Script Date: 02.10.2019 13:41:13 ******/
  28. SET ANSI_NULLS ON
  29. GO
  30. SET QUOTED_IDENTIFIER ON
  31. GO
  32. CREATE TABLE [import].[absence_reasons](
  33. [id] [varchar](10) NOT NULL,
  34. [description] [varchar](50) NULL,
  35. [is_annual_vacation] [smallint] NULL,
  36. CONSTRAINT [absence_reasons_temp_20180403051147_pkey] PRIMARY KEY CLUSTERED
  37. (
  38. [id] ASC
  39. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  40. ) ON [PRIMARY]
  41. GO
  42. /****** Object: Table [import].[absence_types] Script Date: 02.10.2019 13:41:13 ******/
  43. SET ANSI_NULLS ON
  44. GO
  45. SET QUOTED_IDENTIFIER ON
  46. GO
  47. CREATE TABLE [import].[absence_types](
  48. [type] [varchar](10) NOT NULL,
  49. [description] [varchar](50) NULL,
  50. CONSTRAINT [absence_types_temp_20180403051149_pkey] PRIMARY KEY CLUSTERED
  51. (
  52. [type] ASC
  53. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  54. ) ON [PRIMARY]
  55. GO
  56. /****** Object: Table [import].[accounts_characteristics] Script Date: 02.10.2019 13:41:13 ******/
  57. SET ANSI_NULLS ON
  58. GO
  59. SET QUOTED_IDENTIFIER ON
  60. GO
  61. CREATE TABLE [import].[accounts_characteristics](
  62. [subsidiary_to_company_ref] [bigint] NOT NULL,
  63. [skr51_branch] [bigint] NOT NULL,
  64. [skr51_make] [bigint] NOT NULL,
  65. [skr51_cost_center] [bigint] NOT NULL,
  66. [skr51_sales_channel] [bigint] NOT NULL,
  67. [skr51_cost_unit] [bigint] NOT NULL,
  68. [skr51_brach_name] [varchar](50) NULL,
  69. [skr51_make_description] [varchar](50) NULL,
  70. [skr51_cost_center_name] [varchar](50) NULL,
  71. [skr51_sales_channel_name] [varchar](50) NULL,
  72. [skr51_cost_unit_name] [varchar](50) NULL,
  73. CONSTRAINT [accounts_characteristics_temp_20180403051152_pkey] PRIMARY KEY CLUSTERED
  74. (
  75. [subsidiary_to_company_ref] ASC,
  76. [skr51_branch] ASC,
  77. [skr51_make] ASC,
  78. [skr51_cost_center] ASC,
  79. [skr51_sales_channel] ASC,
  80. [skr51_cost_unit] ASC
  81. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  82. ) ON [PRIMARY]
  83. GO
  84. /****** Object: Table [import].[charge_type_descriptions] Script Date: 02.10.2019 13:41:13 ******/
  85. SET ANSI_NULLS ON
  86. GO
  87. SET QUOTED_IDENTIFIER ON
  88. GO
  89. CREATE TABLE [import].[charge_type_descriptions](
  90. [type] [int] NOT NULL,
  91. [description] [varchar](100) NULL,
  92. CONSTRAINT [charge_type_descriptions_temp_20180403051215_pkey] PRIMARY KEY CLUSTERED
  93. (
  94. [type] ASC
  95. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  96. ) ON [PRIMARY]
  97. GO
  98. /****** Object: Table [import].[charge_types] Script Date: 02.10.2019 13:41:13 ******/
  99. SET ANSI_NULLS ON
  100. GO
  101. SET QUOTED_IDENTIFIER ON
  102. GO
  103. CREATE TABLE [import].[charge_types](
  104. [type] [int] NOT NULL,
  105. [subsidiary] [int] NOT NULL,
  106. [timeunit_rate] [numeric](9, 3) NULL,
  107. [department] [int] NULL,
  108. CONSTRAINT [charge_types_temp_20180403051210_pkey] PRIMARY KEY CLUSTERED
  109. (
  110. [type] ASC,
  111. [subsidiary] ASC
  112. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  113. ) ON [PRIMARY]
  114. GO
  115. /****** Object: Table [import].[clearing_delay_types] Script Date: 02.10.2019 13:41:13 ******/
  116. SET ANSI_NULLS ON
  117. GO
  118. SET QUOTED_IDENTIFIER ON
  119. GO
  120. CREATE TABLE [import].[clearing_delay_types](
  121. [type] [varchar](10) NOT NULL,
  122. [description] [varchar](50) NULL,
  123. CONSTRAINT [clearing_delay_types_temp_20180403051217_pkey] PRIMARY KEY CLUSTERED
  124. (
  125. [type] ASC
  126. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  127. ) ON [PRIMARY]
  128. GO
  129. /****** Object: Table [import].[codes_vehicle_date] Script Date: 02.10.2019 13:41:13 ******/
  130. SET ANSI_NULLS ON
  131. GO
  132. SET QUOTED_IDENTIFIER ON
  133. GO
  134. CREATE TABLE [import].[codes_vehicle_date](
  135. [vehicle_number] [int] NOT NULL,
  136. [code] [varchar](10) NOT NULL,
  137. [date] [datetime] NULL,
  138. CONSTRAINT [pk_codes_vehicle_date] PRIMARY KEY CLUSTERED
  139. (
  140. [vehicle_number] ASC,
  141. [code] ASC
  142. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  143. ) ON [PRIMARY]
  144. GO
  145. /****** Object: Table [import].[codes_vehicle_date_def] Script Date: 02.10.2019 13:41:13 ******/
  146. SET ANSI_NULLS ON
  147. GO
  148. SET QUOTED_IDENTIFIER ON
  149. GO
  150. CREATE TABLE [import].[codes_vehicle_date_def](
  151. [code] [varchar](10) NOT NULL,
  152. [is_defined_by_dms] [varchar](10) NULL,
  153. [month_increase_factor] [int] NULL,
  154. [show_in_211_from_or_to] [varchar](10) NULL,
  155. [is_backdate_on_exceeding] [varchar](10) NULL,
  156. [description] [varchar](100) NULL,
  157. CONSTRAINT [pk_codes_vehicle_date_def] PRIMARY KEY CLUSTERED
  158. (
  159. [code] ASC
  160. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  161. ) ON [PRIMARY]
  162. GO
  163. /****** Object: Table [import].[codes_vehicle_def] Script Date: 02.10.2019 13:41:13 ******/
  164. SET ANSI_NULLS ON
  165. GO
  166. SET QUOTED_IDENTIFIER ON
  167. GO
  168. CREATE TABLE [import].[codes_vehicle_def](
  169. [code] [varchar](10) NOT NULL,
  170. [is_defined_by_dms] [varchar](10) NULL,
  171. [format] [varchar](10) NULL,
  172. [length] [int] NULL,
  173. [decimal] [int] NULL,
  174. [description] [varchar](100) NULL,
  175. CONSTRAINT [pk_codes_vehicle_def] PRIMARY KEY CLUSTERED
  176. (
  177. [code] ASC
  178. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  179. ) ON [PRIMARY]
  180. GO
  181. /****** Object: Table [import].[codes_vehicle_list] Script Date: 02.10.2019 13:41:13 ******/
  182. SET ANSI_NULLS ON
  183. GO
  184. SET QUOTED_IDENTIFIER ON
  185. GO
  186. CREATE TABLE [import].[codes_vehicle_list](
  187. [vehicle_number] [int] NOT NULL,
  188. [code] [varchar](10) NOT NULL,
  189. [value_format] [varchar](10) NULL,
  190. [value_text] [varchar](100) NULL,
  191. [value_numeric] [numeric](18, 9) NULL,
  192. [value_date] [datetime] NULL,
  193. CONSTRAINT [pk_codes_vehicle_list] PRIMARY KEY CLUSTERED
  194. (
  195. [vehicle_number] ASC,
  196. [code] ASC
  197. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  198. ) ON [PRIMARY]
  199. GO
  200. /****** Object: Table [import].[codes_vehicle_mileage] Script Date: 02.10.2019 13:41:13 ******/
  201. SET ANSI_NULLS ON
  202. GO
  203. SET QUOTED_IDENTIFIER ON
  204. GO
  205. CREATE TABLE [import].[codes_vehicle_mileage](
  206. [vehicle_number] [int] NOT NULL,
  207. [code] [varchar](10) NOT NULL,
  208. [kilometer] [int] NULL,
  209. CONSTRAINT [pk_codes_vehicle_mileage] PRIMARY KEY CLUSTERED
  210. (
  211. [vehicle_number] ASC,
  212. [code] ASC
  213. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  214. ) ON [PRIMARY]
  215. GO
  216. /****** Object: Table [import].[codes_vehicle_mileage_def] Script Date: 02.10.2019 13:41:13 ******/
  217. SET ANSI_NULLS ON
  218. GO
  219. SET QUOTED_IDENTIFIER ON
  220. GO
  221. CREATE TABLE [import].[codes_vehicle_mileage_def](
  222. [code] [varchar](10) NOT NULL,
  223. [is_defined_by_dms] [varchar](10) NULL,
  224. [mileage_increase_factor] [int] NULL,
  225. [show_in_211_from_or_to] [varchar](10) NULL,
  226. [description] [varchar](100) NULL,
  227. CONSTRAINT [pk_codes_vehicle_mileage_def] PRIMARY KEY CLUSTERED
  228. (
  229. [code] ASC
  230. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  231. ) ON [PRIMARY]
  232. GO
  233. /****** Object: Table [import].[com_number_types] Script Date: 02.10.2019 13:41:13 ******/
  234. SET ANSI_NULLS ON
  235. GO
  236. SET QUOTED_IDENTIFIER ON
  237. GO
  238. CREATE TABLE [import].[com_number_types](
  239. [typ] [varchar](10) NOT NULL,
  240. [description] [varchar](50) NULL,
  241. [is_office_number] [smallint] NULL,
  242. CONSTRAINT [com_number_types_temp_20180403051220_pkey] PRIMARY KEY CLUSTERED
  243. (
  244. [typ] ASC
  245. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  246. ) ON [PRIMARY]
  247. GO
  248. /****** Object: Table [import].[customer_codes] Script Date: 02.10.2019 13:41:13 ******/
  249. SET ANSI_NULLS ON
  250. GO
  251. SET QUOTED_IDENTIFIER ON
  252. GO
  253. CREATE TABLE [import].[customer_codes](
  254. [code] [int] NOT NULL,
  255. [description] [varchar](50) NULL,
  256. CONSTRAINT [customer_codes_temp_20180403051844_pkey] PRIMARY KEY CLUSTERED
  257. (
  258. [code] ASC
  259. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  260. ) ON [PRIMARY]
  261. GO
  262. /****** Object: Table [import].[customer_com_numbers] Script Date: 02.10.2019 13:41:13 ******/
  263. SET ANSI_NULLS ON
  264. GO
  265. SET QUOTED_IDENTIFIER ON
  266. GO
  267. CREATE TABLE [import].[customer_com_numbers](
  268. [customer_number] [int] NOT NULL,
  269. [counter] [bigint] NOT NULL,
  270. [com_type] [varchar](10) NULL,
  271. [is_reference] [smallint] NULL,
  272. [only_on_1st_tab] [smallint] NULL,
  273. [address] [varchar](100) NULL,
  274. [has_contact_person_fields] [smallint] NULL,
  275. [contact_salutation] [varchar](50) NULL,
  276. [contact_firstname] [varchar](100) NULL,
  277. [contact_lastname] [varchar](100) NULL,
  278. [contact_description] [varchar](100) NULL,
  279. [note] [varchar](100) NULL,
  280. CONSTRAINT [customer_com_numbers_temp_20180403051846_pkey] PRIMARY KEY CLUSTERED
  281. (
  282. [customer_number] ASC,
  283. [counter] ASC
  284. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  285. ) ON [PRIMARY]
  286. GO
  287. /****** Object: Table [import].[customer_to_customercodes] Script Date: 02.10.2019 13:41:13 ******/
  288. SET ANSI_NULLS ON
  289. GO
  290. SET QUOTED_IDENTIFIER ON
  291. GO
  292. CREATE TABLE [import].[customer_to_customercodes](
  293. [customer_number] [int] NOT NULL,
  294. [customer_code] [int] NOT NULL,
  295. CONSTRAINT [customer_to_customercodes_temp_20180403052118_pkey] PRIMARY KEY CLUSTERED
  296. (
  297. [customer_number] ASC,
  298. [customer_code] ASC
  299. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  300. ) ON [PRIMARY]
  301. GO
  302. /****** Object: Table [import].[customers_suppliers] Script Date: 02.10.2019 13:41:13 ******/
  303. SET ANSI_NULLS ON
  304. GO
  305. SET QUOTED_IDENTIFIER ON
  306. GO
  307. CREATE TABLE [import].[customers_suppliers](
  308. [customer_number] [int] NOT NULL,
  309. [subsidiary] [int] NULL,
  310. [is_supplier] [smallint] NULL,
  311. [is_natural_person] [smallint] NULL,
  312. [is_dummy_customer] [smallint] NULL,
  313. [salutation_code] [varchar](50) NULL,
  314. [name_prefix] [varchar](50) NULL,
  315. [first_name] [varchar](50) NULL,
  316. [family_name] [varchar](50) NULL,
  317. [name_postfix] [varchar](50) NULL,
  318. [country_code] [varchar](10) NULL,
  319. [zip_code] [varchar](50) NULL,
  320. [home_city] [varchar](50) NULL,
  321. [home_street] [varchar](50) NULL,
  322. [parts_rebate_group_buy] [int] NULL,
  323. [parts_rebate_group_sell] [int] NULL,
  324. [rebate_labour_percent] [numeric](9, 5) NULL,
  325. [rebate_material_percent] [numeric](9, 5) NULL,
  326. [rebate_new_vehicles_percent] [numeric](9, 5) NULL,
  327. [cash_discount_percent] [numeric](9, 5) NULL,
  328. [vat_id_number] [varchar](50) NULL,
  329. [vat_id_number_checked_date] [datetime] NULL,
  330. [vat_id_free_code_1] [int] NULL,
  331. [vat_id_free_code_2] [int] NULL,
  332. [birthday] [datetime] NULL,
  333. [last_contact] [datetime] NULL,
  334. [preferred_com_number_type] [varchar](10) NULL,
  335. [created_date] [datetime] NULL,
  336. [created_employee_no] [int] NULL,
  337. [updated_date] [datetime] NULL,
  338. [updated_employee_no] [int] NULL,
  339. [name_updated_date] [datetime] NULL,
  340. [name_updated_employee_no] [int] NULL,
  341. CONSTRAINT [customers_suppliers_temp_20180403051222_pkey] PRIMARY KEY CLUSTERED
  342. (
  343. [customer_number] ASC
  344. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  345. ) ON [PRIMARY]
  346. GO
  347. /****** Object: Table [import].[dealer_vehicles] Script Date: 02.10.2019 13:41:13 ******/
  348. SET ANSI_NULLS ON
  349. GO
  350. SET QUOTED_IDENTIFIER ON
  351. GO
  352. CREATE TABLE [import].[dealer_vehicles](
  353. [dealer_vehicle_type] [varchar](10) NOT NULL,
  354. [dealer_vehicle_number] [int] NOT NULL,
  355. [vehicle_number] [int] NULL,
  356. [location] [varchar](50) NULL,
  357. [buyer_customer_no] [int] NULL,
  358. [deregistration_date] [datetime] NULL,
  359. [refinancing_start_date] [datetime] NULL,
  360. [refinancing_end_date] [datetime] NULL,
  361. [refinancing_value] [numeric](9, 2) NULL,
  362. [refinancing_refundment] [numeric](9, 2) NULL,
  363. [refinancing_bank_customer_no] [int] NULL,
  364. [refinanc_interest_free_date] [datetime] NULL,
  365. [in_subsidiary] [int] NULL,
  366. [in_buy_salesman_number] [int] NULL,
  367. [in_buy_order_no] [varchar](50) NULL,
  368. [in_buy_order_no_date] [datetime] NULL,
  369. [in_buy_invoice_no] [varchar](50) NULL,
  370. [in_buy_invoice_no_date] [datetime] NULL,
  371. [in_buy_edp_order_no] [varchar](50) NULL,
  372. [in_buy_edp_order_no_date] [datetime] NULL,
  373. [in_opel_production_no] [varchar](50) NULL,
  374. [in_is_trade_in_ken] [varchar](10) NULL,
  375. [in_is_trade_in_kom] [int] NULL,
  376. [in_used_vehicle_buy_type] [varchar](10) NULL,
  377. [in_buy_list_price] [numeric](9, 2) NULL,
  378. [in_arrival_date] [datetime] NULL,
  379. [in_expected_arrival_date] [datetime] NULL,
  380. [in_accounting_document_type] [varchar](10) NULL,
  381. [in_accounting_document_number] [int] NULL,
  382. [in_accounting_document_date] [datetime] NULL,
  383. [in_acntg_exceptional_group] [varchar](10) NULL,
  384. [in_acntg_cost_unit_new_vehicle] [numeric](2, 0) NULL,
  385. [in_accounting_make] [numeric](2, 0) NULL,
  386. [in_registration_reference] [varchar](50) NULL,
  387. [in_expected_repair_cost] [numeric](9, 2) NULL,
  388. [in_order_status] [varchar](10) NULL,
  389. [out_subsidiary] [int] NULL,
  390. [out_is_ready_for_sale] [varchar](10) NULL,
  391. [out_ready_for_sale_date] [datetime] NULL,
  392. [out_sale_type] [varchar](10) NULL,
  393. [out_sales_contract_number] [int] NULL,
  394. [out_sales_contract_date] [datetime] NULL,
  395. [out_is_sales_contract_confrmed] [varchar](10) NULL,
  396. [out_salesman_number_1] [int] NULL,
  397. [out_salesman_number_2] [int] NULL,
  398. [out_desired_shipment_date] [datetime] NULL,
  399. [out_is_registration_included] [varchar](10) NULL,
  400. [out_recommended_retail_price] [numeric](9, 2) NULL,
  401. [out_extra_expenses] [numeric](9, 2) NULL,
  402. [out_sale_price] [numeric](9, 2) NULL,
  403. [out_sale_price_dealer] [numeric](9, 2) NULL,
  404. [out_sale_price_minimum] [numeric](9, 2) NULL,
  405. [out_sale_price_internet] [numeric](9, 2) NULL,
  406. [out_estimated_invoice_value] [numeric](9, 2) NULL,
  407. [out_discount_percent_vehicle] [numeric](9, 5) NULL,
  408. [out_discount_percent_accessory] [numeric](9, 5) NULL,
  409. [out_order_number] [int] NULL,
  410. [out_invoice_type] [int] NULL,
  411. [out_invoice_number] [int] NULL,
  412. [out_invoice_date] [datetime] NULL,
  413. [out_deposit_invoice_type] [int] NULL,
  414. [out_deposit_invoice_number] [int] NULL,
  415. [out_deposit_value] [numeric](9, 2) NULL,
  416. [out_license_plate] [varchar](50) NULL,
  417. [out_make_number] [int] NULL,
  418. [out_model_code] [varchar](50) NULL,
  419. [out_license_plate_country] [varchar](50) NULL,
  420. [out_license_plate_season] [varchar](50) NULL,
  421. [calc_basic_charge] [numeric](9, 2) NULL,
  422. [calc_accessory] [numeric](9, 2) NULL,
  423. [calc_extra_expenses] [numeric](9, 2) NULL,
  424. [calc_usage_value_encr_external] [numeric](9, 2) NULL,
  425. [calc_usage_value_encr_internal] [numeric](9, 2) NULL,
  426. [calc_usage_value_encr_other] [numeric](9, 2) NULL,
  427. [calc_total_writedown] [numeric](9, 2) NULL,
  428. [calc_cost_percent_stockingdays] [numeric](3, 0) NULL,
  429. [calc_interest_percent_stkdays] [numeric](6, 3) NULL,
  430. [calc_actual_payed_interest] [numeric](9, 2) NULL,
  431. [calc_commission_for_arranging] [numeric](9, 2) NULL,
  432. [calc_commission_for_salesman] [numeric](9, 2) NULL,
  433. [calc_cost_internal_invoices] [numeric](9, 2) NULL,
  434. [calc_cost_other] [numeric](9, 2) NULL,
  435. [calc_sales_aid] [numeric](9, 2) NULL,
  436. [calc_sales_aid_finish] [numeric](9, 2) NULL,
  437. [calc_sales_aid_bonus] [numeric](9, 2) NULL,
  438. [calc_returns_workshop] [numeric](9, 2) NULL,
  439. [exclusive_reserved_employee_no] [int] NULL,
  440. [exclusive_reserved_until] [datetime] NULL,
  441. [pre_owned_car_code] [varchar](10) NULL,
  442. [is_sale_internet] [varchar](10) NULL,
  443. [is_sale_prohibit] [varchar](10) NULL,
  444. [is_agency_business] [varchar](10) NULL,
  445. [is_rental_or_school_vehicle] [varchar](10) NULL,
  446. [previous_owner_number] [int] NULL,
  447. [mileage_km] [int] NULL,
  448. [mileage_miles] [int] NULL,
  449. [memo] [varchar](255) NULL,
  450. [keys_box_number] [int] NULL,
  451. [last_change_date] [datetime] NULL,
  452. [last_change_employee_no] [int] NULL,
  453. [created_date] [datetime] NULL,
  454. [created_employee_no] [int] NULL,
  455. [financing_example_ref] [int] NULL,
  456. [leasing_example_ref] [int] NULL,
  457. CONSTRAINT [pk_dealer_vehicles] PRIMARY KEY CLUSTERED
  458. (
  459. [dealer_vehicle_type] ASC,
  460. [dealer_vehicle_number] ASC
  461. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  462. ) ON [PRIMARY]
  463. GO
  464. /****** Object: Table [import].[document_types] Script Date: 02.10.2019 13:41:13 ******/
  465. SET ANSI_NULLS ON
  466. GO
  467. SET QUOTED_IDENTIFIER ON
  468. GO
  469. CREATE TABLE [import].[document_types](
  470. [document_type_in_journal] [varchar](255) NOT NULL,
  471. [document_type_description] [varchar](255) NULL,
  472. CONSTRAINT [document_types_temp_20180403052123_pkey] PRIMARY KEY CLUSTERED
  473. (
  474. [document_type_in_journal] ASC
  475. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  476. ) ON [PRIMARY]
  477. GO
  478. /****** Object: Table [import].[employees] Script Date: 02.10.2019 13:41:13 ******/
  479. SET ANSI_NULLS ON
  480. GO
  481. SET QUOTED_IDENTIFIER ON
  482. GO
  483. CREATE TABLE [import].[employees](
  484. [employee_number] [int] NOT NULL,
  485. [validity_date] [datetime] NULL,
  486. [is_latest_record] [smallint] NULL,
  487. [subsidiary] [int] NULL,
  488. [has_constant_salary] [smallint] NULL,
  489. [name] [varchar](50) NULL,
  490. [initials] [varchar](10) NULL,
  491. [customer_number] [int] NULL,
  492. [mechanic_number] [int] NULL,
  493. [salesman_number] [int] NULL,
  494. [is_business_executive] [smallint] NULL,
  495. [is_master_craftsman] [smallint] NULL,
  496. [employment_date] [datetime] NULL,
  497. [termination_date] [datetime] NULL,
  498. [leave_date] [datetime] NULL,
  499. [is_flextime] [smallint] NULL,
  500. [break_time_registration] [varchar](10) NULL,
  501. [productivity_factor] [decimal](2,1),
  502. CONSTRAINT [employees_temp_20180403052145624678_pkey] PRIMARY KEY CLUSTERED
  503. (
  504. [employee_number] ASC
  505. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  506. ) ON [PRIMARY]
  507. GO
  508. /****** Object: Table [import].[employees_breaktimes] Script Date: 02.10.2019 13:41:13 ******/
  509. SET ANSI_NULLS ON
  510. GO
  511. SET QUOTED_IDENTIFIER ON
  512. GO
  513. CREATE TABLE [import].[employees_breaktimes](
  514. [is_latest_record] [smallint] NULL,
  515. [employee_number] [int] NOT NULL,
  516. [validity_date] [datetime] NOT NULL,
  517. [dayofweek] [int] NOT NULL,
  518. [break_start] [decimal](6, 3) NOT NULL,
  519. [break_end] [decimal](6, 3) NULL,
  520. CONSTRAINT [employees_breaktimes_temp_20180403052126_pkey] PRIMARY KEY CLUSTERED
  521. (
  522. [employee_number] ASC,
  523. [validity_date] ASC,
  524. [dayofweek] ASC,
  525. [break_start] ASC
  526. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  527. ) ON [PRIMARY]
  528. GO
  529. /****** Object: Table [import].[employees_history] Script Date: 02.10.2019 13:41:14 ******/
  530. SET ANSI_NULLS ON
  531. GO
  532. SET QUOTED_IDENTIFIER ON
  533. GO
  534. CREATE TABLE [import].[employees_history](
  535. [employee_number] [int] NOT NULL,
  536. [validity_date] [datetime] NOT NULL,
  537. [is_latest_record] [smallint] NULL,
  538. [subsidiary] [int] NULL,
  539. [has_constant_salary] [smallint] NULL,
  540. [name] [varchar](50) NULL,
  541. [initials] [varchar](10) NULL,
  542. [customer_number] [int] NULL,
  543. [mechanic_number] [int] NULL,
  544. [salesman_number] [int] NULL,
  545. [is_business_executive] [smallint] NULL,
  546. [is_master_craftsman] [smallint] NULL,
  547. [employment_date] [datetime] NULL,
  548. [termination_date] [datetime] NULL,
  549. [leave_date] [datetime] NULL,
  550. [is_flextime] [smallint] NULL,
  551. [break_time_registration] [varchar](10) NULL,
  552. [productivity_factor] [decimal](2,1),
  553. CONSTRAINT [employees_history_temp_20180403052128_pkey] PRIMARY KEY CLUSTERED
  554. (
  555. [employee_number] ASC,
  556. [validity_date] ASC
  557. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  558. ) ON [PRIMARY]
  559. GO
  560. /****** Object: Table [import].[employees_worktimes] Script Date: 02.10.2019 13:41:14 ******/
  561. SET ANSI_NULLS ON
  562. GO
  563. SET QUOTED_IDENTIFIER ON
  564. GO
  565. CREATE TABLE [import].[employees_worktimes](
  566. [is_latest_record] [smallint] NULL,
  567. [employee_number] [int] NOT NULL,
  568. [validity_date] [datetime] NOT NULL,
  569. [dayofweek] [int] NOT NULL,
  570. [work_duration] [decimal](6, 3) NULL,
  571. [worktime_start] [decimal](6, 3) NULL,
  572. [worktime_end] [decimal](6, 3) NULL,
  573. CONSTRAINT [employees_worktimes_temp_20180403052130_pkey] PRIMARY KEY CLUSTERED
  574. (
  575. [employee_number] ASC,
  576. [validity_date] ASC,
  577. [dayofweek] ASC
  578. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  579. ) ON [PRIMARY]
  580. GO
  581. /****** Object: Table [import].[fuels] Script Date: 02.10.2019 13:41:14 ******/
  582. SET ANSI_NULLS ON
  583. GO
  584. SET QUOTED_IDENTIFIER ON
  585. GO
  586. CREATE TABLE [import].[fuels](
  587. [code] [varchar](10) NOT NULL,
  588. [description] [varchar](255) NULL,
  589. CONSTRAINT [fuels_temp_20180403052131_pkey] PRIMARY KEY CLUSTERED
  590. (
  591. [code] ASC
  592. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  593. ) ON [PRIMARY]
  594. GO
  595. /****** Object: Table [import].[invoice_types] Script Date: 02.10.2019 13:41:14 ******/
  596. SET ANSI_NULLS ON
  597. GO
  598. SET QUOTED_IDENTIFIER ON
  599. GO
  600. CREATE TABLE [import].[invoice_types](
  601. [type] [int] NOT NULL,
  602. [description] [varchar](255) NULL,
  603. CONSTRAINT [invoice_types_temp_20180403052756_pkey] PRIMARY KEY CLUSTERED
  604. (
  605. [type] ASC
  606. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  607. ) ON [PRIMARY]
  608. GO
  609. /****** Object: Table [import].[invoices] Script Date: 02.10.2019 13:41:14 ******/
  610. SET ANSI_NULLS ON
  611. GO
  612. SET QUOTED_IDENTIFIER ON
  613. GO
  614. CREATE TABLE [import].[invoices](
  615. [invoice_type] [int] NOT NULL,
  616. [invoice_number] [int] NOT NULL,
  617. [subsidiary] [int] NULL,
  618. [order_number] [int] NULL,
  619. [paying_customer] [int] NULL,
  620. [order_customer] [int] NULL,
  621. [invoice_date] [datetime] NULL,
  622. [service_date] [datetime] NULL,
  623. [is_canceled] [smallint] NULL,
  624. [cancelation_number] [int] NULL,
  625. [cancelation_date] [datetime] NULL,
  626. [cancelation_employee] [int] NULL,
  627. [is_own_vehicle] [smallint] NULL,
  628. [is_credit] [smallint] NULL,
  629. [credit_invoice_type] [int] NULL,
  630. [credit_invoice_number] [int] NULL,
  631. [odometer_reading] [int] NULL,
  632. [creating_employee] [int] NULL,
  633. [internal_cost_account] [int] NULL,
  634. [vehicle_number] [int] NULL,
  635. [full_vat_basevalue] [numeric](9, 2) NULL,
  636. [full_vat_percentage] [numeric](4, 2) NULL,
  637. [full_vat_value] [numeric](18, 2) NULL,
  638. [reduced_vat_basevalue] [numeric](9, 2) NULL,
  639. [reduced_vat_percentage] [numeric](4, 2) NULL,
  640. [reduced_vat_value] [numeric](18, 2) NULL,
  641. [used_part_vat_value] [numeric](9, 2) NULL,
  642. [job_amount_net] [numeric](18, 2) NULL,
  643. [job_amount_gross] [numeric](18, 2) NULL,
  644. [job_rebate] [numeric](9, 2) NULL,
  645. [part_amount_net] [numeric](18, 2) NULL,
  646. [part_amount_gross] [numeric](18, 2) NULL,
  647. [part_rebate] [numeric](9, 2) NULL,
  648. [part_disposal] [numeric](9, 2) NULL,
  649. [total_gross] [numeric](18, 2) NULL,
  650. [total_net] [numeric](18, 2) NULL,
  651. CONSTRAINT [invoices_temp_20180403052133_pkey] PRIMARY KEY CLUSTERED
  652. (
  653. [invoice_type] ASC,
  654. [invoice_number] ASC
  655. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  656. ) ON [PRIMARY]
  657. GO
  658. /****** Object: Table [import].[journal_accountings] Script Date: 02.10.2019 13:41:14 ******/
  659. SET ANSI_NULLS ON
  660. GO
  661. SET QUOTED_IDENTIFIER ON
  662. GO
  663. CREATE TABLE [import].[journal_accountings](
  664. [accounting_date] [datetime] NOT NULL,
  665. [document_type] [varchar](255) NOT NULL,
  666. [document_number] [bigint] NOT NULL,
  667. [position_in_document] [bigint] NOT NULL,
  668. [customer_number] [bigint] NULL,
  669. [nominal_account_number] [bigint] NULL,
  670. [is_balanced] [varchar](10) NULL,
  671. [clearing_number] [bigint] NULL,
  672. [document_date] [datetime] NULL,
  673. [posted_value] [bigint] NULL,
  674. [debit_or_credit] [varchar](10) NULL,
  675. [posted_count] [bigint] NULL,
  676. [branch_number] [bigint] NULL,
  677. [customer_contra_account] [bigint] NULL,
  678. [nominal_contra_account] [bigint] NULL,
  679. [contra_account_text] [varchar](50) NULL,
  680. [account_form_page_number] [bigint] NULL,
  681. [account_form_page_line] [bigint] NULL,
  682. [serial_number_each_month] [bigint] NULL,
  683. [employee_number] [bigint] NULL,
  684. [invoice_date] [varchar](50) NULL,
  685. [invoice_number] [varchar](50) NULL,
  686. [dunning_level] [varchar](50) NULL,
  687. [last_dunning_date] [varchar](50) NULL,
  688. [journal_page] [bigint] NULL,
  689. [journal_line] [bigint] NULL,
  690. [cash_discount] [bigint] NULL,
  691. [term_of_payment] [bigint] NULL,
  692. [posting_text] [varchar](100) NULL,
  693. [vehicle_reference] [varchar](50) NULL,
  694. [vat_id_number] [varchar](50) NULL,
  695. [account_statement_number] [bigint] NULL,
  696. [account_statement_page] [bigint] NULL,
  697. [vat_key] [varchar](50) NULL,
  698. [days_for_cash_discount] [bigint] NULL,
  699. [day_of_actual_accounting] [datetime] NULL,
  700. [skr51_branch] [bigint] NULL,
  701. [skr51_make] [bigint] NULL,
  702. [skr51_cost_center] [bigint] NULL,
  703. [skr51_sales_channel] [bigint] NULL,
  704. [skr51_cost_unit] [bigint] NULL,
  705. [previously_used_account_no] [varchar](50) NULL,
  706. [free_form_accounting_text] [varchar](255) NULL,
  707. [free_form_document_text] [varchar](255) NULL,
  708. CONSTRAINT [journal_accountings_import_20180403120809_pkey] PRIMARY KEY CLUSTERED
  709. (
  710. [accounting_date] ASC,
  711. [document_type] ASC,
  712. [document_number] ASC,
  713. [position_in_document] ASC
  714. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  715. ) ON [PRIMARY]
  716. GO
  717. /****** Object: Table [import].[labour_types] Script Date: 02.10.2019 13:41:14 ******/
  718. SET ANSI_NULLS ON
  719. GO
  720. SET QUOTED_IDENTIFIER ON
  721. GO
  722. CREATE TABLE [import].[labour_types](
  723. [code] [varchar](10) NOT NULL,
  724. [description] [varchar](255) NULL,
  725. CONSTRAINT [labour_types_temp_20180403071554_pkey] PRIMARY KEY CLUSTERED
  726. (
  727. [code] ASC
  728. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  729. ) ON [PRIMARY]
  730. GO
  731. /****** Object: Table [import].[labours] Script Date: 02.10.2019 13:41:14 ******/
  732. SET ANSI_NULLS ON
  733. GO
  734. SET QUOTED_IDENTIFIER ON
  735. GO
  736. CREATE TABLE [import].[labours](
  737. [order_number] [int] NOT NULL,
  738. [order_position] [int] NOT NULL,
  739. [order_position_line] [int] NOT NULL,
  740. [subsidiary] [int] NULL,
  741. [is_invoiced] [smallint] NULL,
  742. [invoice_type] [int] NULL,
  743. [invoice_number] [int] NULL,
  744. [employee_no] [int] NULL,
  745. [mechanic_no] [int] NULL,
  746. [labour_operation_id] [varchar](50) NULL,
  747. [is_nominal] [smallint] NULL,
  748. [time_units] [varchar](50) NULL,
  749. [net_price_in_order] [numeric](9, 2) NULL,
  750. [rebate_percent] [numeric](4, 2) NULL,
  751. [goodwill_percent] [numeric](4, 1) NULL,
  752. [charge_type] [int] NOT NULL,
  753. [text_line] [varchar](100) NULL,
  754. [usage_value] [decimal](9,2),
  755. CONSTRAINT [labours_temp_20180403070609_pkey] PRIMARY KEY CLUSTERED
  756. (
  757. [order_number] ASC,
  758. [order_position] ASC,
  759. [order_position_line] ASC,
  760. [charge_type] ASC
  761. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  762. ) ON [PRIMARY]
  763. GO
  764. /****** Object: Table [import].[makes] Script Date: 02.10.2019 13:41:14 ******/
  765. SET ANSI_NULLS ON
  766. GO
  767. SET QUOTED_IDENTIFIER ON
  768. GO
  769. CREATE TABLE [import].[makes](
  770. [make_number] [int] NOT NULL,
  771. [is_actual_make] [smallint] NULL,
  772. [description] [varchar](255) NULL,
  773. [group_name] [varchar](10) NULL,
  774. [make_id_in_group] [varchar](10) NULL,
  775. [internal_labour_group] [int] NULL,
  776. [is_production_year_visible] [smallint] NULL,
  777. [is_transmission_no_visible] [smallint] NULL,
  778. [is_engine_no_visible] [smallint] NULL,
  779. [is_ricambi_no_visible] [smallint] NULL,
  780. [ricambi_label] [varchar](50) NULL,
  781. [is_preset_finance_stock_rate] [smallint] NULL,
  782. [rate_free_days_new_vehicle] [int] NULL,
  783. [rate_free_days_demo_vehicle] [int] NULL,
  784. [special_service_2_interval] [numeric](4, 1) NULL,
  785. [special_service_3_interval] [numeric](4, 1) NULL,
  786. CONSTRAINT [makes_temp_20180403071556_pkey] PRIMARY KEY CLUSTERED
  787. (
  788. [make_number] ASC
  789. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  790. ) ON [PRIMARY]
  791. GO
  792. /****** Object: Table [import].[model_to_fuels] Script Date: 02.10.2019 13:41:14 ******/
  793. SET ANSI_NULLS ON
  794. GO
  795. SET QUOTED_IDENTIFIER ON
  796. GO
  797. CREATE TABLE [import].[model_to_fuels](
  798. [make_number] [int] NOT NULL,
  799. [model_code] [varchar](50) NOT NULL,
  800. [code] [varchar](10) NOT NULL,
  801. CONSTRAINT [model_to_fuels_temp_20180403072157_pkey] PRIMARY KEY CLUSTERED
  802. (
  803. [make_number] ASC,
  804. [model_code] ASC,
  805. [code] ASC
  806. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  807. ) ON [PRIMARY]
  808. GO
  809. /****** Object: Table [import].[models] Script Date: 02.10.2019 13:41:14 ******/
  810. SET ANSI_NULLS ON
  811. GO
  812. SET QUOTED_IDENTIFIER ON
  813. GO
  814. CREATE TABLE [import].[models](
  815. [make_number] [int] NOT NULL,
  816. [model_code] [varchar](50) NOT NULL,
  817. [is_actual_model] [smallint] NULL,
  818. [model_currently_available] [smallint] NULL,
  819. [replacing_model_code] [varchar](50) NULL,
  820. [description] [varchar](255) NULL,
  821. [gear_count] [int] NULL,
  822. [seat_count] [int] NULL,
  823. [door_count] [int] NULL,
  824. [cylinder_count] [int] NULL,
  825. [vehicle_body] [varchar](10) NULL,
  826. [model_labour_group] [varchar](10) NULL,
  827. [has_hour_meter] [smallint] NULL,
  828. [source_extern] [smallint] NULL,
  829. [free_form_vehicle_class] [varchar](10) NULL,
  830. [vin_begin] [varchar](50) NULL,
  831. [vehicle_pool_code] [varchar](50) NULL,
  832. [vehicle_pool_engine_code] [varchar](10) NULL,
  833. [is_manual_transmission] [smallint] NULL,
  834. [is_all_wheel_drive] [smallint] NULL,
  835. [is_plugin_hybride] [smallint] NULL,
  836. [unloaded_weight] [int] NULL,
  837. [gross_vehicle_weight] [int] NULL,
  838. [power_kw] [int] NULL,
  839. [power_kw_at_rotation] [int] NULL,
  840. [cubic_capacity] [int] NULL,
  841. [german_kba_hsn] [varchar](10) NULL,
  842. [german_kba_tsn] [varchar](50) NULL,
  843. [annual_tax] [numeric](9, 2) NULL,
  844. [model_year] [varchar](50) NULL,
  845. [model_year_postfix] [varchar](10) NULL,
  846. [suggested_net_retail_price] [numeric](9, 2) NULL,
  847. [suggested_net_shipping_cost] [numeric](9, 2) NULL,
  848. [european_pollutant_class] [varchar](10) NULL,
  849. [efficiency_class] [varchar](10) NULL,
  850. [emission_code] [varchar](10) NULL,
  851. [carbondioxid_emission] [int] NULL,
  852. [nox_exhoust] [numeric](4, 3) NULL,
  853. [particle_exhoust] [numeric](4, 3) NULL,
  854. [external_schwacke_code] [varchar](50) NULL,
  855. [skr_carrier_flag] [int] NULL,
  856. [free_form_model_specification] [varchar](10) NULL,
  857. [external_technical_type] [varchar](10) NULL,
  858. [european_fuel_consumption_over] [numeric](4, 2) NULL,
  859. [european_fuel_consumption_coun] [numeric](4, 2) NULL,
  860. [european_fuel_consumption_city] [numeric](4, 2) NULL,
  861. [energy_consumption] [varchar](50) NULL,
  862. [insurance_class_liability] [int] NULL,
  863. [insurance_class_part_comprehen] [int] NULL,
  864. [insurance_class_full_comprehen] [int] NULL,
  865. CONSTRAINT [models_temp_20180403071559_pkey] PRIMARY KEY CLUSTERED
  866. (
  867. [make_number] ASC,
  868. [model_code] ASC
  869. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  870. ) ON [PRIMARY]
  871. GO
  872. /****** Object: Table [import].[nominal_accounts] Script Date: 02.10.2019 13:41:14 ******/
  873. SET ANSI_NULLS ON
  874. GO
  875. SET QUOTED_IDENTIFIER ON
  876. GO
  877. CREATE TABLE [import].[nominal_accounts](
  878. [subsidiary_to_company_ref] [bigint] NOT NULL,
  879. [nominal_account_number] [bigint] NOT NULL,
  880. [account_description] [varchar](255) NULL,
  881. [is_profit_loss_account] [varchar](255) NULL,
  882. [vat_key] [varchar](255) NULL,
  883. [create_date] [datetime] NULL,
  884. [create_employee_number] [bigint] NULL,
  885. [oldest_accountable_month] [datetime] NULL,
  886. CONSTRAINT [nominal_accounts_temp_20180403072205_pkey] PRIMARY KEY CLUSTERED
  887. (
  888. [nominal_account_number] ASC,
  889. [subsidiary_to_company_ref] ASC
  890. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  891. ) ON [PRIMARY]
  892. GO
  893. /****** Object: Table [import].[order_positions] Script Date: 02.10.2019 13:41:14 ******/
  894. SET ANSI_NULLS ON
  895. GO
  896. SET QUOTED_IDENTIFIER ON
  897. GO
  898. CREATE TABLE [import].[order_positions](
  899. [order_number] [int] NOT NULL,
  900. [order_position] [int] NOT NULL,
  901. [labour_type] [varchar](10) NULL,
  902. [subsidiary] [int] NULL,
  903. [is_invoiced] [smallint] NULL,
  904. [invoice_type] [int] NULL,
  905. [invoice_number] [int] NULL,
  906. [order_date] [datetime] NULL,
  907. [estimated_inbound_time] [datetime] NULL,
  908. [estimated_outbound_time] [datetime] NULL,
  909. [order_print_date] [datetime] NULL,
  910. [order_taking_employee_no] [int] NULL,
  911. [order_delivery_employee_no] [int] NULL,
  912. [vehicle_number] [int] NULL,
  913. [dealer_vehicle_type] [varchar](10),
  914. [dealer_vehicle_number] [int],
  915. [order_mileage] [int] NULL,
  916. [order_customer] [int] NULL,
  917. [paying_customer] [int] NULL,
  918. [holder_number] [int] NULL,
  919. [parts_rebate_group_sell] [int] NULL,
  920. [clearing_delay_type] [varchar](10) NULL,
  921. CONSTRAINT [order_positions_temp_20180403072206_pkey] PRIMARY KEY CLUSTERED
  922. (
  923. [order_number] ASC,
  924. [order_position] ASC
  925. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  926. ) ON [PRIMARY]
  927. GO
  928. /****** Object: Table [import].[part_types] Script Date: 02.10.2019 13:41:14 ******/
  929. SET ANSI_NULLS ON
  930. GO
  931. SET QUOTED_IDENTIFIER ON
  932. GO
  933. CREATE TABLE [import].[part_types](
  934. [type] [int] NOT NULL,
  935. [description] [varchar](50) NULL,
  936. CONSTRAINT [part_types_temp_20180403073033_pkey] PRIMARY KEY CLUSTERED
  937. (
  938. [type] ASC
  939. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  940. ) ON [PRIMARY]
  941. GO
  942. /****** Object: Table [import].[parts] Script Date: 02.10.2019 13:41:14 ******/
  943. SET ANSI_NULLS ON
  944. GO
  945. SET QUOTED_IDENTIFIER ON
  946. GO
  947. CREATE TABLE [import].[parts](
  948. [order_number] [int] NOT NULL,
  949. [order_position] [int] NOT NULL,
  950. [order_position_line] [int] NOT NULL,
  951. [subsidiary] [int] NULL,
  952. [is_invoiced] [smallint] NULL,
  953. [invoice_type] [int] NULL,
  954. [invoice_number] [int] NULL,
  955. [employee_no] [int] NULL,
  956. [mechanic_no] [int] NULL,
  957. [part_number] [varchar](50) NULL,
  958. [stock_no] [int] NULL,
  959. [stock_removal_date] [datetime] NULL,
  960. [amount] [numeric](9, 2) NULL,
  961. [sum] [numeric](9, 2) NULL,
  962. [rebate_percent] [numeric](4, 2) NULL,
  963. [goodwill_percent] [numeric](4, 1) NULL,
  964. [parts_type] [int] NULL,
  965. [text_line] [varchar](50) NULL,
  966. [usage_value] [decimal](9,2),
  967. CONSTRAINT [parts_temp_20180403072452_pkey] PRIMARY KEY CLUSTERED
  968. (
  969. [order_number] ASC,
  970. [order_position] ASC,
  971. [order_position_line] ASC
  972. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  973. ) ON [PRIMARY]
  974. GO
  975. /****** Object: Table [import].[parts_rebate_groups_buy] Script Date: 02.10.2019 13:41:14 ******/
  976. SET ANSI_NULLS ON
  977. GO
  978. SET QUOTED_IDENTIFIER ON
  979. GO
  980. CREATE TABLE [import].[parts_rebate_groups_buy](
  981. [code] [int] NOT NULL,
  982. [description] [varchar](50) NULL,
  983. CONSTRAINT [parts_rebate_groups_buy_temp_20180403073031_pkey] PRIMARY KEY CLUSTERED
  984. (
  985. [code] ASC
  986. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  987. ) ON [PRIMARY]
  988. GO
  989. /****** Object: Table [import].[parts_rebate_groups_sell] Script Date: 02.10.2019 13:41:14 ******/
  990. SET ANSI_NULLS ON
  991. GO
  992. SET QUOTED_IDENTIFIER ON
  993. GO
  994. CREATE TABLE [import].[parts_rebate_groups_sell](
  995. [code] [int] NOT NULL,
  996. [description] [varchar](50) NULL,
  997. CONSTRAINT [parts_rebate_groups_sell_temp_20180403073032_pkey] PRIMARY KEY CLUSTERED
  998. (
  999. [code] ASC
  1000. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  1001. ) ON [PRIMARY]
  1002. GO
  1003. /****** Object: Table [import].[time_types] Script Date: 02.10.2019 13:41:14 ******/
  1004. SET ANSI_NULLS ON
  1005. GO
  1006. SET QUOTED_IDENTIFIER ON
  1007. GO
  1008. CREATE TABLE [import].[time_types](
  1009. [type] [int] NOT NULL,
  1010. [description] [varchar](50) NULL,
  1011. CONSTRAINT [time_types_temp_20180403073113_pkey] PRIMARY KEY CLUSTERED
  1012. (
  1013. [type] ASC
  1014. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  1015. ) ON [PRIMARY]
  1016. GO
  1017. /****** Object: Table [import].[times] Script Date: 02.10.2019 13:41:14 ******/
  1018. SET ANSI_NULLS ON
  1019. GO
  1020. SET QUOTED_IDENTIFIER ON
  1021. GO
  1022. CREATE TABLE [import].[times](
  1023. [employee_number] [int] NOT NULL,
  1024. [order_number] [int] NOT NULL,
  1025. [start_time] [datetime] NOT NULL,
  1026. [type] [int] NULL,
  1027. [order_positions] [varchar](10) NOT NULL,
  1028. [end_time] [datetime] NULL,
  1029. [duration_minutes] [int] NULL,
  1030. [exact_duration_seconds] [bigint] NULL,
  1031. CONSTRAINT [times_temp_20180403073035_pkey] PRIMARY KEY CLUSTERED
  1032. (
  1033. [employee_number] ASC,
  1034. [order_number] ASC,
  1035. [start_time] ASC,
  1036. [order_positions] ASC
  1037. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  1038. ) ON [PRIMARY]
  1039. GO
  1040. /****** Object: Table [import].[vat_keys] Script Date: 02.10.2019 13:41:14 ******/
  1041. SET ANSI_NULLS ON
  1042. GO
  1043. SET QUOTED_IDENTIFIER ON
  1044. GO
  1045. CREATE TABLE [import].[vat_keys](
  1046. [subsidiary_to_company_ref] [bigint] NOT NULL,
  1047. [vat_key] [varchar](255) NOT NULL,
  1048. [key_validity_date] [datetime] NULL,
  1049. [branch] [bigint] NULL,
  1050. [description] [varchar](255) NULL,
  1051. [vat_rate] [bigint] NULL,
  1052. [create_date] [datetime] NULL,
  1053. [vat_account] [bigint] NULL,
  1054. [advanced_turnover_tax_pos] [bigint] NULL,
  1055. CONSTRAINT [vat_keys_temp_20180403073114_pkey] PRIMARY KEY CLUSTERED
  1056. (
  1057. [vat_key] ASC,
  1058. [subsidiary_to_company_ref] ASC
  1059. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  1060. ) ON [PRIMARY]
  1061. GO
  1062. /****** Object: Table [import].[vehicle_bodys] Script Date: 02.10.2019 13:41:14 ******/
  1063. SET ANSI_NULLS ON
  1064. GO
  1065. SET QUOTED_IDENTIFIER ON
  1066. GO
  1067. CREATE TABLE [import].[vehicle_bodys](
  1068. [code] [varchar](10) NOT NULL,
  1069. [description] [varchar](255) NULL,
  1070. CONSTRAINT [vehicle_bodys_temp_20180403073935_pkey] PRIMARY KEY CLUSTERED
  1071. (
  1072. [code] ASC
  1073. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  1074. ) ON [PRIMARY]
  1075. GO
  1076. /****** Object: Table [import].[vehicle_buy_types] Script Date: 02.10.2019 13:41:14 ******/
  1077. SET ANSI_NULLS ON
  1078. GO
  1079. SET QUOTED_IDENTIFIER ON
  1080. GO
  1081. CREATE TABLE [import].[vehicle_buy_types](
  1082. [code] [varchar](10) NOT NULL,
  1083. [description] [varchar](100) NULL,
  1084. CONSTRAINT [pk_vehicle_buy_types] PRIMARY KEY CLUSTERED
  1085. (
  1086. [code] ASC
  1087. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  1088. ) ON [PRIMARY]
  1089. GO
  1090. /****** Object: Table [import].[vehicle_pre_owned_codes] Script Date: 02.10.2019 13:41:14 ******/
  1091. SET ANSI_NULLS ON
  1092. GO
  1093. SET QUOTED_IDENTIFIER ON
  1094. GO
  1095. CREATE TABLE [import].[vehicle_pre_owned_codes](
  1096. [code] [varchar](10) NOT NULL,
  1097. [description] [varchar](100) NULL,
  1098. CONSTRAINT [pk_vehicle_pre_owned_codes] PRIMARY KEY CLUSTERED
  1099. (
  1100. [code] ASC
  1101. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  1102. ) ON [PRIMARY]
  1103. GO
  1104. /****** Object: Table [import].[vehicle_sale_types] Script Date: 02.10.2019 13:41:14 ******/
  1105. SET ANSI_NULLS ON
  1106. GO
  1107. SET QUOTED_IDENTIFIER ON
  1108. GO
  1109. CREATE TABLE [import].[vehicle_sale_types](
  1110. [code] [varchar](10) NOT NULL,
  1111. [description] [varchar](100) NULL,
  1112. CONSTRAINT [pk_vehicle_sale_types] PRIMARY KEY CLUSTERED
  1113. (
  1114. [code] ASC
  1115. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  1116. ) ON [PRIMARY]
  1117. GO
  1118. /****** Object: Table [import].[vehicles] Script Date: 02.10.2019 13:41:14 ******/
  1119. SET ANSI_NULLS ON
  1120. GO
  1121. SET QUOTED_IDENTIFIER ON
  1122. GO
  1123. CREATE TABLE [import].[vehicles](
  1124. [internal_number] [int] NOT NULL,
  1125. [vin] [varchar](50) NULL,
  1126. [license_plate] [varchar](50) NULL,
  1127. [license_plate_country] [varchar](10) NULL,
  1128. [license_plate_season] [varchar](10) NULL,
  1129. [make_number] [int] NULL,
  1130. [free_form_make_text] [varchar](10) NULL,
  1131. [model_code] [varchar](50) NULL,
  1132. [free_form_model_text] [varchar](50) NULL,
  1133. [is_roadworthy] [smallint] NULL,
  1134. [is_customer_vehicle] [smallint] NULL,
  1135. [dealer_vehicle_type] [varchar](10) NULL,
  1136. [dealer_vehicle_number] [int] NULL,
  1137. [first_registration_date] [varchar](50) NULL,
  1138. [readmission_date] [datetime] NULL,
  1139. [next_service_date] [datetime] NULL,
  1140. [next_service_km] [int] NULL,
  1141. [next_service_miles] [int] NULL,
  1142. [production_year] [varchar](50) NULL,
  1143. [owner_number] [int] NULL,
  1144. [holder_number] [int] NULL,
  1145. [previous_owner_number] [int] NULL,
  1146. [previous_owner_counter] [int] NULL,
  1147. [last_holder_change_date] [datetime] NULL,
  1148. [german_kba_hsn] [varchar](10) NULL,
  1149. [german_kba_tsn] [varchar](50) NULL,
  1150. [austria_nat_code] [varchar](50) NULL,
  1151. [is_prefer_km] [smallint] NULL,
  1152. [mileage_km] [int] NULL,
  1153. [mileage_miles] [int] NULL,
  1154. [odometer_reading_date] [datetime] NULL,
  1155. [engine_number] [varchar](50) NULL,
  1156. [gear_number] [varchar](50) NULL,
  1157. [unloaded_weight] [int] NULL,
  1158. [gross_vehicle_weight] [int] NULL,
  1159. [power_kw] [int] NULL,
  1160. [cubic_capacity] [int] NULL,
  1161. [is_all_accidents_repaired] [smallint] NULL,
  1162. [accidents_counter] [int] NULL,
  1163. [has_tyre_pressure_sensor] [smallint] NULL,
  1164. [carkey_number] [varchar](50) NULL,
  1165. [internal_source_flag] [varchar](10) NULL,
  1166. [emission_code] [varchar](10) NULL,
  1167. [first_sold_country] [varchar](10) NULL,
  1168. [first_sold_dealer_code] [int] NULL,
  1169. [body_paint_code] [varchar](50) NULL,
  1170. [body_paint_description] [varchar](50) NULL,
  1171. [is_body_paint_metallic] [smallint] NULL,
  1172. [interior_paint_code] [varchar](50) NULL,
  1173. [interior_paint_description] [varchar](50) NULL,
  1174. [trim_code] [varchar](50) NULL,
  1175. [trim_description] [varchar](50) NULL,
  1176. [fine_dust_label] [varchar](10) NULL,
  1177. [internal_assignment] [varchar](10) NULL,
  1178. [ricambi_free_input] [varchar](50) NULL,
  1179. [document_number] [varchar](10) NULL,
  1180. [salesman_number] [int] NULL,
  1181. [sale_date] [varchar](50) NULL,
  1182. [next_emission_test_date] [datetime] NULL,
  1183. [next_general_inspection_date] [datetime] NULL,
  1184. [next_rust_inspection_date] [datetime] NULL,
  1185. [next_exceptional_inspection_da] [datetime] NULL,
  1186. [last_change_date] [datetime] NULL,
  1187. [last_change_employee_no] [int] NULL,
  1188. [created_date] [datetime] NULL,
  1189. [created_employee_no] [int] NULL,
  1190. [last_change_subsidiary] [int] NULL,
  1191. CONSTRAINT [vehicles_temp_20180403073115_pkey] PRIMARY KEY CLUSTERED
  1192. (
  1193. [internal_number] ASC
  1194. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  1195. ) ON [PRIMARY]
  1196. GO
  1197. /****** Object: Table [import].[year_calendar] Script Date: 02.10.2019 13:41:15 ******/
  1198. SET ANSI_NULLS ON
  1199. GO
  1200. SET QUOTED_IDENTIFIER ON
  1201. GO
  1202. CREATE TABLE [import].[year_calendar](
  1203. [calendar_id] [int] NOT NULL,
  1204. [date] [datetime] NOT NULL,
  1205. [day_off_declaration] [int] NULL,
  1206. [is_school_holid] [smallint] NULL,
  1207. [is_public_holid] [smallint] NULL,
  1208. [day_note] [varchar](50) NULL,
  1209. CONSTRAINT [year_calendar_temp_20180403073936_pkey] PRIMARY KEY CLUSTERED
  1210. (
  1211. [calendar_id] ASC,
  1212. [date] ASC
  1213. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  1214. ) ON [PRIMARY]
  1215. GO
  1216. /****** Object: Table [import].[year_calendar_day_off_codes] Script Date: 02.10.2019 13:41:15 ******/
  1217. SET ANSI_NULLS ON
  1218. GO
  1219. SET QUOTED_IDENTIFIER ON
  1220. GO
  1221. CREATE TABLE [import].[year_calendar_day_off_codes](
  1222. [code] [int] NOT NULL,
  1223. [description] [varchar](50) NULL,
  1224. CONSTRAINT [year_calendar_day_off_codes_temp_20180403073938_pkey] PRIMARY KEY CLUSTERED
  1225. (
  1226. [code] ASC
  1227. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  1228. ) ON [PRIMARY]
  1229. GO
  1230. /****** Object: Table [import].[year_calendar_subsidiary_mapping] Script Date: 02.10.2019 13:41:15 ******/
  1231. SET ANSI_NULLS ON
  1232. GO
  1233. SET QUOTED_IDENTIFIER ON
  1234. GO
  1235. CREATE TABLE [import].[year_calendar_subsidiary_mapping](
  1236. [subsidiary] [int] NOT NULL,
  1237. [year] [int] NOT NULL,
  1238. [calendar_id] [int] NULL,
  1239. CONSTRAINT [year_calendar_subsidiary_mapping_temp_20180403073940_pkey] PRIMARY KEY CLUSTERED
  1240. (
  1241. [subsidiary] ASC,
  1242. [year] ASC
  1243. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  1244. ) ON [PRIMARY]
  1245. GO
  1246. ALTER TABLE [import].[absence_calendar] ADD DEFAULT ('0') FOR [employee_number]
  1247. GO
  1248. ALTER TABLE [import].[absence_calendar] ADD DEFAULT ('0000-00-00') FOR [date]
  1249. GO
  1250. ALTER TABLE [import].[absence_calendar] ADD DEFAULT ('0') FOR [unique_dummy]
  1251. GO
  1252. ALTER TABLE [import].[absence_reasons] ADD DEFAULT ('') FOR [id]
  1253. GO
  1254. ALTER TABLE [import].[absence_types] ADD DEFAULT ('') FOR [type]
  1255. GO
  1256. ALTER TABLE [import].[accounts_characteristics] ADD DEFAULT ('0') FOR [skr51_branch]
  1257. GO
  1258. ALTER TABLE [import].[accounts_characteristics] ADD DEFAULT ('0') FOR [skr51_make]
  1259. GO
  1260. ALTER TABLE [import].[accounts_characteristics] ADD DEFAULT ('0') FOR [skr51_cost_center]
  1261. GO
  1262. ALTER TABLE [import].[accounts_characteristics] ADD DEFAULT ('0') FOR [skr51_sales_channel]
  1263. GO
  1264. ALTER TABLE [import].[accounts_characteristics] ADD DEFAULT ('0') FOR [skr51_cost_unit]
  1265. GO
  1266. ALTER TABLE [import].[charge_type_descriptions] ADD DEFAULT ('0') FOR [type]
  1267. GO
  1268. ALTER TABLE [import].[charge_types] ADD DEFAULT ('0') FOR [type]
  1269. GO
  1270. ALTER TABLE [import].[charge_types] ADD DEFAULT ('0') FOR [subsidiary]
  1271. GO
  1272. ALTER TABLE [import].[clearing_delay_types] ADD DEFAULT ('') FOR [type]
  1273. GO
  1274. ALTER TABLE [import].[com_number_types] ADD CONSTRAINT [DF__com_number___typ__412EB0B6] DEFAULT ('') FOR [typ]
  1275. GO
  1276. ALTER TABLE [import].[customer_codes] ADD DEFAULT ('0') FOR [code]
  1277. GO
  1278. ALTER TABLE [import].[customer_com_numbers] ADD DEFAULT ('0') FOR [customer_number]
  1279. GO
  1280. ALTER TABLE [import].[customer_com_numbers] ADD DEFAULT ('0') FOR [counter]
  1281. GO
  1282. ALTER TABLE [import].[customer_to_customercodes] ADD DEFAULT ('0') FOR [customer_number]
  1283. GO
  1284. ALTER TABLE [import].[customer_to_customercodes] ADD DEFAULT ('0') FOR [customer_code]
  1285. GO
  1286. ALTER TABLE [import].[customers_suppliers] ADD CONSTRAINT [DF__customers__custo__7CCECB3B] DEFAULT ('0') FOR [customer_number]
  1287. GO
  1288. ALTER TABLE [import].[document_types] ADD DEFAULT ('') FOR [document_type_in_journal]
  1289. GO
  1290. ALTER TABLE [import].[employees] ADD DEFAULT ('0') FOR [employee_number]
  1291. GO
  1292. ALTER TABLE [import].[employees_history] ADD DEFAULT ('0') FOR [employee_number]
  1293. GO
  1294. ALTER TABLE [import].[employees_history] ADD DEFAULT ('0000-00-00') FOR [validity_date]
  1295. GO
  1296. ALTER TABLE [import].[fuels] ADD DEFAULT ('') FOR [code]
  1297. GO
  1298. ALTER TABLE [import].[invoice_types] ADD DEFAULT ('0') FOR [type]
  1299. GO
  1300. ALTER TABLE [import].[invoices] ADD DEFAULT ('0') FOR [invoice_type]
  1301. GO
  1302. ALTER TABLE [import].[invoices] ADD DEFAULT ('0') FOR [invoice_number]
  1303. GO
  1304. ALTER TABLE [import].[journal_accountings] ADD CONSTRAINT [DF__journal_a__accou__4C6B5938] DEFAULT ('2010-01-01 00:00:00') FOR [accounting_date]
  1305. GO
  1306. ALTER TABLE [import].[journal_accountings] ADD CONSTRAINT [DF__journal_a__docum__4D5F7D71] DEFAULT ('') FOR [document_type]
  1307. GO
  1308. ALTER TABLE [import].[journal_accountings] ADD CONSTRAINT [DF__journal_a__docum__4E53A1AA] DEFAULT ('0') FOR [document_number]
  1309. GO
  1310. ALTER TABLE [import].[journal_accountings] ADD CONSTRAINT [DF__journal_a__posit__4F47C5E3] DEFAULT ('0') FOR [position_in_document]
  1311. GO
  1312. ALTER TABLE [import].[labour_types] ADD CONSTRAINT [DF__labour_typ__code__74AE54BC] DEFAULT ('') FOR [code]
  1313. GO
  1314. ALTER TABLE [import].[labours] ADD DEFAULT ('0') FOR [order_number]
  1315. GO
  1316. ALTER TABLE [import].[labours] ADD DEFAULT ('0') FOR [order_position]
  1317. GO
  1318. ALTER TABLE [import].[labours] ADD DEFAULT ('0') FOR [order_position_line]
  1319. GO
  1320. ALTER TABLE [import].[labours] ADD DEFAULT ('0') FOR [charge_type]
  1321. GO
  1322. ALTER TABLE [import].[makes] ADD DEFAULT ('0') FOR [make_number]
  1323. GO
  1324. ALTER TABLE [import].[model_to_fuels] ADD DEFAULT ('0') FOR [make_number]
  1325. GO
  1326. ALTER TABLE [import].[model_to_fuels] ADD DEFAULT ('') FOR [model_code]
  1327. GO
  1328. ALTER TABLE [import].[model_to_fuels] ADD DEFAULT ('') FOR [code]
  1329. GO
  1330. ALTER TABLE [import].[models] ADD DEFAULT ('0') FOR [make_number]
  1331. GO
  1332. ALTER TABLE [import].[models] ADD DEFAULT ('') FOR [model_code]
  1333. GO
  1334. ALTER TABLE [import].[nominal_accounts] ADD CONSTRAINT [DF_nominal_accounts_subsidiary_to_company_ref] DEFAULT ((0)) FOR [subsidiary_to_company_ref]
  1335. GO
  1336. ALTER TABLE [import].[nominal_accounts] ADD CONSTRAINT [DF__nominal_a__nomin__13B23093] DEFAULT ('0') FOR [nominal_account_number]
  1337. GO
  1338. ALTER TABLE [import].[order_positions] ADD CONSTRAINT [DF__order_pos__order__14270015] DEFAULT ('0') FOR [order_number]
  1339. GO
  1340. ALTER TABLE [import].[order_positions] ADD CONSTRAINT [DF__order_pos__order__151B244E] DEFAULT ('0') FOR [order_position]
  1341. GO
  1342. ALTER TABLE [import].[part_types] ADD DEFAULT ('0') FOR [type]
  1343. GO
  1344. ALTER TABLE [import].[parts] ADD DEFAULT ('0') FOR [order_number]
  1345. GO
  1346. ALTER TABLE [import].[parts] ADD DEFAULT ('0') FOR [order_position]
  1347. GO
  1348. ALTER TABLE [import].[parts] ADD DEFAULT ('0') FOR [order_position_line]
  1349. GO
  1350. ALTER TABLE [import].[parts_rebate_groups_buy] ADD DEFAULT ('0') FOR [code]
  1351. GO
  1352. ALTER TABLE [import].[parts_rebate_groups_sell] ADD DEFAULT ('0') FOR [code]
  1353. GO
  1354. ALTER TABLE [import].[time_types] ADD DEFAULT ('0') FOR [type]
  1355. GO
  1356. ALTER TABLE [import].[times] ADD DEFAULT ('0') FOR [employee_number]
  1357. GO
  1358. ALTER TABLE [import].[times] ADD DEFAULT ('0') FOR [order_number]
  1359. GO
  1360. ALTER TABLE [import].[times] ADD DEFAULT ('0') FOR [start_time]
  1361. GO
  1362. ALTER TABLE [import].[times] ADD DEFAULT ('') FOR [order_positions]
  1363. GO
  1364. ALTER TABLE [import].[vat_keys] ADD CONSTRAINT [DF_vat_keys_subsidiary_to_company_ref] DEFAULT ((0)) FOR [subsidiary_to_company_ref]
  1365. GO
  1366. ALTER TABLE [import].[vat_keys] ADD CONSTRAINT [DF__vat_keys__vat_ke__210C2BB1] DEFAULT ('') FOR [vat_key]
  1367. GO
  1368. ALTER TABLE [import].[vehicle_bodys] ADD DEFAULT ('') FOR [code]
  1369. GO
  1370. ALTER TABLE [import].[vehicles] ADD CONSTRAINT [DF__vehicles__intern__3864608B] DEFAULT ('0') FOR [internal_number]
  1371. GO
  1372. ALTER TABLE [import].[year_calendar] ADD DEFAULT ('0') FOR [calendar_id]
  1373. GO
  1374. ALTER TABLE [import].[year_calendar] ADD DEFAULT ('0000-00-00') FOR [date]
  1375. GO
  1376. ALTER TABLE [import].[year_calendar_day_off_codes] ADD DEFAULT ('0') FOR [code]
  1377. GO
  1378. ALTER TABLE [import].[year_calendar_subsidiary_mapping] ADD DEFAULT ('0') FOR [subsidiary]
  1379. GO
  1380. ALTER TABLE [import].[year_calendar_subsidiary_mapping] ADD DEFAULT ('0') FOR [year]
  1381. GO