|
|
-
|
|
Pinal Dave (Blog|Twitter), Blogger,Author, Evangelist and Speaker, posted a blog post about Reseting Identity Values for All Tables. He has used the undocumented system stored procedure to perform this. As you know sp_MSForEachTable is undocumented and ...
|
|
-
|
|
Handling DATETIME values in the queries is often challenging due to various factors which include choosing wrong datatype(VARCHAR instead of DATETIME),formatting in sql,expressing values in regional specific format,removing time part,etc.
Well. Here is...
|
|
-
|
|
I saw this question
"Date d = new SimpleDateFormat("MM/dd/yyyy").parse("22/44/2008") will return Nov 13, 2009 as the date! Really? 22 is what month?"
The code is written in Java and the user is surprised to see the result and wonders if 22 is a month.
...
|
|
-
|
|
One of my collegues told me that while we cannot use a temporary table created inside dynamic sql out of it, in a similar way it is not possible inside dynamic sql to access a temporary table created out of dynamic sql. How many of you think this is tru...
|
|
-
|
|
As you know NULL is the absence of data and any datatype can be NULL. But by default a NULL value is considered to be of INT datatype. Let us run the following code
select null as t into #t
GO
exec tempdb..sp_help #t
A NULL value is copied to a temporary table #t. Second resultset of sp_help ......
|
|
-
|
|
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......
|
|
-
|
|
There was a question in the forum on how to Sort mixed value strings “numerically”
Consider the following set of datacreate table #test(val varchar(10))
insert into #test
select '1002' union all
select '29C' union all
select '1' union all
select '205' u...
|
|
-
|
|
In Query Analyser, set the result mode to Text (Press CTRL+T), execute the following code and see the result. set nocount on
select
space(total-len(replicate(char(characters),no)))+ replicate(char(characters),no*2-1)
from
(
...
|
|
-
|
|
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....
|
|
-
|
|
Often you may come across a situation to calculate time values which are stored as numbers. There is a seperate TIME datatype to store time values starting from SQL Server 2008. But you might find that in earlier versions time values might be stored in ...
|
|