|
|
-
|
|
You can do conditional aggregation like SUM(CASE WHEN .. THEN 1 ELSE 0 END),....etc to find a count for a particular match. This type of conditions are useful when you want to write a CROSS-TAB/PIVOT Query. You can also make use of COUNT(CASE WHEN .. TH...
|
|
-
|
|
One of my friends asked me if it is possible to load multiple resultsets returned from a stored procedure into a temporary table for some analysis purpose. The answer is "It depends". If all the resultsets return same number of columns then it is possib...
|
|
-
|
|
Assume that you have two identical tables in different servers. The table in production server has 100 million rows and the table in test server is empty and you want to transfer data from production server into test server to do some analysis based on ...
|
|
-
|
|
BCP is one of the fastest methods to export data to various formats like csv,txt,etc and doing this in a command mode is faster than doing it via SSMS.
Let us create this simple tablecreate table test(id int, name varchar(50))
insert into test(id,name)...
|
|
-
|
|
Often developers use Import wizard from SSMS or SSIS to import data from a text file into a table. You may or may not import it successfully based on the nature of the data.
Create a text file named test.txt with the following data
id|name|address1|rame...
|
|
-
|
|
Previous posts on this series
Exploring SSIS - Understanding the basics Exploring SSIS - Execute SQL task with simple parameter Exploring SSIS - Export to csv file Exploring SSIS - Rename file by suffixing current date
I have started a series on Explori...
|
|
-
|
|
When you run the following codeselect name from sys.objects
having 1=1
you get the following error Msg 8120, Level 16, State 1, Line 2
Column 'sys.objects.name' is invalid in the select list because it is not contained in either an aggregate function or...
|
|
-
|
|
Previous posts on this series
Exploring SSIS - Understanding the basics Exploring SSIS - Execute SQL task with simple parameter Exploring SSIS - Export to csv file
I have started a series on Exploring SSIS where I will explain various features available...
|
|
-
|
|
Previous posts on this series
Exploring SSIS - Understanding the basicsExploring SSIS - Execute SQL task with simple parameter
I have started a series on Exploring SSIS where I will explain various features available. In this post, we will see the u...
|
|
-
|
|
I have posted a post on Different ways to find End of the month where I showed you five different ways to find out last day of a month. Here is the analysis on how long each method takes to executeI am not using any physical table to store dates and the...
|
|