Wednesday, 22 April 2020

The key column #0 has data type 'Double' different than the attribute's key column data type 'WChar'

Hi Folks!
After a long time I got a chance to work on SSAS cube.
One of my colleague asked for my help in resolution of the below error message.

Severity    Code    Description    Project    File    Line    Suppression State
Error        MeasureGroupAttribute [CRC001_CALLCENTRE_CALLS].[Logs].[Calling Party].[Number] : The key column #0 has data type 'Double' different than the attribute's key column data type 'WChar'

I was so happy to find its resolution in minutes.

The resolution is to  


Edit the dimension of the cube and go to properties of the offending attribute. KeyColumns --> DataType needs to be changed from WChar to Double.

Bingo!
The issue was resolved and cube was deployed !!


Wednesday, 15 April 2020

Let's Start with Other Learnings

Hi Friends,
Its been so long since I posted any new entries.

There are very few entries in this blog and I regret for not writing all my learning's in this blog. I am used to learning anything new daily for at least 10 to 20 minutes on what I am working on.

With my next role being an Azure Architect, it requires me to learn Azure , Agile, Project Management, CMMI and so many other topics.

Would like to start my entries on all the topics that I learn...

The name of this blog still remains PurelySQL as all the next entries is obvious next thing for any SQL Developer or Architect.

Blogging your Learning's is so much fun !!!! Yippee !!!!!

Monday, 4 November 2019

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Hi Folks!
Okay so here is the error message which took lot many days to resolve from my IT team. But by the grace of God we were able to fix this issue by following the below steps

1. Ensure the tnsnames file or the notepad file in which you have defined the oracle connections names are correct. Even a single quotation mark difference will cause error.
So if the connection is working on a different computer, take the notepad contents from that system and paste in your system.
2. The same dSN would be present under 'USER DSN' . delete it where it is not required.
Usually Oracle uses "System dsn" and hence any duplicates in USER DSN can be deleted.

We found that the USER DSN had the same conncetion string but no drivers installed for that. when we deleted in USER DSN then it worked!!!

Thursday, 18 April 2019

IBM notes is not opening

Hi friends,
New office and new mail system i,e IBM NOtes
System restarted and IBM notes was not opening.
To resolve this issue

Come to DOS, navigate to
C:\Program Files (x86)\IBM\Notes

then use NSD -Kill to stop all processes:

Restart IBM notes. it will work 

Sunday, 14 April 2019

SQL query is taking too long as number of rows returned is huge volume

Hi Friends,
Today I faced a issue where the sql query was taking a long time to diplay data. This was because data in the main table had huge volume. The query is something like below

Select A.col1,A.col2,A.col3,A.col4,B.col1,B.col2,C.col1......
from TableA A
left join TableB B
on...
left join TableC C
on....
left Join TableD D
on...
Where
some filters
Date filter
Group By clause

To improve the performance we used CTE
i,e the Table A had 20 lakh records and each left join would take very long time

So a CTE was introduced first to get required data and then do left join

With CTE
As
(
Select A.col1,A.col2,A.col3,A.col4
from TableA A
Where Date Condition
)
Select CTE.col1, CTE.col2, CTE.col3 CTEA.col4,B.col1,B.col2,C.col1......
from TableA A
left join TableB B
on...
left join TableC C
on....
left Join TableD D
on...
Where
some filters
Date filter
Group By clause


The reason why this worked is because SQL query execution happens in the below order

From
Where
Select
GroupBY
OrderBy

So when we put filter in the initial from clause the number of rows returned were less . And then we can apply left joins 

Thursday, 11 April 2019

Incorrect syntax near ',' in SQL dynamic query or error while passing multi value parameter to dynamic sql

Hi Friends
We encounter the below error when you have to pass multi value paramter in your dynamic sql query


Incorrect syntax near ',' in SQL dynamic query

Scenario

 Declare @SQLQuery AS NVarchar(4000)
 Declare @EN AS NVarchar(2000)
   

Set @EN = ('John Smith,John Micheal')


    Set @SQLQuery = 'Select * From tblEmployees where EmployeeName
IN (''''' +@EN  +''''')'

Exec (@SQLQuery)

We get the error Incorrect syntax near ',' in SQL dynamic query

SOlUTION - Declare another variable and then use replace function to handle the multi value parameters

 Declare @SQLQuery AS NVarchar(4000)
 Declare @EN AS NVarchar(2000)
   

Declare @Ename AS varchar(MAX)

Set @EName = ('John Smith,John Micheal')

SET @EN = REPLACE (@Ename,',',''',''')


    Set @SQLQuery = 'Select * From tblEmployees where EmployeeName
IN (''''' +@EN  +''''')'

Exec (@SQLQuery)


Super!! issue is fixed

Hyperion Report shows blank after installation on Windows 10

Hi Friends,
Today I faced the below issue


Hyperion Report was showing blank after installation on Windows 10.
To resolve this issue, we checked the version of Internet explorer. We understood that Hyperion does not work with the latest version of IE in windows 10

Hence we installed it on a different machine in which windows version supported older version of IE