This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF OBJECT_ID('tempdb..#Results') IS NOT NULL | |
DROP TABLE #Results | |
SELECT * | |
INTO #Results | |
FROM | |
( | |
SELECT sche.name AS [SchemaName], | |
tabl.name AS [TableName], | |
cols.name AS [ColumnName] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @meta AS TABLE ( | |
[schema_name] varchar(128), | |
[table_name] varchar(128), | |
[column_name] varchar(128), | |
[company_id] int, | |
[row_count] int, | |
[value_found] varchar(128), | |
[search_value] varchar(128), | |
[update_script] nvarchar(1000), | |
[delete_script] nvarchar(1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Declare a Cursor to read #Results and generate rows from it | |
DECLARE C CURSOR FOR | |
-- Select statement to be driven by the cursor | |
SELECT [SchemaName], [TableName], [ColumnName] | |
FROM #Results | |
ORDER BY [SchemaName], [TableName], [ColumnName] | |
-- Open the Cursor (row pointer) | |
OPEN C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Show what has been found | |
SELECT * FROM @meta | |
ORDER BY [value_found], [schema_name], [table_name], [column_name], [update_script] | |
-- Merge update queries to use some of them in a customization project | |
SELECT DISTINCT STRING_AGG(CAST([update_script] AS nvarchar(max)), ';' + CHAR(13) + CHAR(10)) AS UpdateQueries | |
FROM @meta | |
-- Merge delete queries to use some of them in a customization project | |
SELECT DISTINCT STRING_AGG(CAST([delete_script] AS nvarchar(max)), ';' + CHAR(13) + CHAR(10)) AS DeleteQueries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[PXDBString(10, IsUnicode = true, IsKey = true)] | |
[PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)] | |
[PXUIField(DisplayName = "Class ID", Visibility=PXUIVisibility.SelectorVisible)] | |
[PXSelector(typeof(CustomerClass.customerClassID), CacheGlobal = true)] | |
[PXFieldDescription] | |
[PXReferentialIntegrityCheck] | |
public string CustomerClassID { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[PXDBString(3, IsKey = true, IsFixed = true)] | |
[PXDefault] | |
[ARDocType.List] | |
[PXUIField(DisplayName = "Type", Visibility = PXUIVisibility.SelectorVisible, Enabled = true, TabOrder = 0)] | |
public string DocType { get; set; } | |
public class ARDocType : ILabelProvider { | |
public const string Invoice = "INV"; | |
public const string NoUpdate = "UND"; | |
public const string Undefined = "UND"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// The identifier of the business account.</summary> | |
/// <remarks>This field is auto-incremental and not visible | |
/// This field is a surrogate key, as opposed to the natural key <see cref="AcctCD"/>. | |
/// </remarks> | |
[PXDBIdentity] | |
[PXUIField(Visible = false, Visibility = PXUIVisibility.Invisible, DisplayName = "Account ID")] | |
[PXReferentialIntegrityCheck] | |
public int? BAccountID { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE [dbo].[BAccount]( | |
[CompanyID] [int] NOT NULL, | |
[BAccountID] [int] IDENTITY(1,1) NOT NULL, | |
[AcctCD] [nvarchar](30) NOT NULL | |
... | |
CONSTRAINT [BAccount_PK] PRIMARY KEY CLUSTERED | |
( | |
[CompanyID] ASC, | |
[BAccountID] ASC | |
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[PXDBGuid(false)] | |
[PXDefault] | |
public Guid? WebHookID { get; set; } | |
[PXDBString(128, IsUnicode=true, IsKey=true, InputMask="")] | |
[PXDefault] | |
[PXSelector(typeof(WebHook.name), new Type[] { typeof(WebHook.name), typeof(WebHook.isActive), typeof(WebHook.isSystem) })] | |
[PXUIField(DisplayName="Webhook Name")] | |
public string Name { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE [dbo].[WebHook]( | |
[CompanyID] [int] NOT NULL, | |
[WebHookID] [uniqueidentifier] NOT NULL, | |
[Name] [nvarchar](128) NOT NULL, | |
... | |
CONSTRAINT [WebHook_PK] PRIMARY KEY CLUSTERED | |
( | |
[CompanyID] ASC, | |
[WebHookID] ASC | |
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] |
OlderNewer