<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblogcasts.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Tomaz.tsql </title><subtitle type="html" /><id>http://sqlblogcasts.com/blogs/tomaztsql/atom.aspx</id><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/tomaztsql/default.aspx" /><link rel="self" type="application/atom+xml" href="http://sqlblogcasts.com/blogs/tomaztsql/atom.aspx" /><generator uri="http://communityserver.org" version="3.1.20917.1142">Community Server</generator><updated>2011-01-18T23:03:00Z</updated><entry><title>viewing files on disk</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2013/01/01/viewing-files-on-disk.aspx" /><id>http://sqlblogcasts.com/blogs/tomaztsql/archive/2013/01/01/viewing-files-on-disk.aspx</id><published>2013-01-01T18:41:00Z</published><updated>2013-01-01T18:41:00Z</updated><content type="html">From time to time, it is very usefull to see the files on disk (folder, sub-folder, etc.) simple sql query returns the results: EXEC Xp_dirtree &amp;#39;c:\asp&amp;#39;, 1, 1 where &amp;quot;c:\asp&amp;quot; is a folder named &amp;quot;asp&amp;quot; on drive c:\ it will return all files under root folder asp....(&lt;a href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2013/01/01/viewing-files-on-disk.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=16375" width="1" height="1"&gt;</content><author><name>Tomaz.tsql</name><uri>http://sqlblogcasts.com/members/Tomaz.tsql.aspx</uri></author><category term="files" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/files/default.aspx" /><category term="xp_dirtree" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/xp_5F00_dirtree/default.aspx" /></entry><entry><title>happy new year 2013</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2012/12/21/happy-new-year-2013.aspx" /><id>http://sqlblogcasts.com/blogs/tomaztsql/archive/2012/12/21/happy-new-year-2013.aspx</id><published>2012-12-21T18:44:00Z</published><updated>2012-12-21T18:44:00Z</updated><content type="html">with a special new year&amp;#39;s card at: http://www.simple-talk.com/blogs/2012/12/21/rudolph-the-red-nosed-tester-and-other-festive-arrangements/ see you in 2013...(&lt;a href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2012/12/21/happy-new-year-2013.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=16365" width="1" height="1"&gt;</content><author><name>Tomaz.tsql</name><uri>http://sqlblogcasts.com/members/Tomaz.tsql.aspx</uri></author><category term="t-sql new year's card" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/t-sql+new+year_2700_s+card/default.aspx" /><category term="2013" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/2013/default.aspx" /></entry><entry><title>Delete trigger does not catch table truncation</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2012/08/30/delete-trigger-does-not-catch-table-truncation.aspx" /><id>http://sqlblogcasts.com/blogs/tomaztsql/archive/2012/08/30/delete-trigger-does-not-catch-table-truncation.aspx</id><published>2012-08-30T07:37:00Z</published><updated>2012-08-30T07:37:00Z</updated><content type="html">Sample shows table truncation will not fire delete trigger. USE AdventureWorks; GO -- STAGING IF EXISTS (SELECT * FROM sys.objects WHERE name = &amp;#39;est_del_trigger_log&amp;#39; AND type = &amp;#39;U&amp;#39;) DROP TABLE test_del_trigger_log; GO IF EXISTS (SELECT * FROM sys.objects WHERE name = &amp;#39;est_del_trigger&amp;#39; AND type = &amp;#39;U&amp;#39;) DROP TABLE test_del_trigger; GO CREATE TABLE test_del_trigger (id INT IDENTITY(1,1) ,tkt VARCHAR(10) CONSTRAINT pk_test_del_trigger PRIMARY KEY (id) ); GO INSERT INTO...(&lt;a href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2012/08/30/delete-trigger-does-not-catch-table-truncation.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=16299" width="1" height="1"&gt;</content><author><name>Tomaz.tsql</name><uri>http://sqlblogcasts.com/members/Tomaz.tsql.aspx</uri></author></entry><entry><title>simple word randomization based on dictionary</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2012/01/01/simple-word-randomization-based-on-dictionary.aspx" /><id>http://sqlblogcasts.com/blogs/tomaztsql/archive/2012/01/01/simple-word-randomization-based-on-dictionary.aspx</id><published>2012-01-01T16:00:00Z</published><updated>2012-01-01T16:00:00Z</updated><content type="html">Based on list of words, one can randomize the letters in the word using simple cross apply. ;with dictionary as ( select &amp;#39;soundgarden&amp;#39; as word union all select &amp;#39;impossible&amp;#39; as word union all select &amp;#39;apple&amp;#39; as word union all select &amp;#39;microsoft&amp;#39; as word union all select &amp;#39;mices&amp;#39; as word union all select &amp;#39;ITCrowds&amp;#39; as word ) select t1.word ,x.n from dictionary as t1 cross apply ( select substring(t1.word,sv.number,1) from master..spt_values as sv where sv...(&lt;a href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2012/01/01/simple-word-randomization-based-on-dictionary.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=16047" width="1" height="1"&gt;</content><author><name>Tomaz.tsql</name><uri>http://sqlblogcasts.com/members/Tomaz.tsql.aspx</uri></author><category term="with" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/with/default.aspx" /><category term="for xml path" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/for+xml+path/default.aspx" /><category term="cross apply" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/cross+apply/default.aspx" /></entry><entry><title>CTP3</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/07/22/ctp3.aspx" /><id>http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/07/22/ctp3.aspx</id><published>2011-07-22T05:25:00Z</published><updated>2011-07-22T05:25:00Z</updated><content type="html">I must admit that CTP3 Denaliwill bring some usefull T-SQL features. which i&amp;#39;m looking forward very much and just can&amp;#39;t wait for the final release....(&lt;a href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/07/22/ctp3.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=15795" width="1" height="1"&gt;</content><author><name>Tomaz.tsql</name><uri>http://sqlblogcasts.com/members/Tomaz.tsql.aspx</uri></author></entry><entry><title>Reoccuring visits</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/07/05/reoccuring-visits.aspx" /><id>http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/07/05/reoccuring-visits.aspx</id><published>2011-07-05T17:23:00Z</published><updated>2011-07-05T17:23:00Z</updated><content type="html">Itzik Ben-Gan posted this game on SQL magazine previous week, stating: The challenge is to write a query that works with two input arguments @from and @to holding the start and end dates of a date range, and calculates, for each day, various statistics in respect to the previous day. Specifically, how many visitors visited the site that day, how many new visitors were added compared to the previous day, how many visitors were removed compared to the previous day, and how many remained. For the given...(&lt;a href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/07/05/reoccuring-visits.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=15747" width="1" height="1"&gt;</content><author><name>Tomaz.tsql</name><uri>http://sqlblogcasts.com/members/Tomaz.tsql.aspx</uri></author><category term="CTE" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/CTE/default.aspx" /><category term="with" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/with/default.aspx" /><category term="DDL" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/DDL/default.aspx" /><category term="solution" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/solution/default.aspx" /></entry><entry><title>DateTime Tally Table</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/07/04/datetime-tally-table.aspx" /><id>http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/07/04/datetime-tally-table.aspx</id><published>2011-07-04T20:15:00Z</published><updated>2011-07-04T20:15:00Z</updated><content type="html">Five ways to generate Date Tally Table: -- 1. way ;create table tc..dt (id int identity(1,1) ,dt datetime) insert into dt(dt) select a.dt+b.number as dt from (select cast(&amp;#39;2010/12/31&amp;#39; as datetime) as dt ) as a cross join master..spt_values as b where type = &amp;#39;P&amp;#39; and number between 1 and 365 -- 2. way ;create table tc..dt (id int identity(1,1) ,dt datetime) ;with tab as ( select cast(&amp;#39;2011-1-1&amp;#39; as datetime) as dt, 1 as rn union all select dateadd(day,1,dt) as dt,rn + 1 as rn...(&lt;a href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/07/04/datetime-tally-table.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=15745" width="1" height="1"&gt;</content><author><name>Tomaz.tsql</name><uri>http://sqlblogcasts.com/members/Tomaz.tsql.aspx</uri></author><category term="with" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/with/default.aspx" /><category term="while loop" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/while+loop/default.aspx" /><category term="insert into" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/insert+into/default.aspx" /><category term="spt_values" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/spt_5F00_values/default.aspx" /><category term="datetime" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/datetime/default.aspx" /><category term="Tally table" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/Tally+table/default.aspx" /></entry><entry><title>SQL Bits VII</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/02/20/sql-bits-vii.aspx" /><id>http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/02/20/sql-bits-vii.aspx</id><published>2011-02-20T08:40:00Z</published><updated>2011-02-20T08:40:00Z</updated><content type="html">I was very happy to dive in into SQL Bits VII. Several interesting presentations, interesting concepts, advices and most of all interesting people. Some things actually disturb me. 1. the outlook of all presentations. I would recommend to have standardized outlook of all presentations for each of the presenter. Meaning, to have a general rules of PPT design (fonts, views, etc.), general diagrams, pictures that can be used by everyone (something like techEd introduced as well as SQL PASS). 2. access...(&lt;a href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/02/20/sql-bits-vii.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=15421" width="1" height="1"&gt;</content><author><name>Tomaz.tsql</name><uri>http://sqlblogcasts.com/members/Tomaz.tsql.aspx</uri></author><category term="SQL BITS" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/SQL+BITS/default.aspx" /></entry><entry><title>T-SQL Jokes</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/01/30/t-sql-jokes.aspx" /><id>http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/01/30/t-sql-jokes.aspx</id><published>2011-01-30T21:59:00Z</published><updated>2011-01-30T21:59:00Z</updated><content type="html">SQL Table walks to a psychiatrist dr. Index Table: &amp;quot;Doctor, I have a problem&amp;quot; Dr: &amp;quot;what kind a problem?&amp;quot; Table: &amp;quot;I&amp;#39;m a mess. I have things all over the place, i always look for my stuff&amp;quot; Dr. &amp;quot;No problem. I will get you in order&amp;quot;. Index and table are reading a book &amp;quot;index-sutra&amp;quot; Table: Oh, baby tonight we can try a clustered position&amp;quot; Index: &amp;quot;yeah baby, we can also try covered position&amp;quot; Table: &amp;quot;or maybe multiple clustered position&amp;quot;...(&lt;a href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/01/30/t-sql-jokes.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=15309" width="1" height="1"&gt;</content><author><name>Tomaz.tsql</name><uri>http://sqlblogcasts.com/members/Tomaz.tsql.aspx</uri></author><category term="sql joke" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/sql+joke/default.aspx" /></entry><entry><title>insert into script</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/01/18/insert-into-script.aspx" /><id>http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/01/18/insert-into-script.aspx</id><published>2011-01-18T22:03:00Z</published><updated>2011-01-18T22:03:00Z</updated><content type="html">My contribution to community http://www.sqlmag.com/article/sql-server/Transfer-small-amount-of-data-by-generating-the-INSERT-INTO-statement.aspx Enjoy!...(&lt;a href="http://sqlblogcasts.com/blogs/tomaztsql/archive/2011/01/18/insert-into-script.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=15256" width="1" height="1"&gt;</content><author><name>Tomaz.tsql</name><uri>http://sqlblogcasts.com/members/Tomaz.tsql.aspx</uri></author><category term="insert into" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/insert+into/default.aspx" /><category term="script" scheme="http://sqlblogcasts.com/blogs/tomaztsql/archive/tags/script/default.aspx" /></entry></feed>