Quick introduction to SQL, databases and relational theory — Parv The IT Geek

Many people find it daunting when they think about Databases and SQL. I know I found it very scary in the beginning and my early experiences with Database developers left me feeling very small and I thought that maybe I was not good enough to succeed in this field. However, I was luckily given aContinue reading “Quick introduction to SQL, databases and relational theory — Parv The IT Geek”

How to change the collation of a database in SQL Server? — Parv The IT Geek

Have you ever wondered how to change the collation for a database in SQL Server? Well the other day I received a database from a third party supplier and the first step was to change the Collation of the database. My questioning about why they would supply the database in the incorrect collation setting wasContinue reading “How to change the collation of a database in SQL Server? — Parv The IT Geek”

Statistical Aggregate functions in SQL Server — Parv The IT Geek

Have you ever wondered how to do program or perform simple statistical function within SQL Server? Well the kind people at Microsoft have enabled us to all to save time by giving us a few inbuilt functions which save us from having to solve them programmatically. I have used the unit Price column in the SalesOrderDetailContinue reading “Statistical Aggregate functions in SQL Server — Parv The IT Geek”

SQL Cursors — Parv The IT Geek

Cursors are a way of manipulating data and interacting with them one at a time. They have a bad reputation within the SQL world as they go against the SET based logic and they can have a very high performance cost. Where possible you should ask yourself whether you could avoid using a Cursor. ThisContinue reading “SQL Cursors — Parv The IT Geek”

TSQL Challenge on BeyondRelational.COM — Parv The IT Geek

I was asked by one of my junior colleagues to help him with a puzzle he had seen on BeyondRelational.COM which I thought would be a nice challenge. I liked the premise of the scenario and I always liked a challenge decided to show my colleague how I would approach and resolve this problem. IContinue reading “TSQL Challenge on BeyondRelational.COM — Parv The IT Geek”

How to attach AdventureWorks 2012 to SQL Server — Parv The IT Geek

Have you ever wanted to install the sample database (AdventureWorks )provided by Microsoft which a lot of the tutorials and books refer to? Well one of my colleagues has started to learn SQL Server so I thought I would knock up a quick guide for him. The correct classical way is to use T-SQL wouldContinue reading “How to attach AdventureWorks 2012 to SQL Server — Parv The IT Geek”

List SQL databases in SQL Server — Parv The IT Geek

Have you ever wanted to list out all the databases you have on a server? Well I am going to show you how to do it quickly and easily. The other day I had completed a migration from a creaky old dinosaur server to a brand new powerful server which always brings a smile onContinue reading “List SQL databases in SQL Server — Parv The IT Geek”

Find todays date & time in SQL Server part 2 — Parv The IT Geek

Have you ever wanted to return the time found in GETDATE or CURRENT_TIMESTAMP to a higher level off accuracy in SQL? Well I am going to show you how. The other day I needed to get the current time to greater accuracy due to the time stamp given to some records and I had toContinue reading “Find todays date & time in SQL Server part 2 — Parv The IT Geek”

Length of LOB data (95563) to be replicated exceeds configured maximum 65536 — Parv The IT Geek

Have you ever had the above error message? Wondered how to sort it out? Well I am going to show you how. Today I was confronted by the above error when a test migration database which was setup with replication was loaded with simulated data. The migration source environment was not replicated so I didContinue reading “Length of LOB data (95563) to be replicated exceeds configured maximum 65536 — Parv The IT Geek”

Find a column in a database with INFORMATION_SCHEMA.COLUMNS — Parv The IT Geek

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 — Parv The IT Geek”