Monday, 22 October 2012

Diff between SQL Server 2005 and SQL Server 2008

"What is the diff. between Sqlserver 2005 and Sqlserver 2008"?
Here I am going to describe only 3 differences which is related to Declare and Set Keywords of Sql.
Differences 
1. You can declare variable and assign the value without using Set keyword in sqlserver 2008. / but not in 2005
2. You can increment the value like c# @i+=1 in sqlserver 2008. / but not in sqlserver 2005
3. You can put the break point for debug query  in sqlserver 2008. / but not in sqlserver 2005
...many other diff but here is only 3 we describing 
Declare @I int = 1
while(@I<=10)
begin
print @i
set @i+=1
end

Computed Column – PERSISTED and Storage


If we are creating one computed column in the database it won't take more size of that computed column until we give the PERSISTED keyword

It does not increase the data size of the original table as well as it does not turn the column into persisted. When we create an index on the column of the table, there is an additional space occupied by that index.

More Details:
http://blog.sqlauthority.com/2010/08/21/sql-server-computed-column-persisted-and-storage-part-2/