|
|
-
|
|
This follows my other three posts at http://beyondrelational.com/blogs/madhivanan/archive/2011/05/03/sql-server-s-equivalent-of-oracle-functions-part-i.aspx http://beyondrelational.com/blogs/madhivanan/archive/2011/05/03/sql-server-s-equivalent-of-oracle-functions-part-ii.aspx http://beyondrelationa......
|
|
-
|
|
This follows my other two posts at http://beyondrelational.com/blogs/madhivanan/archive/2011/05/03/sql-server-s-equivalent-of-oracle-functions-part-i.aspx http://beyondrelational.com/blogs/madhivanan/archive/2011/05/03/sql-server-s-equivalent-of-oracle-functions-part-ii.aspx
ORACLE SQL Server
......
|
|
-
|
|
The unique identifier datatype is used to uniquely identify a row across various databases in the network. The value has 36 characters inclusive of digits from 0 to 9,alphabets from A to F and hypen. Suppose you have a string of 36 characters and want to know if it is really an uniqueidentifier. You......
|
|
-
|
|
This follows my part I at http://beyondrelational.com/blogs/madhivanan/archive/2011/05/03/sql-server-s-equivalent-of-oracle-functions-part-i.aspx
ORACLE SQL Server
Decompose Cast or Convert (Ex cast(string as nvarchar(8000))
numtodsinterval select datename(dayofyear,DATE)-1,CONVERT(varchar(......
|
|
-
|
|
You can change the datatype of the column with ALTER statement. You may think that it will never change the column values. But there are some cases where altering a datatype can cause changing the value of the column. Consider the following table
create table test(id int, dates varchar(100))
in......
|
|
-
|
|
When I was viewing someone's code, I have noticed that the date values were not
compared as dates but they were converted to varchar before comparision
Suppose, you want find out the objects that were created in February 2011. The correct
code is
select
name
from
......
|
|
-
|
|
I have already posted two posts about extracting numbers from a string
http://beyondrelational.com/blogs/madhivanan/archive/2007/12/18/extract-only-numbers-from-a-string.aspx
http://beyondrelational.com/blogs/madhivanan/archive/2010/04/22/extracting-numbers-part-2.aspx
Loana in her blog ......
|
|
-
|
|
Someone in the forums asked for finding out a string in which each character is same. Consider the following example
declare @t table(data varchar(20))
insert into @t
select '222222222222' as data union all
select '666666663466' union all
select 'aaaaaaaa'+CHAR(32) union all
select 'jjkjkhdg'......
|
|
-
|
|
Both the functions DATENAME and DATEPART are used to extract the informations from the date. However there is a difference between the two in terms of return datatype. DATENAME function always return the varchar datatype whereas DATEPART functions return Integer datatype Consider the following examp......
|
|
-
|
|
Sometimes developers use ordinal number of the column instead of actual column name in the SELECT statement.
For example, consider the following statement
SELECT emp_id, first_name,dob, address from employees
When a front end application executes this statement it receives a resultset from the......
|
|