|
|
-
|
|
Often I see lot of SQL deveopers complaining about the error when using datetime values in their queries. The common error that almost everyone would heard about is "Conversion failed when converting date and/or time from character string."
But in gener...
|
|
-
|
|
I have started a series on Exploring SSIS where I will explain various features available. In this post, we will see the usage of Execute SQL task in Control flow Execute SQL task is primarily used to execute SQL statements and stored procedures with o...
|
|
-
|
|
Consider the following CREATE TABLE statementsCREATE TABLE emp1(emp_id int,)
GO
CREATE TABLE emp2(emp_id int,first_name varchar(50),)
GONote that there is extra comma after the datatype of last column. But SQL Server ignores it and execute them without ...
|
|
-
|
|
SQL Server Integration Services (SSIS) is one of the tools that can be effectively used to transfer data to various destinations. In versions prior to 2005, we had Import/Export wizard which was part of Database Engine and a package would be created bas...
|
|
-
|
|
I have posted a blog post about Different ways to find DISTINCT values where I have shown six different ways to find DISTINCT values. Here is the analysis of how long each method takes.
Create a temporary table named #sales_detailscreate table #sales_de...
|
|
-
|
|
There was a question in the SQL forums that the user wanted to remove leading zeroes in the numbers from a varchar column. The column will have numbers, alphabets or alpha-numeric strings. Only numbers should be considered for removing the leading zeroe...
|
|
-
|
|
Finding distinct values is often needed in such cases like finding distinct items that were sold last month, etc. You can very well use DISTINCT keyword to do this. However there are some other ways too to find distinct values
Consider the following set...
|
|
-
|
|
Consider the following set of data and queriesdeclare @t table(item_id int identity(1,1),item varchar(10))
insert into @t(item)
select 'TV' union all
select 'Computer' union all
select 'Laptop' union all
select 'VCD' union all
select 'CD'
--Query 1
de...
|
|
-
|
|
There was a question in the forums where a user asked for a solution to find out the number which is succeeded by the last 0 in that number
For example, in numbers like 10807023 and 1000508, 23 and 8 are the numbers which are succeeded by the last 0 of...
|
|
-
|
|
I see developers often confused on how they get the list of objects by IntelliSense when writing the code. Here are some points on how you can intelligently make use of IntelliSense.
When IntelliSense is enabled, in the query window, type SELECT and a s...
|
|