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

Poorly performing queries in SQL Server

On 06 Oct, 2015
MS SQL DBA, T-SQL
By : Charith Silva
No Comments

Today junior Application Developer asked me what are the causes of poor performance queries in SQL Server?  This is a very open ended question and there could be a lot if reasons behind the poor performance of a query....

Read More

Dynamic date range based on todays date

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

I had the challenge of putting together a T-SQL statement that's going to be used in a few stored procedures. The stored procedures will build data based on what todays date is, if today is greater than second Tuesday of...

Read More

70-461 Querying Microsoft SQL Server 2012

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

Introduction

70-461 Querying Microsoft SQL Server 2012 is an exam designed by Microsoft to test the skills and experience of SQL Server users. It's recommended that you have two years experience before sitting the exam, however, it's not a...

Read More

INTERSECT and EXCEPT

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

INTERSECT and EXCEPT are operators within SQL Server that takes data from two queries and compares the results.
INTERSECT returns the distinct values from both the left query and right query.
EXCEPT is different as it returns...

Read More

UNION and UNION ALL

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

UNION and UNION ALL are used for joining two or more datasets together. The datasets need to return the same number of columns. The columns names of all datasets can be different, however, the final results will have their columns...

Read More

FORMAT

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

FORMAT is a function that is used return a NVARCHAR data type from a date/time or number. You can still use CAST or CONVERT for these and all other conversions. FORMAT is just another option that was introduced in SQL...

Read More

ANY, SOME and ALL

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

The SOME, ANY and ALL are logical operators that compare against a scalar value. This article is a simple overview of how they work.

Sample Data

[crayon-62858699da1c7214576085/]

SOME and ANY:

[crayon-62858699da1cd601273832/] Results: [crayon-62858699da1d0409526367/] If the 50000 in the WHERE clause is...

Read More

SEQUENCE

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

Within SQL Server, SEQUENCE is a numeric order that has been defined by it's creator. The SEQUENCE can be generated in either an ascending or descending order, it can have intervals (gaps) within it's numbers and it can restart itself...

Read More



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

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

    10396 views
  • Script to Check TempDB Speed

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

    5123 views
  • Log shipping Alerts failing to send emails

    4929 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:

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

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