Author Archives: SQLKit

About SQLKit

For almost 10 years supporting SQL versions starting 6.5 to current as an production SQL DBA and as Application admin. Interests or learning include Hadoop , MySQL, PostGRESql and SAP BASIS administration.

Find Legacy SQL Joins

— will list both Views and Stored procedures in a particular database SELECT OBJECT_NAME(object_id),OBJECT_DEFINITION(object_id) FROM sys.objects WHERE OBJECT_DEFINITION(object_id) LIKE ‘%*=%’ or OBJECT_DEFINITION(object_id) LIKE ‘%=*%’ Advertisements

Posted in Administration | Leave a comment

Inplace Upgrade Win 2008 to 2008R2

Just wanted to write this for the fun of it, I know it is an old edition which is out of main stream support as of Jan 2015, it has extended support till 2020 WindowsSupport_LifeCycle The upgrade is pretty self … Continue reading

Posted in Windows | Leave a comment

MSSQL Replication between different SQL versions configuring Subscriptions

Came across an instance at work, where I had to set up replication between 2 different SQL versions, Publisher: SQL 2005 SP3 Subscriber: SQL 2008 R2 Type: Push Subscription Distributor: Publisher 1) Configure Publication on the Publisher This article doesn’t describe … Continue reading

Posted in Uncategorized | Leave a comment

Actual Database Size

The below script would provide the Actual DB file usage size rather than DB size (Used + Free) should work for SQL 2008 and upwards Borrowed the “dbo.sp_foreachdb” script from Aaron Bertrand (making-a-more-reliable-and-flexible-spmsforeachdb/) to list out all databases in a … Continue reading

Posted in Administration, MSSQL | Leave a comment

Coalesce Inside a Case

Got in to an instance at work where i had to modify a SP to get non-null values out of a case statement code block CASE WHEN condition_expression THEN  COALESCE(Column1, Column2) ELSE Column2 END AS New_Column

Posted in Development | Leave a comment

MySQL Startup error

Installed an windows version of MySQL and was trying to start it from a cmd prompt. To Start MySQL server from command line, you should start a console window (or “DOS window”) and enter the below or direct your command to … Continue reading

Posted in Administration, MySQL | Leave a comment

User and User Group Queries

I get user requests all the time for access rights and i don’t have read access to AD to check groups to see if the user is already a member or not. We can run the below scripts from SQL server Management … Continue reading

Posted in MSSQL, Permissions | Leave a comment