Have you ever wanted to reach the first milestone in programming by writing a Hello World application in C#? Well I am going to show you the script to produce the program. I was asked by a member of our helpdesk team how he could become a programmer. I answered that he should start with… Continue reading Hello World in C#
Have you ever come across the situation where you have data in US format and need it changed to UK format? Well I am going to show you how to use SQL to easily reformat the date. I have had this problem several times in the past dealing with international clients who supply databases with… Continue reading Have you ever wanted to convert a US date to UK format using SQL?
Have you ever wanted to return the value of the current day? Month? Or year? Well its easy in SQL and I am going to show you how. The query for the current day is below. SELECT DAY(GETDATE()) The query for the current month is below. SELECT MONTH(GETDATE()) The query for the current year is… Continue reading Find the current day, month and year in SQL Server
Have you ever wondered how to get the current time and date within SQL Server? Well I am going to show you two easy methods of getting this information. The first method is my preferred method as it’s slightly shorter than the second method. SELECT GETDATE() SELECT CURRENT_TIMESTAMP
Have you ever just been given a column name and not known which table it was in? Needed to check whether a column existed within a database?... Well today I was just given a column name and told the information I needed was in there but alas they didn’t know which table it was in.… Continue reading Find a column in a database with INFORMATION_SCHEMA.COLUMNS
Have you ever been baffled when people talk about SQL joins? Mystified when you hear inner, outer, cross or self? Ran away in fear at the thought of joining two tables? Well I am about to help you out and face down those fears and explain to you what joins are, the different types and… Continue reading SQL JOINS – INNER,OUTER( FULL,LEFT,Right) ,CROSS, SELF
It has become a repeated custom that whenever a person is learning a new programming language that they begin with the Hello World program. This is quite simply a rite of passage and a welcome milestone so I started here and have put the script below. Hopefully in the next few weeks I will be… Continue reading Powershell and my first script for Hello World.
Have you ever wanted to search for a column for a range of values? For example if you were searching for Product ID which ranges from 1 to 300, or look for a range of names starting A to D. Well I can show you how to do these quickly and easily by using the… Continue reading Use SQL to search a column for a range of values
Have you ever been presented with a list of values which need to be found in a column or wondered how to search for a list of exact names, addresses, numbers without using wildcard searches or ranges. Well SQL has the answer and it is the IN command. The above query produces 16 rows of… Continue reading Search for a list of values using the IN command in SQL
Have you ever wanted to find a NULL value or filter out NULL values within a column? Well SQL has the solution and our saviour is the ‘IS NULL’ and ‘IS NOT NULL’ commands. Using them in a ‘WHERE’ clause will allow us to do the filtering out appropriately. The above query bring us a… Continue reading NULL Values – How to filter out NULLS and how to find NULLS using SQL