Excel LinkServer not working in SQL Server

I have created Excel linked server in SQL Server;

EXEC sp_addlinkedserver
   @server = 'ExcelServer',
   @srvproduct = 'ACE 12.0',
   @provider = 'Microsoft.ACE.OLEDB.12.0',
   @datasrc = 'C:\TempFolder\Sample1LinkedServer.xlsx',
   @provstr = 'Excel 12.0; HDR=Yes';

When i try to test this linked server, i get this error;

What permissions? SQL Server is running under NT service account by default. To fix this issue, i did this;

Go To Server Objects -> Linked Servers -> Providers.

Open Microsoft.ACE.OLEDB.12.0 by right click and properties. Check “Allow inprocess”.

Do the same for Microsoft.ACE.OLEDB.14.0.

The pain will go away.

Execute SSIS Package from SPROC

You can run SSIS package from stored procedure. Follow this;

ALTER PROCEDURE EXECUTE_SSIS_PACKAGE_DEMO
 @OUTPUT_EXECUTION_ID bigint output
AS
BEGIN
 DECLARE @EXECUTION_ID BIGINT
 EXEC SSISDB.CATALOG.CREATE_EXECUTION 
  @FOLDER_NAME = 'MyFolderName'
 ,@PROJECT_NAME = 'MyProjectName'
 ,@PACKAGE_NAME = 'MyPackageName.DTSX'
 ,@USE32BITRUNTIME=FALSE
 ,@REFERENCE_ID=1	--This is environment ID
 ,@RUNINSCALEOUT=FALSE
 ,@EXECUTION_ID = @EXECUTION_ID OUTPUT

 EXEC SSISDB.CATALOG.START_EXECUTION @EXECUTION_ID
 SET @OUTPUT_EXECUTION_ID = @EXECUTION_ID
END

You can execute this procedure;

--EXECUTE STORED PROCEDURE
DECLARE @OUTPUT_EXECUTION_ID BIGINT
EXEC DBO.EXECUTE_SSIS_PACKAGE_DEMO @OUTPUT_EXECUTION_ID OUTPUT
PRINT @OUTPUT_EXECUTION_ID

You can check the status of execution;

--CHECK STATUS
SELECT STATUS 
FROM SSISDB.CATALOG.EXECUTIONS
WHERE EXECUTION_ID = N''

SSIS package execution requires windows authentication. My client has SQL server authentication enabled so I can not take advantage of this approach.

In my next article, I will show you how to run SSIS Packages using SQL authentication.

Resources

https://www.mssqltips.com/sqlservertip/2992/how-to-execute-an-integration-services-ssis-package-from-a-sql-server-stored-procedure/

What If Report Phishing is Missing in outlook?

  1. Go to the File tab.
  2. Select Options.
  3. In the Outlook Options dialog box, select the Add-ins tab.
  4. In the Inactive Applications list, select Microsoft Junk Email Reporting Add-in.
  5. Select the Manage dropdown arrow, choose Com Add-ins, then select Go.

If you don’t find this Add-in. Download from here;

https://www.microsoft.com/en-us/download/details.aspx?id=18275

Check your outlook is 32/64 bit and download add-in. go through wizard.

Adding a separate email account as an owner subscription

My friend has created the Azure subscription using this email address, foo.inc@outlook.com. Azure has created a domain fooincoutlook.onmicrosoft.com in Azure Active Directory.

Me and my friend share same subscription with same foo.inc@outlook.com email address to provision services Azure. There are occasional disruptions in my sign-in and I see a login pop up window. It asks me to type-in our shared email address to get a code and authenticate in Azure. I contact my friend and solve login issue. This is a waste of time.

To solve this issue, navigate to Active Directory -> Manage -> User and create a new user;

adam@fooincoutlook.onmicrosoft.com

Navigate to Azure subscription -> Access control (IAM) -> Add -> Add role assignment;

By using adam@fooincoutlook.onmicrosoft.com, We can share a single subscription but can use our own email accounts to provision resources.

There are other ways to manage identities but I have found this an easier and quicker fix.

VM Reserved instance

I have configured Azure VM for development environment from an image and running it for the past 3 weeks. Today, Azure advisor recommended that upgrading Pay-As-You-Go to reserved instance will save us 25% yearly that’s estimated 1,031.67 USD.

Here is how you can do that;

Go to Home -> <Your Subscription> -> Buy reserved instances -> Virtual machine

I came here for one year (25%) discount but if commit for three year i can get 48% discounts. Not bad.

The monthly estimated prices for a 3 years commitment is 130.61 USD.