Posts

Showing posts from May, 2025

Rename the DB name in SQL / D365F&O

Image
You just go to SSMS and write these 3 queries on your Database. In my case, I am working with  Microsoft Dynamics 365 Finance & Operations  Alter database AxDB set single_user with rollback immediate; Alter database AxDB modify name = AxDB_old alter database AxDB set multi_user;

Types of Keys in Relational Model (Candidate, Super, Primary, Alternate and Foreign)

Image
 In the context of a relational database, Keys are one of the basic requirements of a relational database model. keys are fundamental components that ensure data integrity, uniqueness, and efficient access. It is widely used to identify the tuples(rows) uniquely in the table. We also use keys to set up relations amongst various columns and tables of a relational database. Let’s explore the various types of keys used in a relational model, which are essential for organizing and querying data effectively. Why do we require Keys in a DBMS? Keys are crucial in a Database Management System (DBMS) for several reasons: Uniqueness: Keys ensure that each record in a table is unique and can be identified distinctly. Data Integrity: Keys prevent data duplication and maintain the consistency of the data. Efficient Data Retrieval: By defining relationships between tables, keys enable faster querying and better data organization. Without keys, it would be extremely difficult to manage large data...

Creating a class, the best practice way in D365F&O

 Some time ago, I shared my thoughts on the 'construct' pattern, which is commonly used in AX. While I often make use of it, it’s not without its flaws—it can actually violate some best practices. (I’ll cover the issue of deep class hierarchies resulting from this pattern in a future post.) First, it’s worth noting that you can customize the compiler level and the best practice checks it performs. To do this, compile something to bring up the compiler output window. Then, click the Setup button to adjust the settings. For this example, I used compiler level 4 and enabled all best practice checks. Now, let’s create a simple class. This class will simply display information from an InventTable record. 1. ClassDeclaration As we start designing this class, it quickly becomes clear that we need to declare an InventTable record as a member variable. /// <summary> /// Class written to test the construct and new... patterns /// </summary> /// <remarks> /// De...

HOW TO IMPORT A DATABASE (bacpac format) INTO YOUR CLOUD HOSTED ENVIRONMENT. (D365FO)

Image
HOW TO IMPORT A DATABASE (bacpac format) INTO YOUR TIER 1 CLOUD HOSTED ENVIRONMENT. (D365FO) BEFORE YOU IMPORT, MAKE SURE: 1. Move the new database (bacpac) into the system environment (local computer) from which you are importing. 2. Download the zip file of SQLPackage. NET Core for Windows from Download and install SQL Server | Microsoft Docs Link: https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver16 Ref: https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver16#windows-net-8 3. Extract the file by right-clicking on the file in Windows Explorer, and selecting 'Extract All...', and select the target directory 4. Open a new Terminal window/CMD and cd to the location where SqlPackage was extracted: SqlPackage.exe /a:import /sf:D:\Exportedbacpac\my.bacpac /tsn:localhost /tdn:<target database name> /p:CommandTimeout=1200 You can also use the command below. C:\Program Files\Microsoft...

Azure Synapse anlytics

 What is Azure Synapse? Azure Synapse is a limitless analytics service that brings together enterprise data warehousing and Big Data analytics. It gives you the freedom to query data on your terms, using either serverless or dedicated resources, at scale. Requirements An Azure Synapse database master key. Using Transact-SQL To create a database master key Choose a password to encrypt a copy of the master key that will be stored in the database. In Object Explorer, connect to an instance of the Database Engine. Expand System Databases, right-click master, and then click New Query. Copy and paste the following example into the query window and click Execute. -- Creates the master key.   -- The key is encrypted using the password "23987hxJ#KL95234nl0zBe".     CREATE MASTER KEY ENCRYPTION BY PASSWORD = '23987hxJ#KL95234nl0zBe'; Authentication The Azure Synapse connector uses three types of network connections:      1. Spark driver to Azure Synapse. ...