-- Description: SQL script to insert Consignor Default Data -- -- Creation Date: 06.10.2006 -- Created By: Tellef Ormstad -- -- Updated Date: 06.11.2006 -- Updated By: Tellef Ormstad -- -- Application: C:\Source\WTO\Exe\CreateDefaultDataScript.exe -- Source Database: Provider=SQLOLEDB.1;Password=$edi$;Persist Security Info=True;User ID=SA;Initial Catalog=consignor;Data Source=consignorserver -- Compatibility: MS SQL Server 2005 -- -- NOTE! Steps in this script should be handeled in code! USE [Consignor] GO ------------------------------------------ -- Installation ------------------------------------------ INSERT INTO Installation(ins_Key,ins_Value,ins_Description,ins_Created,ins_Updated) VALUES('InstallationID','','Installation Identificator',GETDATE(),GETDATE()) INSERT INTO Installation(ins_Key,ins_Value,ins_Description,ins_Created,ins_Updated) VALUES('DatabaseVersion','1.0.0','Database Version',GETDATE(),GETDATE()) GO ------------------------------------------ -- ReportFormat ------------------------------------------ INSERT INTO ReportFormat(ref_ID, ref_Description,ref_Report_Extention,ref_datetime) VALUES(0, 'Unknown','Unk.',GETDATE()) INSERT INTO ReportFormat(ref_ID, ref_Description,ref_Report_Extention,ref_datetime) VALUES(1,'Text File','TXT',GETDATE()) INSERT INTO ReportFormat(ref_ID, ref_Description,ref_Report_Extention,ref_datetime) VALUES(2,'XML Document','XML',GETDATE()) INSERT INTO ReportFormat(ref_ID, ref_Description,ref_Report_Extention,ref_datetime) VALUES(3,'Rich Text Format','RTF',GETDATE()) INSERT INTO ReportFormat(ref_ID, ref_Description,ref_Report_Extention,ref_datetime) VALUES(4,'PDF Document','PDF',GETDATE()) INSERT INTO ReportFormat(ref_ID, ref_Description,ref_Report_Extention,ref_datetime) VALUES(5,'EDI File','EDI',GETDATE()) INSERT INTO ReportFormat(ref_ID, ref_Description,ref_Report_Extention,ref_datetime) VALUES(6,'Excel Document','XLS',GETDATE()) INSERT INTO ReportFormat(ref_ID, ref_Description,ref_Report_Extention,ref_datetime) VALUES(7,'HTML Document','HTML',GETDATE()) INSERT INTO ReportFormat(ref_ID, ref_Description,ref_Report_Extention,ref_datetime) VALUES(8,'Word Document','DOC',GETDATE()) GO ------------------------------------------ -- CustomerListType ------------------------------------------ insert into CustomerListType (clt_type, clt_name) values (1, 'Global') insert into CustomerListType (clt_type, clt_name) values (2, 'Location') insert into CustomerListType (clt_type, clt_name) values (3, 'Actor') GO ------------------------------------------ -- Counter ------------------------------------------ dbcc checkident (Counter, reseed, 2); GO INSERT INTO Counter(cot_Name,cot_Description,cot_Min,cot_Max,cot_NextToUse,cot_Wrap,cot_WarningLow,cot_WarningHigh,cot_CreatedBy,cot_CreatedTime,cot_Updatedby,cot_UpdatedTime,cot_EANCustNo,cot_System, cot_HTTPNotificationSent, cot_ConceptId) VALUES('FileName','File Name',1000,9999,1000,1,0,0,'Install',GETDATE(),'Install',GETDATE(),'',1, 0,100) INSERT INTO Counter(cot_Name,cot_Description,cot_Min,cot_Max,cot_NextToUse,cot_Wrap,cot_WarningLow,cot_WarningHigh,cot_CreatedBy,cot_CreatedTime,cot_Updatedby,cot_UpdatedTime,cot_EANCustNo,cot_System, cot_HTTPNotificationSent, cot_ConceptId) VALUES('FreightDocPrinter','Freight Doc Printer Num',2,9999,1,0,0,9000,'Install',GETDATE(),'Install',GETDATE(),'',1, 0,101) INSERT INTO Counter(cot_Name,cot_Description,cot_Min,cot_Max,cot_NextToUse,cot_Wrap,cot_WarningLow,cot_WarningHigh,cot_CreatedBy,cot_CreatedTime,cot_Updatedby,cot_UpdatedTime,cot_EANCustNo,cot_System, cot_HTTPNotificationSent, cot_ConceptId) VALUES('CustomerERPRef','Customer ERP Ref',1,2000000000,1,0,0,0,'Install',GETDATE(),'Install',GETDATE(),'',1, 0,102) GO dbcc checkident (Counter, reseed, 1000); GO ------------------------------------------ -- Add default Installation Name ------------------------------------------ declare @save_id_tmp int declare @save_id_ConfigTree int declare @save_id_ConfigFiles int INSERT INTO ConfigTree(ctr_fk_loc) VALUES (NULL) set @save_id_ConfigTree=SCOPE_IDENTITY() INSERT INTO ConfigFiles(cof_fileName,cof_readOnly, cof_dateCreated, cof_dateModified, cof_user) VALUES ('Installation.ini', 0, GETDATE(), GETDATE(), 'Installation') set @save_id_ConfigFiles=SCOPE_IDENTITY() INSERT INTO ConfigSection(cse_fk_cof,cse_name) VALUES (@save_id_ConfigFiles, 'Installation') set @save_id_tmp=SCOPE_IDENTITY() INSERT INTO ConfigValue(cov_fk_cse,cov_name,cov_valueShort) VALUES (@save_id_tmp, 'ViewAllLocations', '1'); INSERT INTO ConfigValue(cov_fk_cse,cov_name,cov_valueShort) VALUES (@save_id_tmp, 'Name', 'Installation'); INSERT INTO ConfigTreeFilesLink(ctf_fk_ctr,ctf_fk_cof) VALUES (@save_id_ConfigTree, @save_id_ConfigFiles); GO