-->
Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

MSSQLFUN

I, Rohit Garg, am working as Consultant in IT Company. I am having an around 5 years of experience in MSSQL server & other Microsoft technologies. I am working as DBA in Microsoft SQL Server from last 5 years in e-Commerce, Telecom, Finance domain. In this tenure, I got a chance of working as Database administrator, Developer and trainer on SQL server 2000 to SQL Server 2012. I am holding Master’s degree in Computer Science along with certification in SQL Server & .Net. I like to learn new things by hand-on experience on regular basis. This journey is so far is delightful & valuable with the addition of wonderful friends.

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.… Read more

0 comments, 102 reads

Posted in MSSQLFUN on 21 February 2017

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 Read more

0 comments, 105 reads

Posted in MSSQLFUN on 7 February 2017

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… Read more

0 comments, 114 reads

Posted in MSSQLFUN on 1 February 2017

Error While running PowerShell code from SQL Agent job – “Path Does Not Exist”

Issue: When I am running code from PowerShell console its running fine but when I execute it through SQL agent job step, I am getting below error: –

The job script encountered the following errors. These errors did not stop the script:  A job step received an error at line… Read more

0 comments, 205 reads

Posted in MSSQLFUN on 23 January 2017

What’s new in SQL Server 2016 installation?

1) As MS is kept increasing number of option while installation. To reduce no. of click, if setup pass Rules it will automatically moves to Next window.

2) On Server Configuration page, MS specifically ask to GRANT PERFORM VOLUME MAINTENANCE TASK permission to service account. SQL Services needs this access… Read more

0 comments, 194 reads

Posted in MSSQLFUN on 16 January 2017

Sequence – Long awaited feature

As per BOL (https://msdn.microsoft.com/en-us/library/ff878058(v=sql.110).aspx) : A sequence is a user-defined schema-bound object that generates a sequence of numeric values according to the specification with which the sequence was created. The sequence of numeric values is generated in an ascending or descending order at a defined interval and may cycle… Read more

0 comments, 148 reads

Posted in MSSQLFUN on 5 January 2017

What is “SET STATISTICS TIME”?

When you turn on this option, it will display the number of milliseconds required to parse, compile, and execute each statement. By default, this option is disabled.

SET STATISTICS TIME ON;

GO

SELECT * FROM [HUMANRESOURCES].[EMPLOYEE]

Output: –

SQL Server parse and compile time: 
 CPU time = 0 ms, elapsed…

Read more

0 comments, 140 reads

Posted in MSSQLFUN on 19 December 2016

What is “SET STATISTICS TIME”?

When you turn on this option, it will display the number of milliseconds required to parse, compile, and execute each statement. By default, this option is disabled.

SET STATISTICS TIME ON;

GO

SELECT * FROM [HUMANRESOURCES].[EMPLOYEE]

Output: –

SQL Server parse and compile time: 
 CPU time = 0 ms, elapsed…

Read more

0 comments, 116 reads

Posted in MSSQLFUN on 19 December 2016

What is “SET STATISTICS TIME”?

When you turn on this option, it will display the number of milliseconds required to parse, compile, and execute each statement. By default, this option is disabled.

SET STATISTICS TIME ON;
GO
SELECT * FROM [HUMANRESOURCES].[EMPLOYEE]

Output: -
SQL Server parse and compile time:
 CPU time = 0 ms, elapsed…

Read more

0 comments, 176 reads

Posted in MSSQLFUN on 19 December 2016

How to use DTA (Database Tuning Advisor) with Plan Cache option?

SQL Server 2012 comes up with new workload option in DTA (Database Tuning Advisor). In addition, on existing options File or Table, Microsoft gives option to fetch workload from plan cache of SQL Server. In this case, the DTA will select the top 1,000 events from the plan cache based… Read more

0 comments, 169 reads

Posted in MSSQLFUN on 12 December 2016

MSDB log file grown large – SLEEP_MSDBSTARTUP waittype

Issue: MSDB database log file is getting full very rapidly and became very huge. Currently, T-Log file is of 5GB whereas Data file is only 1GB for MSDB on server.

Findings: We found system owned open transaction in MSDB which is causing issue.

Transaction information for database ‘msdb’.

Oldest active… Read more

0 comments, 183 reads

Posted in MSSQLFUN on 30 November 2016

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

Read more

0 comments, 305 reads

Posted in MSSQLFUN on 18 October 2016

MDW Data Collector – Collection Set jobs not working

ERROR :

Error Message 1 :

Executed as user: Domain\UserName. SSIS error. Component name: DFT – Upload collection snapshot, Code: -1071636372, Subcomponent: RFS – Read Current Upload Data [1], Description: String too long. The adapter read a string that was 50331648 bytes long, and expected a string no longer than… Read more

0 comments, 371 reads

Posted in MSSQLFUN on 17 May 2016

Implementation of Data Compression – SQL Server

Data Compression

Data Compression is feature of Microsoft SQL Server to reduce the size of table on the basis of Duplicates, Null & Zeroes. It’s a process of reducing size of database & its objects by increasing CPU cycle and reducing I/O effort.

Types of Database Compression

· Row Compression Read more

0 comments, 634 reads

Posted in MSSQLFUN on 5 October 2015

MDW Data Collector – Collection Set jobs not working

ERROR :

Error Message 1 :

Executed as user: Domain\UserName. SSIS error. Component name: DFT – Upload collection snapshot, Code: -1071636372, Subcomponent: RFS – Read Current Upload Data [1], Description: String too long. The adapter read a string that was 50331648 bytes long, and expected a string no longer than… Read more

2 comments, 740 reads

Posted in MSSQLFUN on 24 July 2015

500+ Facebook Like

Thanks every one for loving me, joining me & providing you extreme support.

I am very happy to share that we reach to 500+ milestone.

Please keep supporting us & liking us.

Reference : Rohit Garg (http://mssqlfun.com/)

You can find and follow MSSQLFUN :-

http://www.facebook.com/mssqlfun

http://mssqlfun.com/feed

https://twitter.com/Rgarg86

Other… Read more

0 comments, 330 reads

Posted in MSSQLFUN on 11 June 2015

Strange Issue of waittype – PREEMPTIVE_OS_GETPROCADDRESS

ISSUE : Today, My Friend is facing issue with SQL Server error logs on one of my production server. SQL Server is not able to read SQL server error log files. We have checked that SQL Server Error log files are accessible on file system.

1) When we are running… Read more

2 comments, 583 reads

Posted in MSSQLFUN on 2 June 2015

Last Cumulative Update – 16 for SQL Server 2012 Service Pack 1 Is Now Available !

The 16th cumulative update release for SQL Server 2012 Service Pack 1 is now available for download at the Microsoft Support site. Cumulative Update 16 contains all the hotfixes released since the initial release of SQL Server 2012 SP1.

Those who are facing severe issues with their environment, they can… Read more

0 comments, 444 reads

Posted in MSSQLFUN on 25 May 2015

Cumulative Update – 6 for SQL Server 2012 Service Pack 2 Is Now Available !

The 6th cumulative update release for SQL Server 2012 Service Pack 2 is now available for download at the Microsoft Support site. Cumulative Update 6 contains all the hotfixes released since the initial release of SQL Server 2012 SP2.

Those who are facing severe issues with their environment, they can… Read more

0 comments, 657 reads

Posted in MSSQLFUN on 25 May 2015

Older posts