Home » 2017 » February

Monthly Archives: February 2017

Error while loading Excel data into database

Issue: I am trying to load data from Excel 97 – 2003 sheet into a database table. I have written a simple SSIS package to do that, but unfortunately, it fails with error: –   Microsoft (R) SQL Server Execute Package Utility  Version 11.0.6020.0 for 64-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  2:02:37 … Continue reading

Restrict user to login from single Host

Restricting user to login from single host may be sometimes required from security point and other business requirements. We can achieve it through SERVER LEVEL LOGON TRIGGER. ALTER TRIGGER TR_CHECK_LOGIN_TEST_HOST ON ALL SERVER FOR LOGON AS BEGIN DECLARE @HOSTNAME VARCHAR(48) DECLARE @PROGNAME VARCHAR(100) SELECT @HOSTNAME = HOST_NAME FROM SYS.DM_EXEC_SESSIONS WHERE SESSION_ID = @@SPID IF ORIGINAL_LOGIN() … Continue reading

Write-Host || Cannot invoke this function because the current host does not implement it

Issue: While running powershell in SQL job step, I am getting below error: – A job step received an error at line 13 in a PowerShell script. The corresponding line is ‘Write-Host “ServerName: ” $comp’. Correct the script and reschedule the job. The error information returned by PowerShell is: ‘Cannot invoke this function because the … Continue reading

%d bloggers like this: