init
This commit is contained in:
1
DataPRO_sql/.svn/entries
Normal file
1
DataPRO_sql/.svn/entries
Normal file
@@ -0,0 +1 @@
|
||||
12
|
||||
1
DataPRO_sql/.svn/format
Normal file
1
DataPRO_sql/.svn/format
Normal file
@@ -0,0 +1 @@
|
||||
12
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,36 @@
|
||||
USE [DataPRO]
|
||||
GO
|
||||
|
||||
/****** Object: UserDefinedFunction [dbo].[foo_GetIdenticalGroupChannelSettingsCount] Script Date: 1/25/2019 2:35:12 PM ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE FUNCTION [dbo].[foo_GetIdenticalGroupChannelSettingsCount]
|
||||
(
|
||||
@ChannelId1 BIGINT,
|
||||
@ChannelId2 BIGINT
|
||||
)
|
||||
RETURNS int
|
||||
AS
|
||||
BEGIN
|
||||
return (
|
||||
SELECT COUNT(*)
|
||||
FROM [DataPro].[dbo].[GroupChannelSettings] G1,
|
||||
[DataPro].[dbo].[GroupChannelSettings] G2
|
||||
WHERE G1.ChannelId = @ChannelId1
|
||||
AND G2.ChannelId = @ChannelId2
|
||||
AND G1.SettingId = G2.SettingId
|
||||
AND G1.SettingValue = G2.SettingValue
|
||||
)
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,43 @@
|
||||
USE [DataPRO]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[SensorsDigitalIn] Script Date: 6/19/2018 12:41:56 PM ******/
|
||||
DROP TABLE [dbo].[SensorsDigitalIn]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[SensorsDigitalIn] Script Date: 6/19/2018 12:41:56 PM ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
SET ANSI_PADDING ON
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[SensorsDigitalIn](
|
||||
[Id] [int] IDENTITY(1,1) NOT NULL,
|
||||
[SerialNumber] [nvarchar](50) NOT NULL,
|
||||
[SettingMode] [int] NOT NULL,
|
||||
[ScaleMultiplier] [nvarchar](50) NOT NULL,
|
||||
[LastModified] [datetime] NOT NULL,
|
||||
[LastModifiedBy] [nvarchar](50) NOT NULL,
|
||||
[eId] [nvarchar](50) NOT NULL,
|
||||
[UserValue1] [nvarchar](255) NULL,
|
||||
[UserValue2] [nvarchar](255) NULL,
|
||||
[UserValue3] [nvarchar](255) NULL,
|
||||
[UserTags] [varbinary](max) NULL,
|
||||
[MeasurementUnit] [nvarchar](50) NOT NULL,
|
||||
[FilterClass] [nvarchar](50) NOT NULL,
|
||||
CONSTRAINT [PK__SensorsDigitalIn] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[Id] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
|
||||
GO
|
||||
|
||||
SET ANSI_PADDING ON
|
||||
GO
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,54 @@
|
||||
USE [DataPRO]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[Channels] Script Date: 3/29/2019 9:32:09 AM ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[Channels](
|
||||
[Id] [bigint] IDENTITY(1,1) NOT NULL,
|
||||
[GroupId] [int] NOT NULL,
|
||||
[IsoCode] [nvarchar](50) NOT NULL,
|
||||
[IsoChannelName] [nvarchar](255) NOT NULL,
|
||||
[UserCode] [nvarchar](50) NOT NULL,
|
||||
[UserChannelName] [nvarchar](255) NOT NULL,
|
||||
[DASId] [int] NULL,
|
||||
[DASChannelIndex] [int] NOT NULL,
|
||||
[GroupChannelOrder] [int] NOT NULL,
|
||||
[TestSetupOrder] [int] NOT NULL,
|
||||
[SensorId] [int] NULL,
|
||||
[Disabled] [bit] NOT NULL,
|
||||
[LastModified] [datetime] NOT NULL,
|
||||
[LastModifiedBy] [nvarchar](255) NOT NULL,
|
||||
CONSTRAINT [PK_Channels] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[Id] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[Channels] WITH NOCHECK ADD CONSTRAINT [FK_Channels_DASId] FOREIGN KEY([DASId])
|
||||
REFERENCES [dbo].[DAS] ([DASId])
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[Channels] CHECK CONSTRAINT [FK_Channels_DASId]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[Channels] WITH NOCHECK ADD CONSTRAINT [FK_Channels_GroupId] FOREIGN KEY([GroupId])
|
||||
REFERENCES [dbo].[Groups] ([Id])
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[Channels] CHECK CONSTRAINT [FK_Channels_GroupId]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[Channels] WITH NOCHECK ADD CONSTRAINT [FK_Channels_SensorId] FOREIGN KEY([SensorId])
|
||||
REFERENCES [dbo].[Sensors] ([id])
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[Channels] CHECK CONSTRAINT [FK_Channels_SensorId]
|
||||
GO
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
USE [DataPRO]
|
||||
GO
|
||||
|
||||
/****** Object: UserDefinedFunction [dbo].[foo_GetTotalGroupChannelSettingsCount] Script Date: 1/25/2019 2:36:13 PM ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
CREATE FUNCTION [dbo].[foo_GetTotalGroupChannelSettingsCount]
|
||||
(
|
||||
@ChannelId BIGINT
|
||||
)
|
||||
RETURNS INT
|
||||
AS
|
||||
BEGIN
|
||||
RETURN (SELECT COUNT(*) FROM [DataPro].[dbo].[GroupChannelSettings] WHERE ChannelId = @ChannelId)
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,31 @@
|
||||
USE [DataPRO]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[sp_DASGet] Script Date: 8/15/2017 8:59:42 AM ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
CREATE PROCEDURE [dbo].[sp_DASGetChildrenDAS]
|
||||
@ParentSerialNumber nvarchar(50) = null
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
SELECT [SerialNumber]
|
||||
FROM [dbo].[DAS] where
|
||||
[ParentDAS] = @ParentSerialNumber
|
||||
END
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user