Friday, June 18, 2021

Failed to save modifications to the server. Error returned: 'The Column 'column1' in table 'Table1' has invalid bindings specified

Failed to save modifications to the server. Error returned: 'The Column 'column1' in table 'Table1' has invalid bindings specified

To Fix

=ROW(EmpTabele,1)

Wednesday, June 16, 2021

Failed to save modifications to the server. Error returned: 'Too few arguments were passed to the ADDCOLUMNS function

 Failed to save modifications to the server. 

Error returned: 'Too few arguments were passed to the ADDCOLUMNS function. The minimum argument count for the function is 3.

Column 'Employee_ID' in Table 'Employee' contains a duplicate value '<pii>2727</pii>'

and this is not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table.'

-- This issue based on Relationship 1:M problem on Azure Analysis model/Cube

Thursday, April 29, 2021

How to import Favourites from Internet explorer to Edge browser

 


Monday, April 06, 2020

Professional Azure SQL Database Administration eBook

The e-book version of my book Professional Azure SQL Database Administration is available for free here - do check it out.
https://azure.microsoft.com/en-in/resources/professional-azure-sql-database-administration/

Wednesday, March 18, 2020

Create SQL Login and SQL User on your Azure SQL DB


/*1: Create SQL Login on master database (connect with admin account to master database)*/
CREATE LOGIN MyLogin WITH PASSWORD = '';


/*2: Create SQL user on the master database (this is necessary for login attempt to the database, as with Azure SQL you cannot set the DEFAULT_DATABASE property of the login so it always will be [master] database.)*/
CREATE USER MyUser FROM LOGIN MyLogin;


/*3: Create SQL User on the user database (connect with admin account to user database)*/
CREATE USER MyUser FROM LOGIN MyLogin;


/*4. Grant permissions to the user by assign him to a database role*/
ALTER ROLE db_datareader ADD MEMBER MyUser;


/*Login with the newly created login:

With SSMS  use login name and password to connect directly to user database \ master \

When using contained database used, you must set the here to be able to connect.
*/

Wednesday, September 11, 2019

How to find blocking queries in SQL Azure


The query below will display the top ten running queries that have been the longest total elapsed time and are blocking other queries.

SELECT TOP 10 r.session_id, r.plan_handle,  r.[sql_handle], r.request_id,      r.start_time, r.[status],      r.command, r.database_id,      
r.[user_id], r.wait_type,      r.wait_time, r.last_wait_type,      r.wait_resource, r.total_elapsed_time,      r.cpu_time, r.transaction_isolation_level,      r.row_count, st.[text]  
FROM sys.dm_exec_requests r  CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) as st  
WHERE r.blocking_session_id = 0       
and r.session_id IN  (SELECT distinct(blocking_session_id)  FROM sys.dm_exec_requests)  
GROUP BY r.session_id, r.plan_handle,      r.[sql_handle], r.request_id,      r.start_time, r.[status],      r.command, r.database_id,      r.[user_id], r.wait_type,      r.wait_time, r.last_wait_type,      r.wait_resource, r.total_elapsed_time,      r.cpu_time, r.transaction_isolation_level,      r.row_count, st.[text]  
ORDER BY r.total_elapsed_time DESC

Wednesday, August 14, 2019

How to find Azure SQL Database Usage

It is simple way to use below SQL query to extract Azure SQL Database usage metrics.

SELECT DB_NAME() as DatabaseName, 
         (max_size/128.0) / 1024 AS DBMaxSizeInGB ,
(size/128.0) / 1024 AS DBAllocatedSpaceInGB ,  
(CAST(FILEPROPERTY(name, 'SpaceUsed') AS bigint) * 8192.) / 1024 / 1024 / 1024 AS DBUsedSpaceInGB,
(size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0)/  1024 AS FreeSpaceInGB ,
  Getdate() as Created_Date  
FROM sys.database_files
WHERE name in ('data_0' ) and DB_NAME() = 'MyDatabase';