|
|
-
|
|
BULK INSERT is used to insert data to a table from a text file. Only problem with it is that it is not possible to specify the columns that you want data to be imported. For example the table has 4 columns whereas there are data for 2 columns in the text file. Consider the following dataSource data ......
|
|
-
|
|
Often, you are advised not to use * in your SELECT statement. It is because the code that depends on * may be broken if a column is added or removed. If you have a view that uses *, it will not reflect newly added/removed column until the view is ...
|
|
-
|
|
I have posted a blog post about Different ways to remove TIME part from DATETIME values where I have shown six different ways to remove TIME part. Some of the regular users posted some alternate methods. Here is the analysis of how long each method take...
|
|
-
|
|
Well. You can express numbers in scientific form. ExampleSELECT 2E
returns 2 SELECT 3E
returns 3
Now what does the following select statement return?SELECT 2E-3ETRY to answer this question without running it....
|
|
-
|
|
I have already posted blog posts regarding the proper usage of the alias name
http://beyondrelational.com/blogs/madhivanan/archive/2007/11/14/should-alias-names-be-preceded-by-as.aspx http://beyondrelational.com/blogs/madhivanan/archive/2008/09/09/should-alias-names-be-preceded-by-as-part-2.aspx T......
|
|
-
|
|
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 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 question for July 2012 at Question of the month July 2012 - How does COALESCE(null,null+1,null) work? Did you know why the second query works without any error?
A NULL value can be of two types. Typed NULL and non-Typed NULL.
SELECT SUM...
|
|
-
|
|
Often you see people complaining that although the file exists in the directory, the code throws an error Operating system error 2(The system cannot find the file specified.). Ok. The following need the file path to be specified in the code
1 Backup/Res...
|
|
-
|
|
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...
|
|