SQL Repository
  • Home
  • Articles
    • MS SQL DBA
    • SSIS
    • SSRS
    • T-SQL
  • Code Snippets
    • MS SQL DBA
    • SSIS
    • SSRS
    • T-SQL
  • Interview Questions
    • MS SQL DBA
    • SSIS
    • SSRS
    • T-SQL
  • How To
    • MS SQL DBA
    • SSIS
    • SSRS
    • T-SQL
  • Contact


Posts in the [ T-SQL ] Category

Leading Zeros

On 04 Oct, 2015
T-SQL
By : Dave Jenkins
No Comments

I was recently asked to append some leading zeros to a column in a data set. I found one solution which was quick and simple....
Read More

Enabling CLR Integration

On 13 Sep, 2015
MS SQL DBA, T-SQL
By : Charith Silva
No Comments

The common language runtime (CLR) integration feature in SQL Server is off by default, Below SQL Script will help you to enabled CLR in order to use objects that are implemented using CLR integration. When CLR feature enabled in SQL...

Read More

T-SQL Divide by Zero Error

On 31 May, 2015
T-SQL
By : Dave Jenkins
No Comments

Someone in my day job this week asked me how to deal with Msg 8134, Level 16, State 1, Line 3 Divide by zero error encountered error that they were receiving. It's second nature for me to add the below...

Read More

Removing duplicates from a table

On 12 May, 2015
T-SQL
By : Dave Jenkins
No Comments

So in my day job I was asked to investigate why some data was not matching up. After a bit of investigation I found a table that had 90-95% of it's records duplicated, so I needed a way of removing...

Read More

Remove the time from a DATETIME

On 11 May, 2015
T-SQL
By : Dave Jenkins
No Comments

I've seen alot of questions around the internet about how to remove the time portion from a date. I've provided two ways of doing this below that you can use.
The first uses a CONVERT method, however, CONVERT is...

Read More

Simple Recursive CTE to create a tally table

On 08 May, 2015
T-SQL
By : Dave Jenkins
No Comments

A tally table is a table that contains a series of sequential numbers used as a base table to create other data sets such as calendars. There are many ways to create a tally table but I prefer the way...

Read More

Last Modified date of SQL Server Agent Job schedules

On 07 May, 2015
T-SQL
By : Dave Jenkins
No Comments

As a follow on to yesterdays code snippet about finding the last modified date of SQL Server Agent Jobs, I thought I would apply the same code to find the last modified date of SQL Server Agent Job schedules. Always...

Read More

Find the modified date of SQL Server Agents Jobs

On 06 May, 2015
T-SQL
By : Dave Jenkins
No Comments

Earlier on today I really needed to see the last modified date of a job that had been disabled. I didn't know whether it was recent change or whether it was in the distant past. SQL Server Agent Job screen...

Read More

Detecting Duplicates

On 30 Apr, 2015
T-SQL
By : Dave Jenkins
No Comments

There are many ways of detecting duplicate data in your tables. One of the quick and easiest methods I have found is to use the below syntax.

It will return a list of duplicate entries by the...

Read More

Get row count of all user tables in the entire SQL Server instance

On 22 Apr, 2015
MS SQL DBA, T-SQL
By : Charith Silva
No Comments

  Sometime you might want to get row counts for all the tables in the entire SQL server. It might help you to identify large tables and tables have no records. Following script will help you to Get row count of...

Read More

  • Page 1 of 2
  • 1
  • 2


  • Popular
  • Recent
  • Database stuck in “Restoring” state

    17739 views
  • Find the modified date of SQL Server Agents Jobs

    8530 views
  • Script to Check TempDB Speed

    4693 views
  • PING all the Linked Servers and get a status report

    4364 views
  • Log shipping Alerts failing to send emails

    4229 views
  • Moving the tempdb database

    27 Jan, 2016
  • Script to Check TempDB Speed

    14 Jan, 2016
  • SQL Server buffer pool

    05 Nov, 2015
  • Log shipping Alerts failing to send emails

    04 Nov, 2015
  • View queries waiting for memory grant

    21 Oct, 2015

Useful links

  • Books Online for SQL Server 2012
  • Developer Reference for SQL Server 2014
  • Download SQL Server
  • Installation for SQL Server 2012
  • Microsoft Virtual Academy
  • SQL Server Online Training
  • Transact-SQL Reference
  • Tutorials for SQL Server 2012

Tags

.CSV 70-461 AdventureWorks 2012 ALL ANY CAST Chinook Database Code Snippet CONVERT CTE dataset datasource Dates DATETIME divide by zero Duplicates Exam EXCEPT expressions FORMAT IF Import Indexes INTERSECT Jobs NULLIF REBUILD Recursive CTE REORGANIZE ROW_NUMBER() Schedules Sequence SOME sp_stop_job SQL Server 2012 SQL Server Agent SSIS SSRS T-SQL Tally Table T_SQL UAC Permissions Error UNION UNION ALL

Recent Comments

  • Rudnei Silva on Log shipping Alerts failing to send emails
  • johnson Welch on Database stuck in “Restoring” state
  • Neil on Database stuck in “Restoring” state
  • Mark Gribler on MS SQL Database Administrator Interview Questions – Part 4

Google Analytics Stats

Latest Tweets:

  • 6 years ago Attended @SQLSatMcr yesterday - it was amazing! Roll on @sqlsatcambs! Won some Beats Headphones courtesy of @SQLDBApros - thanks guys! :)
  • 6 years ago Looking forward to attending @SQLSatMcr - its too far off though!!!
  • 6 years ago Simple Post: WhoIsActive SPROC: http://t.co/LZvQUaeapK
  • 6 years ago POST: Index REBUILD or Index REORGANIZE: http://t.co/h3L0N37vw4
  • 6 years ago How to Ping all Linked Servers: http://t.co/Q2QxusrKjO
  • 6 years ago For beginners - T-SQL Divide by Zero Error: http://t.co/BBhgoH5hK9

© Copyright 2015 SQL Repository. All Rights Reserved by SQL Repository