<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Max Donati&#039;s Weblog</title>
	<atom:link href="http://maxdonati.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://maxdonati.wordpress.com</link>
	<description>Deliri Digitali dalla vita di uno di passaggio...</description>
	<lastBuildDate>Thu, 03 Nov 2011 08:58:10 +0000</lastBuildDate>
	<language>it</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='maxdonati.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/b7444f04f881dbb71b3e92f554b22cb9?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Max Donati&#039;s Weblog</title>
		<link>http://maxdonati.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://maxdonati.wordpress.com/osd.xml" title="Max Donati&#039;s Weblog" />
	<atom:link rel='hub' href='http://maxdonati.wordpress.com/?pushpress=hub'/>
		<item>
		<title>controllo del nodo in caso di fail over su un cluster SQL</title>
		<link>http://maxdonati.wordpress.com/2011/10/10/controllo-del-nodo-in-caso-di-fail-over-su-un-cluster-sql/</link>
		<comments>http://maxdonati.wordpress.com/2011/10/10/controllo-del-nodo-in-caso-di-fail-over-su-un-cluster-sql/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 23:10:17 +0000</pubDate>
		<dc:creator>maxdonati</dc:creator>
				<category><![CDATA[Server che passione]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[Utilità]]></category>

		<guid isPermaLink="false">http://maxdonati.wordpress.com/?p=139</guid>
		<description><![CDATA[come controllare quando uno dei nodi del cluster cade? prendendo (molto) spunto da un articolo apparso su SQLSERVER Central (sempre sia lodato) ho creato un pò di codice che verifica il nodo su cui l&#8217;istanza attuale sta girando. in questa &#8230; <a href="http://maxdonati.wordpress.com/2011/10/10/controllo-del-nodo-in-caso-di-fail-over-su-un-cluster-sql/">Leggi l'articolo completo <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=139&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>come controllare quando uno dei nodi del cluster cade?</p>
<p>prendendo (molto) spunto da un articolo apparso su <a title="Automatic Alert Generation in the event of SQL Server Cluster Failover" href="http://www.sqlservercentral.com/articles/Clustering/75225/" target="_blank">SQLSERVER Central</a> (sempre sia lodato) ho creato un pò di codice che verifica il nodo su cui l&#8217;istanza attuale sta girando.</p>
<p>in questa maniera è possibile confrontarla con una precedentemente salvata e poi decidere se inviare alert o quant&#8217;altro..</p>
<p>tutto si basa su questa riga di codice</p>
<pre>exec master..xp_regread 'HKEY_LOCAL_Machine',
	'SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\',
	'ComputerName'</pre>
<p>che permette di capire il nome macchina sulla quale sta girando attualmente il codice lanciato.</p>
<p>giocando un pò è venuto fuori il codice qui sotto:</p>
<p>se non la trova, crea una tabella nel MSDB chiamata UT_DBParameter</p>
<p>esegue poi il codice di cui sopra andando ad estrapolare il nome del nodo sulla quale sta girando l&#8217;istanza.</p>
<p>se questo è diverso da quello memorizzato allora invio una mail di allerta e memorizzo il nome del nodo attuale nella riga della mia istanza nella tabella UT_DBParameter</p>
<pre>DECLARE @previous Nvarchar(50)
DECLARE @Actual Nvarchar(50)

DECLARE @Sbj NVarChar(200)
Set @Sbj ='IStanza ' + @@SERVERNAME
DECLARE @Bdy NVarChar(4000)
DECLARE @OperatorEmail nvarchar(100)
Set @OperatorEmail = (select email_address from msdb.dbo.sysoperators where name = 'operatore')   --** 

IF OBJECT_ID('MSDB..UT_DBParameters') is null
	BEGIN
		CREATE TABLE UT_DBParameters
		(
		Parametro NVARCHAR(50),
		Valore NVARCHAR(50)
		)
	END	

SELECT @previous = isnull(Valore,'') FROM UT_DBParameters
WHERE Parametro = @@ServerName

IF OBJECT_ID('tempdb..#PHYSICALHOSTNAME') is not null
	BEGIN
		drop table #PHYSICALHOSTNAME
	END	

CREATE TABLE #PHYSICALHOSTNAME
(
VALUE VARCHAR(30),
CURRENT_ACTIVE_NODE VARCHAR(30)
)

INSERT #PHYSICALHOSTNAME
exec master..xp_regread 'HKEY_LOCAL_Machine',
'SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\',
'ComputerName'

SELECT @Actual=CURRENT_ACTIVE_NODE FROM #PHYSICALHOSTNAME

IF  @previous &lt;&gt; @Actual
	BEGIN

		SET @Bdy = CHAR(13) + 'Istanza ' + @@SERVERNAME + ' passata dal nodo ' + @previous + ' al nodo ' + @Actual

		IF @Previous &lt;&gt; ''
			EXEC msdb.dbo.sp_send_dbmail  -- ***
					@profile_name = '4tsmailrobot'
					,@recipients = @OperatorEmail
					,@body = @Bdy
					,@subject = @Sbj

		Update Msdb..UT_DBParameters
		Set Valore = @Actual
		WHERE Parametro = @@ServerName

	END</pre>
<p>NOTA</p>
<p>**operatore va sostituito con un operator valido per il server</p>
<p>*** si presuppone che il servizio di invio mail sia configurato..</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maxdonati.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maxdonati.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maxdonati.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maxdonati.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maxdonati.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maxdonati.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maxdonati.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maxdonati.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maxdonati.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maxdonati.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maxdonati.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maxdonati.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maxdonati.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maxdonati.wordpress.com/139/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=139&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maxdonati.wordpress.com/2011/10/10/controllo-del-nodo-in-caso-di-fail-over-su-un-cluster-sql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dac287ff2811a6bf15fc2190b1854627?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maxdonati</media:title>
		</media:content>
	</item>
		<item>
		<title>Conversione di un file di testo da UNIX a DOS/WINDOWS e Viceversa</title>
		<link>http://maxdonati.wordpress.com/2011/10/03/conversione-di-un-file-di-testo-da-unix-a-doswindows-e-viceversa/</link>
		<comments>http://maxdonati.wordpress.com/2011/10/03/conversione-di-un-file-di-testo-da-unix-a-doswindows-e-viceversa/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 17:10:06 +0000</pubDate>
		<dc:creator>maxdonati</dc:creator>
				<category><![CDATA[Batch Caverna]]></category>
		<category><![CDATA[Utilità]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://maxdonati.wordpress.com/?p=135</guid>
		<description><![CDATA[ottimissimo tool.. http://www.sg-chem.net/u2win/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=135&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>ottimissimo tool..</p>
<p>http://www.sg-chem.net/u2win/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maxdonati.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maxdonati.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maxdonati.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maxdonati.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maxdonati.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maxdonati.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maxdonati.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maxdonati.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maxdonati.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maxdonati.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maxdonati.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maxdonati.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maxdonati.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maxdonati.wordpress.com/135/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=135&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maxdonati.wordpress.com/2011/10/03/conversione-di-un-file-di-testo-da-unix-a-doswindows-e-viceversa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dac287ff2811a6bf15fc2190b1854627?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maxdonati</media:title>
		</media:content>
	</item>
		<item>
		<title>Salvare le stored procedure di un Server SQL</title>
		<link>http://maxdonati.wordpress.com/2011/08/27/salvare-le-stored-procedure-di-un-server-sql/</link>
		<comments>http://maxdonati.wordpress.com/2011/08/27/salvare-le-stored-procedure-di-un-server-sql/#comments</comments>
		<pubDate>Sat, 27 Aug 2011 01:32:08 +0000</pubDate>
		<dc:creator>maxdonati</dc:creator>
				<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://maxdonati.wordpress.com/?p=132</guid>
		<description><![CDATA[da quando ho iniziato a scrivere stored per SQL ho avut il problema di tenere da qualche parte che non fosse SQL le stored che scrivevo. così mi son messo di buona lena ed approfittando di una sera con la &#8230; <a href="http://maxdonati.wordpress.com/2011/08/27/salvare-le-stored-procedure-di-un-server-sql/">Leggi l'articolo completo <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=132&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>da quando ho iniziato a scrivere stored per SQL ho avut il problema di tenere da qualche parte che non fosse SQL le stored che scrivevo.<br />
così mi son messo di buona lena ed approfittando di una sera con la signora in ferie (sì lo sò c&#8217;è altro da fare ma tant&#8217;è.. ) ho scritto un pò di righe</p>
<p>ed eccole qua, quando imparerò a copincollare per bene il codice dentro sto blocco appunti che è il mio blog sarà anche un pò più leggibile..</p>
<p>Max</p>
<p>&nbsp;</p>
<pre>PROCEDURE [dbo].[Uds_Save_Stored_Procedure]
AS
DECLARE @StrSQL NVarChar(400)
DECLARE @Db NVarChar(400)
DECLARE @Sp NVarChar(400)
DECLARE @i int
DECLARE @I_SP Int
DECLARE @cmd NVarChar(1000)
DECLARE @Path NVarChar(1000)
Set @path ='c:\trace\'
BEGIN
SET NOCOUNT ON;
SET @StrSQL = ' IF OBJECT_ID(''tempdb.dbo.##DB_List'') IS NOT NULL' + CHAR(13)
+ ' DROP TABLE ##DB_List ' + CHAR(13) + CHAR(13)
+ ' CREATE TABLE ##DB_List (' + CHAR(13)
+ ' id int identity(1,1)' + CHAR(13)
+ ' ,DB nvarchar(max)' + CHAR(13)
+ ' )' + CHAR(13) + CHAR(13)
+ ' Insert Into ##DB_List (DB)' + CHAR(13)
+ ' SELECT name ' + CHAR(13)
+ ' FROM master..sysdatabases' + CHAR(13)
+ ' where name not in (''master'',''tempdb'',''model'',''msdb'')' + CHAR(13)
--PRINT @strsql
EXEC sp_executesql @strsql
SET @StrSQL = ' IF OBJECT_ID(''tempdb.dbo.##SP_List'') IS NOT NULL' + CHAR(13)
+ ' DROP TABLE ##SP_List ' + CHAR(13) + CHAR(13)
+ ' CREATE TABLE ##SP_List (' + CHAR(13)
+ ' id int identity(1,1)' + CHAR(13)
+ ' ,DB nvarchar(max)' + CHAR(13)
+ ' ,SP nvarchar(max)' + CHAR(13)
+ ' )' + CHAR(13) + CHAR(13)
--PRINT @strsql
EXEC sp_executesql @strsql
SET @i = 0
select top 1 @i = id
from ##DB_List
where id &gt; @i
order by id
While @@Rowcount = 1
BEGIN
select @db = DB
from ##DB_List
where id = @i
SET @StrSQL = ' USE [' + @Db + ']' + CHAR(13) + CHAR(13)
+' Insert into ##SP_List (DB,SP)' + Char(13)
+' SELECT ''' + @db +''' ,name' + Char(13)
+' FROM sys.objects' + Char(13)
+' WHERE type = ''P''' + Char(13)
+' AND left(name,3) ''sp_''' + Char(13)
+' AND left(name,3) ''dt_''' + Char(13)
+' AND left(name,7) ''aspnet_''' + Char(13)
EXEC sp_executesql @strsql
--PRINT @strSQL
select top 1 @i = id
from ##DB_List
where id &gt; @i
order by id
END
SET @i = 0
select top 1 @i = id
from ##SP_List
where id &gt; @i
order by id
While @@Rowcount = 1
BEGIN
select @db = DB, @sp = SP
from ##SP_List
where id = @i
SET @strSQL = ' Use [' + @Db + ']' + char(13) + char(13)
+ ' IF OBJECT_ID(''tempdb.dbo.##sp_helptext'') IS NOT NULL' + char(13)
+ ' drop table ##sp_helptext ' + char(13)
+ ' create table ##sp_helpText (' + char(13)
+ ' id int identity(1,1)' + char(13)
+ ' ,tmptext nvarchar(max))' + char(13) + char(13)
+ ' insert into ##sp_helptext exec sp_helptext ['+ @Sp +']'+ char(13)
--PRINT @strsql
EXEC sp_executesql @strsql
set @i_sp = 0
select top 1 @i_sp = id
from ##sp_helpText
where id &gt; @i_sp
order by id
while @@rowcount = 1
BEGIN
SELECT @cmd = 'echo ' + left(tmptext,LEN(tmptext)-2) + ' &gt;&gt; '+ @Path + '[' + @db + '].dbo.[' + @Sp + '].sql'
from ##sp_helpText
where id = @i_sp
--PRINT @cmd
exec master..xp_cmdshell @cmd
select top 1 @i_sp = id
from ##sp_helpText
where id &gt; @i_sp
order by id
END
select top 1 @i = id
from ##SP_List
where id &gt; @i
order by id
END
END</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maxdonati.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maxdonati.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maxdonati.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maxdonati.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maxdonati.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maxdonati.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maxdonati.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maxdonati.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maxdonati.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maxdonati.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maxdonati.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maxdonati.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maxdonati.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maxdonati.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=132&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maxdonati.wordpress.com/2011/08/27/salvare-le-stored-procedure-di-un-server-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dac287ff2811a6bf15fc2190b1854627?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maxdonati</media:title>
		</media:content>
	</item>
		<item>
		<title>T-SQL usare una variabile nel predicato IN()</title>
		<link>http://maxdonati.wordpress.com/2011/06/21/t-sql-usare-una-variabile-nel-predicato-in/</link>
		<comments>http://maxdonati.wordpress.com/2011/06/21/t-sql-usare-una-variabile-nel-predicato-in/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 07:40:39 +0000</pubDate>
		<dc:creator>maxdonati</dc:creator>
				<category><![CDATA[Dove Stiamo Andando?]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://maxdonati.wordpress.com/?p=129</guid>
		<description><![CDATA[Articolo interessantissimo che ho letto solo velocemente. da commentare appena possibile. Link<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=129&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Articolo interessantissimo che ho letto solo velocemente. da commentare appena possibile.</p>
<p><a title="Sql Server Central" href="http://www.sqlservercentral.com/articles/T-SQL/73838/">Link</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maxdonati.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maxdonati.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maxdonati.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maxdonati.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maxdonati.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maxdonati.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maxdonati.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maxdonati.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maxdonati.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maxdonati.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maxdonati.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maxdonati.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maxdonati.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maxdonati.wordpress.com/129/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=129&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maxdonati.wordpress.com/2011/06/21/t-sql-usare-una-variabile-nel-predicato-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dac287ff2811a6bf15fc2190b1854627?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maxdonati</media:title>
		</media:content>
	</item>
		<item>
		<title>rap futuristico!</title>
		<link>http://maxdonati.wordpress.com/2011/03/08/rap-futuristico/</link>
		<comments>http://maxdonati.wordpress.com/2011/03/08/rap-futuristico/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 18:56:37 +0000</pubDate>
		<dc:creator>maxdonati</dc:creator>
				<category><![CDATA[Dove Stiamo Andando?]]></category>

		<guid isPermaLink="false">http://maxdonati.wordpress.com/?p=127</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=127&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<span style="text-align:center; display: block;"><a href="http://maxdonati.wordpress.com/2011/03/08/rap-futuristico/"><img src="http://img.youtube.com/vi/-T0wpA4I040/2.jpg" alt="" /></a></span>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maxdonati.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maxdonati.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maxdonati.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maxdonati.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maxdonati.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maxdonati.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maxdonati.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maxdonati.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maxdonati.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maxdonati.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maxdonati.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maxdonati.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maxdonati.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maxdonati.wordpress.com/127/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=127&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maxdonati.wordpress.com/2011/03/08/rap-futuristico/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dac287ff2811a6bf15fc2190b1854627?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maxdonati</media:title>
		</media:content>
	</item>
		<item>
		<title>yyyymmddhhnnss difficilissimo in dos script..</title>
		<link>http://maxdonati.wordpress.com/2011/02/24/yyyymmddhhnnss-difficilissimo-in-dos-script/</link>
		<comments>http://maxdonati.wordpress.com/2011/02/24/yyyymmddhhnnss-difficilissimo-in-dos-script/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 17:28:17 +0000</pubDate>
		<dc:creator>maxdonati</dc:creator>
				<category><![CDATA[Batch Caverna]]></category>
		<category><![CDATA[Utilità]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[data ora]]></category>
		<category><![CDATA[dos]]></category>
		<category><![CDATA[utilità]]></category>
		<category><![CDATA[vbscript]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://maxdonati.wordpress.com/?p=122</guid>
		<description><![CDATA[problema, nominare un file o inserire in una variabile di ambiente la data ed ora attuale nel formato: YYYYMMDDHHNNSS di solito è una vera rottura, normalmente si usa un arzigogolo strano utilizzando le variabili d&#8217;ambiente %DATE% e %TIME% che però &#8230; <a href="http://maxdonati.wordpress.com/2011/02/24/yyyymmddhhnnss-difficilissimo-in-dos-script/">Leggi l'articolo completo <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=122&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>problema, nominare un file o inserire in una variabile di ambiente la data ed ora attuale nel formato: YYYYMMDDHHNNSS</p>
<p>di solito è una vera rottura, normalmente si usa un arzigogolo strano utilizzando le variabili d&#8217;ambiente %DATE% e %TIME% che però hanno un difetto, sono localizzate, quindi uno script che funziona su una localizzazione Italiana non funziona su una inglese e viceversa.. che fare in ambienti misti?</p>
<p>ecco la soluzione, uno script e una riga di codice da inserire nel nostro file batch:</p>
<p>create uno script chiamato dataora.vbs quindi inserite all&#8217;interno la seguente stringa</p>
<pre>Wscript.Echo year(now())&amp;right("00"&amp;month(now()),2)&amp;right("00"&amp;day(now()),2)&amp;right("00"&amp;hour(now()),2)&amp;right("00"&amp;minute(now()),2)&amp;right("00"&amp;second(now()),2)</pre>
<p>quindi la riga magica da utilizzare nei vostri batch è la seguente:</p>
<pre>for /F %%a in ('cscript /nologo dataora.vbs ^|find /V ""') DO SET DATAORA=%%a</pre>
<p>&nbsp;</p>
<p>da ora potrete utilizzare la variabile d&#8217;ambiente %DATAORA% contenente la tanto agognata stringa</p>
<p>enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maxdonati.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maxdonati.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maxdonati.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maxdonati.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maxdonati.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maxdonati.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maxdonati.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maxdonati.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maxdonati.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maxdonati.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maxdonati.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maxdonati.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maxdonati.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maxdonati.wordpress.com/122/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=122&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maxdonati.wordpress.com/2011/02/24/yyyymmddhhnnss-difficilissimo-in-dos-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dac287ff2811a6bf15fc2190b1854627?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maxdonati</media:title>
		</media:content>
	</item>
		<item>
		<title>il magico mondo di SQL e XML</title>
		<link>http://maxdonati.wordpress.com/2010/12/28/il-magico-mondo-di-sql-e-xml/</link>
		<comments>http://maxdonati.wordpress.com/2010/12/28/il-magico-mondo-di-sql-e-xml/#comments</comments>
		<pubDate>Tue, 28 Dec 2010 09:03:19 +0000</pubDate>
		<dc:creator>maxdonati</dc:creator>
				<category><![CDATA[Dove Stiamo Andando?]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[t-sql]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://maxdonati.wordpress.com/?p=120</guid>
		<description><![CDATA[creare una struttura dati XML tramite T-SQL? Facile!! metterlo su un file?! Difficilissimo! Ebbene sì è un vero casino, pubblico un link di un articolo per un argomento che approfondirò in quanto davvero interessante. http://www.15seconds.com/issue/001102.htm<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=120&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>creare una struttura dati XML tramite T-SQL?</p>
<p>Facile!! </p>
<p>metterlo su un file?!</p>
<p>Difficilissimo!</p>
<p>Ebbene sì è un vero casino, pubblico un link di un articolo per un argomento che approfondirò in quanto davvero interessante.</p>
<p>http://www.15seconds.com/issue/001102.htm</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maxdonati.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maxdonati.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maxdonati.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maxdonati.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maxdonati.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maxdonati.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maxdonati.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maxdonati.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maxdonati.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maxdonati.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maxdonati.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maxdonati.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maxdonati.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maxdonati.wordpress.com/120/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=120&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maxdonati.wordpress.com/2010/12/28/il-magico-mondo-di-sql-e-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dac287ff2811a6bf15fc2190b1854627?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maxdonati</media:title>
		</media:content>
	</item>
		<item>
		<title>scrivere sul registry via VMI</title>
		<link>http://maxdonati.wordpress.com/2010/12/17/scrivere-sul-registry-via-vmi/</link>
		<comments>http://maxdonati.wordpress.com/2010/12/17/scrivere-sul-registry-via-vmi/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 17:54:00 +0000</pubDate>
		<dc:creator>maxdonati</dc:creator>
				<category><![CDATA[Dove Stiamo Andando?]]></category>

		<guid isPermaLink="false">http://maxdonati.wordpress.com/?p=117</guid>
		<description><![CDATA[riposto il post di active experts http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/registry/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=117&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>riposto il post di active experts</p>
<p>http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/registry/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maxdonati.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maxdonati.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maxdonati.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maxdonati.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maxdonati.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maxdonati.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maxdonati.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maxdonati.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maxdonati.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maxdonati.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maxdonati.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maxdonati.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maxdonati.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maxdonati.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=117&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maxdonati.wordpress.com/2010/12/17/scrivere-sul-registry-via-vmi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dac287ff2811a6bf15fc2190b1854627?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maxdonati</media:title>
		</media:content>
	</item>
		<item>
		<title>Transaction log, questo sconosciuto..</title>
		<link>http://maxdonati.wordpress.com/2010/09/24/transaction-log-questo-sconosciuto/</link>
		<comments>http://maxdonati.wordpress.com/2010/09/24/transaction-log-questo-sconosciuto/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 10:15:52 +0000</pubDate>
		<dc:creator>maxdonati</dc:creator>
				<category><![CDATA[Server che passione]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[Utilità]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[utilità]]></category>

		<guid isPermaLink="false">http://maxdonati.wordpress.com/?p=107</guid>
		<description><![CDATA[il transaction log, questo sconosciuto.. tutti (o quasi) sappiamo che il transaction log, è &#8220;quel file che mantiene le transazioni effettuate, o da effettuare, sul DB&#8221;.. ma come funziona? qual&#8217;è la sua configurazione migliore per il nostro DB? come manutenerlo &#8230; <a href="http://maxdonati.wordpress.com/2010/09/24/transaction-log-questo-sconosciuto/">Leggi l'articolo completo <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=107&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>il transaction log, questo sconosciuto.. tutti (o quasi) sappiamo che il transaction log, è &#8220;quel file che mantiene le transazioni effettuate, o da effettuare, sul DB&#8221;.. ma come funziona? qual&#8217;è la sua configurazione migliore per il nostro DB? come manutenerlo al meglio?</p>
<p>mi sto cimentando in quest&#8217;impresa ardua e ho trovato un paio di articoli &#8220;terra terra&#8221; che possono aiutare a fare un pò di chiarezza a chi, ad esempio come me, ha diverse nozioni da riordinare.</p>
<p>questo è un articoli di MS molto carino in cui al termine c&#8217;è proprio uno specchietto che è possibile utilizzare per capire qual&#8217;è il recovery model per il DB migliore per il proprio database</p>
<p>http://msdn.microsoft.com/en-us/library/ms175987.aspx</p>
<p>in questo invece (me lo sto ancora leggendo) un pò di tips per la manutenzione del TL.</p>
<p>http://technotes.towardsjob.com/sql-server/dba-tips-maintenance-plan-to-avoid-transaction-log-file-growth/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maxdonati.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maxdonati.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maxdonati.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maxdonati.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maxdonati.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maxdonati.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maxdonati.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maxdonati.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maxdonati.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maxdonati.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maxdonati.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maxdonati.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maxdonati.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maxdonati.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=107&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maxdonati.wordpress.com/2010/09/24/transaction-log-questo-sconosciuto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dac287ff2811a6bf15fc2190b1854627?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maxdonati</media:title>
		</media:content>
	</item>
		<item>
		<title>Convertire un Intero in un Esadecimale e utilizzarlo come testo in SQL &#8211; Update</title>
		<link>http://maxdonati.wordpress.com/2010/09/08/convertire-un-intero-in-un-esadecimale-e-utilizzarlo-come-test-in-sql/</link>
		<comments>http://maxdonati.wordpress.com/2010/09/08/convertire-un-intero-in-un-esadecimale-e-utilizzarlo-come-test-in-sql/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 14:30:28 +0000</pubDate>
		<dc:creator>maxdonati</dc:creator>
				<category><![CDATA[Batch Caverna]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[Utilità]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[utilità]]></category>

		<guid isPermaLink="false">http://maxdonati.wordpress.com/?p=103</guid>
		<description><![CDATA[Ecco una cosina che mi ha fatto perdere quasi un giorno&#8230; in Transact SQL esiste la CONVERT che è in grado di convertire un valore in altri formati. Per quel che mi riguarda avevo la necessità di convertire un numero &#8230; <a href="http://maxdonati.wordpress.com/2010/09/08/convertire-un-intero-in-un-esadecimale-e-utilizzarlo-come-test-in-sql/">Leggi l'articolo completo <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=103&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-style:normal;line-height:24px;font-size:16px;">Ecco una cosina che mi ha fatto perdere quasi un giorno&#8230; in Transact SQL esiste la CONVERT che è in grado di convertire un valore in altri formati. Per quel che mi riguarda avevo la necessità di convertire un numero da decimale a esadecimale e quindi di trattare il risultato ottenuto come una stringa di testo. </span></p>
<p><span style="font-style:normal;line-height:24px;font-size:16px;">Essendo io un pessimo conoscitore di TRANSACT (come di molti altri linguaggi) </span>mi sono creato una funzioncina che è possibile chiamare utilizzando il suo nome preceduto dal prefisso dbo.</p>
<p>&#8212;</p>
<p><em><strong>Update:</strong></em> Grazie a Gabriele (che legge il blog! fighissimo!) ho scoperto una funzione che ieri nelle mie ricerche non avevo trovato, al che deduco anche altre cose ma le risparmio&#8230;ovvero, esiste già una funzione di SQL che permette di convertire un esadecimale in testo!!&#8230; <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  Eccola qua:</p>
<address><em>master.dbo.fn_varbintohexstr </em></address>
<p>ed ecco un esempio di codice.</p>
<pre>
<div id="_mcePaste">SELECT master.dbo.fn_varbintohexstr(CAST(Addr1 AS VARBINARY)) AS Expr1</div>
<div id="_mcePaste">FROM Customer</div>
<div id="_mcePaste">SELECT master.dbo.fn_varbintohexstr(CAST(Addr1 AS VARBINARY)) AS Expr1</div>
<div id="_mcePaste">FROM Customer</div>
</pre>
<p>E io che ci ho perso tutto quel tempo.. vabhe lascio il codice per me come appunto e per chi necessitasse di qualche (pessimo) spunto.</p>
<p><span id="more-103"></span></p>
<p><span style="line-height:27px;font-size:medium;"> </span></p>
<p><span style="font-family:Georgia, 'Bitstream Charter', serif;color:#444444;"><span style="line-height:22px;">Ecco il codice così come è uscito dalle mie dolci manine <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </span></span></p>
<pre><span style="font-family:Georgia, 'Bitstream Charter', serif;color:#444444;"><span style="line-height:22px;">CREATE FUNCTION [dbo].[4TS_INT2HEXTXT]
( @Intero int)
RETURNS VarChar(100)
AS
BEGIN
DECLARE @Resto int = 0
DECLARE @Carattere Nvarchar(1)= ''
DECLARE @Esadecimale Nvarchar(100) = ''
DECLARE @conta int = 0
WHILE (Select @Intero ) &gt;1
BEGIN
SET @conta = @conta + 1
Set @Resto = @Intero % 16
IF @Resto = 0 SET @Carattere = '0'
ELSE IF @Resto = 1 SET @Carattere = '1'
ELSE IF @Resto = 2 SET @Carattere = '2'
ELSE IF @Resto = 3 SET @Carattere = '3'
ELSE IF @Resto = 4 SET @Carattere = '4'
ELSE IF @Resto = 5 SET @Carattere = '5'
ELSE IF @Resto = 6 SET @Carattere = '6'
ELSE IF @Resto = 7 SET @Carattere = '7'
ELSE IF @Resto = 8 SET @Carattere = '8'
ELSE IF @Resto = 9 SET @Carattere = '9'
ELSE IF @Resto = 10 SET @Carattere = 'A'
ELSE IF @Resto = 11 SET @Carattere = 'B'
ELSE IF @Resto = 12 SET @Carattere = 'C'
ELSE IF @Resto = 13 SET @Carattere = 'D'
ELSE IF @Resto = 14 SET @Carattere = 'E'
ELSE IF @Resto = 15 SET @Carattere = 'F'
ELSE Return 0
SET @Esadecimale = @Carattere + @Esadecimale
SET @Intero = @Intero / 16
CONTINUE
END
Return @Esadecimale
END</span></span></pre>
<address></address>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maxdonati.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maxdonati.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maxdonati.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maxdonati.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maxdonati.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maxdonati.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maxdonati.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maxdonati.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maxdonati.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maxdonati.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maxdonati.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maxdonati.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maxdonati.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maxdonati.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maxdonati.wordpress.com&amp;blog=1592914&amp;post=103&amp;subd=maxdonati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maxdonati.wordpress.com/2010/09/08/convertire-un-intero-in-un-esadecimale-e-utilizzarlo-come-test-in-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dac287ff2811a6bf15fc2190b1854627?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maxdonati</media:title>
		</media:content>
	</item>
	</channel>
</rss>
