• Skip to main content
  • Skip to primary sidebar
  • Home
  • About
  • Recommended Readings
    • 2022 Book Reading
    • 2023 Recommended Readings
    • Book Reading 2024
    • Book Reading 2025
    • Book Reading 2026
  • Supply Chain Management Guide
  • PKM
  • Microsoft Excel
  • Microsoft Copilot in Office 365
  • Public Wiki Page

Ali Raza Zaidi

A practitioner’s musings on Dynamics 365 Finance and Operations

Tips and tricks

describe table tsql

March 13, 2012 by alirazazaidi

Currently I was searching describe  like function, which used in Oracle PLSQL to get the detail of table.  I found equvilent function in TSQL “sp_help”.

you can used it as

sp_help <table_name>

 

i.e

sp_help studentdet

Connect to the console session of a server using Remote Desktop using mstsc /console

February 22, 2012 by alirazazaidi

The command I forget, so i log it here

 

Using the command line

  1. Open Command Prompt.
  2. Type:

    mstsc /console.

  3. Remote Desktop Connection will start. Type the computer name or IP address of the computer you want to connect to in the Computer box.
  4. Configure any other desired options, and then click Connect.

Using a Common Table Expression (CTE) with an UPDATE statement

February 14, 2012 by alirazazaidi

For update part of ETL Process I have to write another Common table expression to get  all records where are changed at source to run update query on destination table

 

My update part of basic ETL using TSQL as

 

with ChangedRows as

(

 

SELECT     sourceEmp.empid, sourceEmp.lastname, sourceEmp.firstname, sourceEmp.title, sourceEmp.titleofcourtesy, sourceEmp.birthdate, sourceEmp.hiredate, sourceEmp.address, sourceEmp.city, sourceEmp.region, sourceEmp.postalcode, sourceEmp.country, sourceEmp.phone, sourceEmp.mgrid,DestEmployee.SourceEmpId

FROM         TSQLFundamentals2008.HR.Employees sourceEmp inner join

TSQLFundamentals2008DW.HR.DimEmployees DestEmployee

on

sourceEmp.empid = DestEmployee.SourceEmpId

where

 

sourceEmp.lastname <> DestEmployee.lastname

or sourceEmp.firstname <> DestEmployee.firstname

or sourceEmp.title <> DestEmployee.title

or sourceEmp.titleofcourtesy <>DestEmployee.titleofcourtesy

or sourceEmp.birthdate<>DestEmployee.birthdate

or sourceEmp.hiredate <> DestEmployee.hiredate

or sourceEmp.address <> DestEmployee.address

or sourceEmp.city <> DestEmployee.city

or sourceEmp.region <> DestEmployee.region

or sourceEmp.postalcode<>DestEmployee.postalcode

or sourceEmp.country <>DestEmployee.country

or sourceEmp.phone<>DestEmployee.phone

or sourceEmp.mgrid <> DestEmployee.mgrid

 

)

update  TSQLFundamentals2008DW.HR.DimEmployees

set    lastname = ChangedRows.lastname

,  firstname = ChangedRows.firstname

,  title = ChangedRows.title

,  titleofcourtesy =ChangedRows.titleofcourtesy

,  birthdate=ChangedRows.birthdate

,  hiredate = ChangedRows.hiredate

,  address = ChangedRows.address

,  city = ChangedRows.city

,  region = ChangedRows.region

,  postalcode=ChangedRows.postalcode

,  country =ChangedRows.country

,  phone=ChangedRows.phone

,  mgrid = ChangedRows.mgrid

from ChangedRows

where TSQLFundamentals2008DW.HR.DimEmployees.SourceEmpId=ChangedRows.empid

Using a Common Table Expression (CTE) with an INSERT INTO statement

February 14, 2012 by alirazazaidi

My current assignment was to write ETL Process using TSQL.  So I have to get all rows which are newly added to Source Table and are not part of destination table. I wrote simple Common Table Expression to get all rows and insert into destination table.

So part of ETL Process using CTE as

 

with NewRows as

(

SELECT     sourceEmp.empid, sourceEmp.lastname, sourceEmp.firstname, sourceEmp.title, sourceEmp.titleofcourtesy, sourceEmp.birthdate, sourceEmp.hiredate, sourceEmp.address, sourceEmp.city, sourceEmp.region, sourceEmp.postalcode, sourceEmp.country, sourceEmp.phone, sourceEmp.mgrid,DestEmployee.SourceEmpId

FROM         TSQLFundamentals2008.HR.Employees sourceEmp left join

TSQLFundamentals2008DW.HR.DimEmployees DestEmployee

on

sourceEmp.empid = DestEmployee.SourceEmpId

where DestEmployee.SourceEmpId is null

)

INSERT INTO [TSQLFundamentals2008DW].[HR].[DimEmployees]

([lastname]

,[firstname]

,[title]

,[titleofcourtesy]

,[birthdate]

,[hiredate]

,[address]

,[city]

,[region]

,[postalcode]

,[country]

,[phone]

,[mgrid]

,[SourceEmpId])

(select

NewRows.lastname, NewRows.firstname, NewRows.title, NewRows.titleofcourtesy, NewRows.birthdate,

NewRows.hiredate, NewRows.address, NewRows.city, NewRows.region, NewRows.postalcode, NewRows.country, NewRows.phone, NewRows.mgrid,

NewRows.empid  from NewRows)

T-SQL: How to do SQL Server paging with ROW_NUMBER()?

February 7, 2012 by alirazazaidi

DECLARE @PageNum AS INT;
DECLARE @PageSize AS INT;
SET @PageNum = 2;
SET @PageSize = 10;

WITH OrdersRN AS
(

SELECT     ROW_NUMBER() OVER(ORDER BY DimProduct.ProductKey) AS RowNum,
 DimProduct.ProductKey, 
           DimProduct.EnglishProductName as Product,
           DimProductSubcategory.ProductSubcategoryKey as SubCategoryKey, 
           DimProductSubcategory.EnglishProductSubcategoryName as SubCategory,
           DimProductCategory.ProductCategoryKey as CategoryKey,
           DimProductCategory.EnglishProductCategoryName  as Category 
FROM         DimProduct INNER JOIN
                      DimProductSubcategory ON DimProduct.ProductSubcategoryKey = DimProductSubcategory.ProductSubcategoryKey INNER JOIN
                      DimProductCategory ON DimProductSubcategory.ProductCategoryKey = DimProductCategory.ProductCategoryKey
                   )   
                      SELECT *
FROM OrdersRN
WHERE RowNum BETWEEN (@PageNum - 1) * @PageSize + 1
      AND @PageNum * @PageSize
ORDER BY ProductKey;

How to get list of tables in Database TSQL

February 7, 2012 by alirazazaidi

You can use the list down all tables in specific database with this query

select TABLE_NAME from information_schema.tables where Table_Type = 'BASE TABLE'

 

Using WITH (NOLOCK) in T-SQL?

February 7, 2012 by alirazazaidi

Nolock is T-Sql hint, That used to ignore the locks on table during transactions. It allows retrieving data and did not wait to complete the transaition applied on table. It has some pros can cons

Pros:

  • NoLock provides significant improvements on large table, where upserts commands take time.
  • You can retirve data during the same time while others are performing Insert and update on table.

Cons:

  • Possibility of data that was partially updated or inserted, because you retrieve data during update or insert on table.
  • It often results in very obscure, hard to reproduce bugs and can cause data to get corrupted.

How to run apache server and ii7 simultaneously same time on window 7

February 5, 2012 by alirazazaidi

In my personal machine, I installed the ii7, same time I required XAMP for php, Problem is that ii7 and apache server both occupied the same port 80 by default. Apache is stop running on my machine. So I decide to change the default port of XAMP to something else I follow the following steps to fix this issue.

  • Stop the XAMP server.
  • httpd.conf” is the file where apache configuration are placed.
  • Open the <drive>:xamppapacheconf folder and edit the httpd.conf” file.

  • In Configuration file at line 47 you find the port 80 mentioned.
  • Listen 80

  • o Change this to Listen 8082
  •  Now goes to Line 178  ServerName localhost:80

  • Change it to ServerName localhost:8082
  • Save the config file and restart the XAMPP server.
  • Hope fully this solve the problem.

How to fix “HTTP Error 403.14 – Forbidden The Web server is configured to not list the contents of this directory”

January 9, 2012 by alirazazaidi

Currently working on sftp BizTalk adapter, I have to configure SSL site on my local machine. I got following error when  run the local host.

HTTP Error 403.14 – Forbidden

The Web server is configured to not list the contents of this directory.

 

The issue was that .Net framework 4.0 was not installed on my machine, possible I installed iis after installation of visual studio.

So here is what you need to do to fix it.

1.) Run a command prompt as Administrator.

2.) Copy and paste the following text “C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_regiis.exe -i”

This is assuming that you have already installed .Net Framework 4.0 , but not in the correct order.

BizTalk Server 2010 Business Rule Engine: Survival Guide

January 6, 2012 by alirazazaidi

During the studying BRE i found following survival guide for BRE.

 

http://social.technet.microsoft.com/wiki/contents/articles/6480.aspx

Some excerpt form above link

”

Out of box the business rules engine (BRE ) is offered as either stand-alone .NET-compliant class library that includes a number of modules, support components, and tools or as component within your BizTalk solution enabling you to apply business rules to your processes (i.e. orchestrations). BRE implements the Rete algorithm , which is an efficient pattern matching algorithm for implementing production rule systems, and provides forward chaining execution. Forward chaining is one of the two main methods of reasoning when using inference rules (in artificial intelligence). This article will give you an overview of all relevant available resources regarding BRE to enable you to build robust solution with BRE.

“

« Previous Page
Next Page »

Primary Sidebar

About

I am Dynamics AX/365 Finance and Operations consultant with years of implementation experience. I has helped several businesses implement and succeed with Dynamics AX/365 Finance and Operations. The goal of this website is to share insights, tips, and tricks to help end users and IT professionals.

Legal

Content published on this website are opinions, insights, tips, and tricks we have gained from years of Dynamics consulting and may not represent the opinions or views of any current or past employer. Any changes to an ERP system should be thoroughly tested before implementation.

Categories

  • Accounts Payable (2)
  • Advance Warehouse (2)
  • AI (3)
  • Asset Management (3)
  • Azure Functions (1)
  • Books (6)
  • Certification Guide (3)
  • ChatGPT (3)
  • Claude (1)
  • Customization Tips for D365 for Finance and Operations (64)
  • D365OF (60)
  • Data Management (1)
  • database restore (1)
  • Dynamics 365 (59)
  • Dynamics 365 for finance and operations (139)
  • Dynamics 365 for Operations (175)
  • Dynamics AX (AX 7) (134)
  • Dynamics AX 2012 (274)
  • Dynamics Ax 2012 Forms (13)
  • Dynamics Ax 2012 functional side (16)
  • Dynamics Ax 2012 Reporting SSRS Reports. (31)
  • Dynamics Ax 2012 Technical Side (52)
  • Dynamics Ax 7 (65)
  • Exam MB-330: Microsoft Dynamics 365 Supply Chain Management (7)
  • Excel Addin (1)
  • Favorites (12)
  • Financial Modules (6)
  • Functional (8)
  • General Journal (1)
  • Implementations (1)
  • Ledger (1)
  • Lifecycle Services (1)
  • Logseq (4)
  • Management Reporter (1)
  • Microsoft Excel (4)
  • MS Dynamics Ax 7 (64)
  • MVP summit (1)
  • MVP summit 2016 (1)
  • New Dynamics Ax (19)
  • Non Defined (9)
  • Note taking Apps (2)
  • Obsidian (4)
  • Personal Knowledge Management (3)
  • PKM (16)
  • Power Platform (6)
  • Procurement (5)
  • procurement and sourcing (6)
  • Product Information Management (4)
  • Product Management (6)
  • Production Control D365 for Finance and Operations (10)
  • Sale Order Process (10)
  • Sale Order Processing (10)
  • Sales and Distribution (5)
  • Soft Skill (1)
  • Supply Chain Management D365 F&O (5)
  • Tips and tricks (278)
  • Uncategorized (165)
  • Upgrade (1)
  • Web Cast (7)
  • White papers (4)
  • X++ (10)

Wiki

  • SCM

Copyright © 2026 · Magazine Pro On Genesis Framework · WordPress · Log in