Geeks With Blogs
Baskar B.V SQL - BI Consultant
Below are the some interesting t-sql enhancements in sql 2008 posted in the web... http://www.sqlservercentral... http://www.sqlservercentral... http://www.sqlservercentral... http://www.sqlservercentral... http://www.sqlservercentral... ......

Below code is to retrieve column of values into one variable without using cursors. declare @col_list varchar(max) set @col_list = '' select @col_list = @col_list + col1 + ', ' from (select column1 as col1 from table1 ) d order by col1 select @col_list = left(@col_list, len(@col_list)-2) ......

Check this link for a great post on index defrag script

http://sqlfool.com/2009/03/automated-index-defrag-script/



After dropping a database you should backup "master" database because deleting database update master database. If not, then if you want to restore "master" at some point then it would have reference to the non-existing databases.



The below query would help if want to convert short month string (e.g) Jan, Feb to full month string (e.g) January, February... Assuming mth_shrt in table1 has value like Jan, Feb, Mar and after the execution of the below query the result would be Result: January February Hope this helps. Post your views on this. select datename(month,convert(varc... ......

Copyright © Baskar B.V | Powered by: GeeksWithBlogs.net