<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4059030279395245715</id><updated>2026-08-25T18:16:47.383-07:00</updated><category term="sql"/><category term="2008"/><category term="server"/><category term="script"/><category term="sql server"/><category term="wizard"/><category term="xml"/><category term="DB"/><category term="Source"/><category term="audit"/><category term="auditoria"/><category term="ayuda"/><category term="disparador"/><category term="generador"/><category term="select"/><category term="trigger"/><category term="truco"/><category term="bienvenida"/><category term="calendar"/><category term="control"/><category term="cursor"/><category term="date"/><category term="dateadd"/><category term="datediff"/><category term="datetime"/><category term="dumy"/><category term="entity"/><category term="example"/><category term="exec"/><category term="hierarchical"/><category term="identity"/><category term="jerarquica"/><category term="max"/><category term="nvarchar"/><category term="one table"/><category term="sp_executeSQL"/><category term="split list values lista valores separados espacio masiva agil rapido"/><category term="sys.objects"/><category term="task"/><category term="text"/><category term="trucos"/><category term="varchar"/><category term="variable table"/><title type='text'>SQL Dimention!</title><subtitle type='html'>Beyond simple query</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sqldimention.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://sqldimention.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>SkyNet silverstar</name><uri>http://www.blogger.com/profile/13554111438503881841</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://bp0.blogger.com/_aY_6UVEczgs/R31CohKLrvI/AAAAAAAAC8M/ZLAYouAHYbM/S220/malvina.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4059030279395245715.post-324045424417240261</id><published>2014-08-05T07:22:00.001-07:00</published><updated>2014-08-05T07:22:08.079-07:00</updated><title type='text'>Otra forma de ejecución controlada de sentencias sql / Another form of controlled execution of sql statements</title><content type='html'>&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;/*&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Otra
forma de ejecucion controlada de sentencias sql&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;Another form of controlled execution of sql statements&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Cuando debemos ejecutar gran cantidad de
sentencias sql desatendido y debemos recolectar los errores&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;When we run unattended lot of sql statements and we collect errors&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;*/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;set&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;NOCOUNT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;on&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;DECLARE&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;
&lt;span style=&quot;color: teal;&quot;&gt;@SQLCommand&lt;/span&gt;&amp;nbsp;
&lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;2000&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;DECLARE&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;
&lt;span style=&quot;color: teal;&quot;&gt;@NSQLCommand&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;NVARCHAR &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;2000&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;DECLARE&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;
&lt;span style=&quot;color: teal;&quot;&gt;@SQLERROR&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;span style=&quot;color: blue;&quot;&gt;INT&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;declare&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;
&lt;span style=&quot;color: teal;&quot;&gt;@TableSQL&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;table &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;Orden&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;INT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;IDENTITY&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;SQL&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;varchar &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;4000&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;declare&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;
&lt;span style=&quot;color: teal;&quot;&gt;@TableSQLErr&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;table &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;ErrorNumber&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&amp;nbsp; &lt;span style=&quot;color: teal;&quot;&gt;ErrorDesc&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;varchar &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;4000&lt;span style=&quot;color: grey;&quot;&gt;),&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;SQL&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;varchar &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;4000&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;/* &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; En
esta seccion insertaremos en la variable tabla @TableSQL todos los scripts que
debemos ejecutar, &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aqui
un ejemplo de reindexado de tablas &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;In this section we will insert into @ table Variable TableSQL all
scripts that we run, &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; here an example of re-indexing of tables&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;*/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;insert&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;into&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;@TableSQL&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;select&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;ALTER INDEX ALL ON &#39;&lt;/span&gt;
&lt;span style=&quot;color: grey;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;name&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39; REBUILD WITH (FILLFACTOR
= 80, SORT_IN_TEMPDB = ON, STATISTICS_NORECOMPUTE = ON);&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: lime;&quot;&gt;sys&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: lime;&quot;&gt;objects&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;where&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;type&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;U&#39;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;/********************Se ejecutan todas
las sentencias generadas previamente*******************/&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;DECLARE&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;
&lt;span style=&quot;color: teal;&quot;&gt;FKPK_cursor&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;CURSOR&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;FOR&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;select&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;SQL&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;@TableSQL&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;order&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;by&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;orden&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;OPEN&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;FKPK_cursor&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;FETCH&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;NEXT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;FKPK_cursor&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;@SQLCommand&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;WHILE&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;@@FETCH_STATUS&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;BEGIN&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;BEGIN&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;TRY&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;Set&lt;/span&gt;
&lt;span style=&quot;color: teal;&quot;&gt;@NSQLCommand&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;Convert&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;nvarchar&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;2000&lt;span style=&quot;color: grey;&quot;&gt;),&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;@SQLCommand&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;--print @NSQLCommand&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;EXEC&lt;/span&gt; &lt;span style=&quot;color: maroon;&quot;&gt;sp_executesql&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;@statement&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;@NSQLCommand&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;END&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;TRY&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;BEGIN&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;CATCH&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;set&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;@SQLERROR&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;@@error&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;Insert&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;into&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;@TableSQLErr&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;values &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;@SQLERROR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;ERROR_MESSAGE&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(),&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;@SQLCommand&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;END&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;CATCH&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;FETCH&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;NEXT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;FKPK_cursor&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;@SQLCommand&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;END&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;CLOSE&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;span style=&quot;color: teal;&quot;&gt;FKPK_cursor&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;DEALLOCATE&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;span style=&quot;color: teal;&quot;&gt;FKPK_cursor&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;/*********************************************************************************/&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;NOCOUNT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;OFF&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;/* &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resultado:
Todas las operaciones ejecutadas&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Result:
All transactions executed&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Select&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;@TableSQL&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;order&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;by&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;orden&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;/* &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resultado:
Todos errores ocurridos &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Result:
All errors&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;*/&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Select&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;@TableSQLErr&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqldimention.blogspot.com/feeds/324045424417240261/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://sqldimention.blogspot.com/2014/08/otra-forma-de-ejecucion-controlada-de.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/324045424417240261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/324045424417240261'/><link rel='alternate' type='text/html' href='http://sqldimention.blogspot.com/2014/08/otra-forma-de-ejecucion-controlada-de.html' title='Otra forma de ejecución controlada de sentencias sql / Another form of controlled execution of sql statements'/><author><name>SkyNet silverstar</name><uri>http://www.blogger.com/profile/13554111438503881841</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://bp0.blogger.com/_aY_6UVEczgs/R31CohKLrvI/AAAAAAAAC8M/ZLAYouAHYbM/S220/malvina.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059030279395245715.post-3733919069853587722</id><published>2011-12-20T05:59:00.001-08:00</published><updated>2011-12-20T06:02:15.833-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="split list values lista valores separados espacio masiva agil rapido"/><title type='text'>One parameter, list of values</title><content type='html'>/*&lt;br /&gt;Target:&lt;br /&gt;1) Develop a stored procedure where sending a list of values ​​concatenated for space,&lt;br /&gt;bulk insert all records&lt;br /&gt;2) Develop a procedure that receives a list of occurrences can be concatenated by space&lt;br /&gt;bring the possible values&lt;br /&gt;&lt;br /&gt;Objetivo:&lt;br /&gt; 1) Desarrollar un procedimiento almacenado donde enviando una lista de valores concatenados por espacio, &lt;br /&gt; inserte de forma masiva todos los registros&lt;br /&gt; 2) Desarrollar un procedimiento que enviando una lista de ocurrencias concatenadas por espacio puedan &lt;br /&gt; traer los valores posibles&lt;br /&gt; &lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; CREATE FUNCTION dbo.fn_ParametersToTable( @ParametrosIn VARCHAR(max))&lt;br /&gt; RETURNS  @ParameterTable TABLE ( ParameterValue varchar(50))&lt;br /&gt; AS&lt;br /&gt; BEGIN&lt;br /&gt; /*&lt;br /&gt;  Function that can process a parameter and perform a split of the values ​​returned in a table&lt;br /&gt;  Funcion que permite procesar un parametro y realizar un split de los valores devolviendolos en una tabla&lt;br /&gt; */&lt;br /&gt;  DECLARE @ParamItem varchar(50)&lt;br /&gt;  WHILE CHARINDEX( &#39; &#39;, @ParametrosIn ) &gt; 0 BEGIN&lt;br /&gt;   SET @ParamItem = LOWER( LTRIM(RTRIM( SUBSTRING( @ParametrosIn , 1, CHARINDEX( &#39; &#39;, @ParametrosIn ) -1))))&lt;br /&gt;   SET @ParametrosIn = SUBSTRING( @ParametrosIn ,  CHARINDEX( &#39; &#39;, @ParametrosIn ) + 1, len(@ParametrosIn))&lt;br /&gt;   IF NOT EXISTS ( SELECT * FROM @ParameterTable WHERE ParameterValue = @ParamItem)&lt;br /&gt;    INSERT @ParameterTable  ( ParameterValue ) VALUES (@ParamItem)&lt;br /&gt;   END&lt;br /&gt;  IF LEN(rtrim(@ParametrosIn) )  != &#39;&#39; BEGIN &lt;br /&gt;   SET @ParamItem = LOWER( LTRIM(RTRIM( @ParametrosIn )))&lt;br /&gt;   IF NOT EXISTS ( SELECT * FROM @ParameterTable WHERE ParameterValue = @ParamItem)&lt;br /&gt;    INSERT @ParameterTable  ( ParameterValue ) VALUES (@ParamItem )&lt;br /&gt;  END&lt;br /&gt;  RETURN &lt;br /&gt; END&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; /*&lt;br /&gt;  Sample table to demonstrate the use&lt;br /&gt;  Tabla de muestra para demostrar el uso&lt;br /&gt; */&lt;br /&gt; CREATE TABLE ExampleTbl (field1 int, field2 varchar(20))&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE PROCEDURE ExampleInsertList&lt;br /&gt; @ValueList varchar(max) &lt;br /&gt;AS&lt;br /&gt;DECLARE @field1 INT&lt;br /&gt;DECLARE @field2 VARCHAR(20)&lt;br /&gt; /*&lt;br /&gt;  Stored procedure taking a single parameter, perform a stock split and inserted into a table&lt;br /&gt;  &lt;br /&gt;  Procedimiento almacenado tomando un solo parametro, realiza un split de valores e inserta en una tabla&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; INSERT INTO &lt;br /&gt;  ExampleTbl &lt;br /&gt;  (&lt;br /&gt;   field1 , &lt;br /&gt;   field2&lt;br /&gt;  ) &lt;br /&gt;  SELECT &lt;br /&gt;   CONVERT(INT, ParameterValue) AS field1, &lt;br /&gt;   &#39;Value &#39; + ParameterValue  AS field2 &lt;br /&gt;  FROM &lt;br /&gt;   dbo.fn_ParametersToTable(@ValueList )&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt; /*&lt;br /&gt;  Run the test where you insert all the values ​​listed in Table ExampleTbl&lt;br /&gt;  &lt;br /&gt;  Ejecutamos la prueba donde se inserta todos los valores de la lista en la tabla ExampleTbl&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt; EXEC ExampleInsertList @ValueList = &#39;1 2 3 4 5 6 7 8 9 10 11 12 232 4545 125454 5645646 465465 4521 321 2138574 54&#39;&lt;br /&gt;&lt;br /&gt;GO &lt;br /&gt;&lt;br /&gt; CREATE PROCEDURE ExampleQueryList&lt;br /&gt;  @ParameterList VARCHAR(MAX)&lt;br /&gt; AS&lt;br /&gt;&lt;br /&gt; /*&lt;br /&gt; &lt;br /&gt;  Consultation where a list of parameters is the conditional search&lt;br /&gt;  &lt;br /&gt;  Consulta donde una lista de parametros es el condicional de busqueda&lt;br /&gt;  &lt;br /&gt; */&lt;br /&gt; SELECT ExampleTbl.* FROM &lt;br /&gt;  ExampleTbl &lt;br /&gt; WHERE&lt;br /&gt;  field1&lt;br /&gt; IN ( &lt;br /&gt;  SELECT &lt;br /&gt;   CONVERT(INT, ParameterValue) &lt;br /&gt;  FROM &lt;br /&gt;   dbo.fn_ParametersToTable(@ParameterList )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt; /*&lt;br /&gt;  Query Execution of example with lists&lt;br /&gt;  &lt;br /&gt;  Ejecucion del ejemplo de Query con listas&lt;br /&gt; */&lt;br /&gt; EXEC ExampleQueryList @ParameterList = &#39;1 12 232&#39;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; /*&lt;br /&gt; &lt;br /&gt; They now have a circuit with all the suggestions of using the function fn_ParametersToTable if your taste and utility can donate what he deems necessary and will be rewarded in many more post&lt;br /&gt; &lt;br /&gt; Ahora tienen un circuito con todas las sugerencias del uso de la funcion fn_ParametersToTable si es de su gusto y utilidad puede donar lo que crea conveniente y serà retribuido en muchos mas post &lt;br /&gt;&lt;br /&gt; */</content><link rel='replies' type='application/atom+xml' href='http://sqldimention.blogspot.com/feeds/3733919069853587722/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://sqldimention.blogspot.com/2011/12/one-parameter-list-of-values.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/3733919069853587722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/3733919069853587722'/><link rel='alternate' type='text/html' href='http://sqldimention.blogspot.com/2011/12/one-parameter-list-of-values.html' title='One parameter, list of values'/><author><name>SkyNet silverstar</name><uri>http://www.blogger.com/profile/13554111438503881841</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://bp0.blogger.com/_aY_6UVEczgs/R31CohKLrvI/AAAAAAAAC8M/ZLAYouAHYbM/S220/malvina.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059030279395245715.post-2954921732397284806</id><published>2011-06-24T10:47:00.000-07:00</published><updated>2011-06-24T10:53:39.198-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DB"/><category scheme="http://www.blogger.com/atom/ns#" term="max"/><category scheme="http://www.blogger.com/atom/ns#" term="nvarchar"/><category scheme="http://www.blogger.com/atom/ns#" term="server"/><category scheme="http://www.blogger.com/atom/ns#" term="Source"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><category scheme="http://www.blogger.com/atom/ns#" term="text"/><category scheme="http://www.blogger.com/atom/ns#" term="varchar"/><title type='text'>Database Text to NVARCHAR</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;/*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;This time the problem we faced was: passed all existing TEXT fields in a database field NVARCHAR (MAX).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green;mso-no-proof: yes&quot;&gt;EASY, enjoy!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green;mso-no-proof: yes&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green;mso-no-proof: yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;En esta oportunidad el problema a resolver era: pasar todos los campos TEXT existentes en una base de datos en campos NVARCHAR(MAX).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green;mso-no-proof: yes&quot;&gt;Sensillo, enjoy!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green;mso-no-proof: yes&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span   &gt;Nota: Este script puede dañar la integridad de la base, cualquier daño que provoque será bajo su responsabilidad .&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span   &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;&lt;span class=&quot;hps&quot; title=&quot;Click for alternate translations&quot;&gt;Note: This&lt;/span&gt; &lt;span class=&quot;hps&quot; title=&quot;Click for alternate translations&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;hps&quot; title=&quot;Click for alternate translations&quot;&gt;can damage&lt;/span&gt; &lt;span class=&quot;hps&quot; title=&quot;Click for alternate translations&quot;&gt;the integrity of the&lt;/span&gt; &lt;span class=&quot;hps&quot; title=&quot;Click for alternate translations&quot;&gt;base,&lt;/span&gt; &lt;span class=&quot;hps&quot; title=&quot;Click for alternate translations&quot;&gt;causing&lt;/span&gt; &lt;span class=&quot;hps&quot; title=&quot;Click for alternate translations&quot;&gt;damage that&lt;/span&gt;&lt;span class=&quot;hps&quot; title=&quot;Click for alternate translations&quot;&gt;will be&lt;/span&gt; &lt;span class=&quot;hps&quot; title=&quot;Click for alternate translations&quot;&gt;your responsibility.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green;mso-no-proof: yes&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green;mso-no-proof: yes&quot;&gt;*/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green;mso-no-proof: yes&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes&quot;&gt;DECLARE&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:teal&quot;&gt;@CMD&lt;/span&gt;&lt;span style=&quot;mso-tab-count:3&quot;&gt;                 &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;(&lt;/span&gt;255&lt;span style=&quot;color:gray&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;DECLARE&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language:EN-GB; mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:teal&quot;&gt;@TABLENAME&lt;/span&gt;&lt;span style=&quot;mso-tab-count:2&quot;&gt;           &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;(&lt;/span&gt;255&lt;span style=&quot;color:gray&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;DECLARE&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language:EN-GB; mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:teal&quot;&gt;@COLUMNNAME&lt;/span&gt;&lt;span style=&quot;mso-tab-count:2&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;(&lt;/span&gt;255&lt;span style=&quot;color:gray&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:gray; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;--Well here declare a cursor, only that&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;DECLARE&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language:EN-GB; mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:teal&quot;&gt;Table_cursor&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;CURSOR&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;FOR&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:green&quot;&gt;--Make the cmd line to be executed &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;SELECT&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:2&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:red&quot;&gt;&#39;ALTER TABLE &#39;&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;O&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;NAME&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color:red&quot;&gt;&#39;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;ALTER COLUMN &#39;&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;C&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;NAME&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color:red&quot;&gt;&#39; NVARCHAR(MAX) NULL&#39;&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;CMD&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:2&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;O&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;NAME&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;TABLENAME&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:2&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;C&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;NAME&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;COLUMNNAME&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;FROM&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:2&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:lime&quot;&gt;SYS&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:lime&quot;&gt;OBJECTS&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;O&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;INNER&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;JOIN&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:2&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:lime&quot;&gt;SYS&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:lime&quot;&gt;COLUMNS&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;C&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;ON &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;C&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:fuchsia&quot;&gt;OBJECT_ID&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;O&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:fuchsia&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;)&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;INNER&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;JOIN&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:2&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:lime&quot;&gt;SYS&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:lime&quot;&gt;TYPES&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;T&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;ON&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;SYSTEM_TYPE_ID&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;C&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;SYSTEM_TYPE_ID&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;WHERE&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:2&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;TYPE&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:red&quot;&gt;&#39;U&#39;&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;AND&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;C&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;SYSTEM_TYPE_ID&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;=&lt;/span&gt; 35&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;--Open the cursor &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;OPEN&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language:EN-GB; mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:teal&quot;&gt;Table_cursor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;--Fetch the first&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;FETCH&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language:EN-GB; mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:blue&quot;&gt;NEXT&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;Table_cursor&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;--Use the field values in the declared vars&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;INTO&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language:EN-GB; mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:teal&quot;&gt;@CMD&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;@TABLENAME&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;@COLUMNNAME&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;--LOOP NOT EOF &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;WHILE&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language:EN-GB; mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:fuchsia&quot;&gt;@@FETCH_STATUS&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;=&lt;/span&gt; 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;BEGIN&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color:fuchsia&quot;&gt;REPLICATE&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:red&quot;&gt;&#39;=&#39;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;,&lt;/span&gt;255&lt;span style=&quot;color:gray&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color:red&quot;&gt;&#39;TABLE:&#39;&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;@TABLENAME&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color:red&quot;&gt;&#39;COLUMN:&#39;&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;@COLUMNNAME&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color:red&quot;&gt;&#39;&#39;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color:red&quot;&gt;&#39;EXECUTING =&amp;gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;&#39;&lt;/span&gt; &lt;span style=&quot;color:gray&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;@CMD&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;EXEC &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;@CMD&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color:green&quot;&gt;--here execute the command&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-tab-count:1&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color:red&quot;&gt;&#39;DONE &#39;&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:green&quot;&gt;--Move next :P&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;FETCH&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;NEXT&lt;/span&gt; &lt;span style=&quot;color:blue&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;Table_cursor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language: EN-GB;mso-no-proof:yes&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;INTO&lt;/span&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;@CMD&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;@TABLENAME&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color:teal&quot;&gt;@COLUMNNAME&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;--End of cursor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;END&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;--Close an Deallocate cursor &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;CLOSE&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language:EN-GB; mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:teal&quot;&gt;Table_cursor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue; mso-ansi-language:EN-GB;mso-no-proof:yes&quot;&gt;DEALLOCATE&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-ansi-language:EN-GB; mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:teal&quot;&gt;Table_cursor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;; color:blue;mso-no-proof:yes&quot;&gt;Print&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes&quot;&gt; &lt;span style=&quot;color:fuchsia&quot;&gt;replicate&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:red&quot;&gt;&#39;=&#39;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;,&lt;/span&gt;255&lt;span style=&quot;color:gray&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldimention.blogspot.com/feeds/2954921732397284806/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://sqldimention.blogspot.com/2011/06/database-text-to-nvarchar.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/2954921732397284806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/2954921732397284806'/><link rel='alternate' type='text/html' href='http://sqldimention.blogspot.com/2011/06/database-text-to-nvarchar.html' title='Database Text to NVARCHAR'/><author><name>SkyNet silverstar</name><uri>http://www.blogger.com/profile/13554111438503881841</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://bp0.blogger.com/_aY_6UVEczgs/R31CohKLrvI/AAAAAAAAC8M/ZLAYouAHYbM/S220/malvina.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059030279395245715.post-4242524843495582105</id><published>2010-10-07T13:11:00.000-07:00</published><updated>2010-10-07T13:14:11.628-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="control"/><category scheme="http://www.blogger.com/atom/ns#" term="DB"/><category scheme="http://www.blogger.com/atom/ns#" term="server"/><category scheme="http://www.blogger.com/atom/ns#" term="Source"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><title type='text'>DB Source control</title><content type='html'>&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: green; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;/*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: green; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;      This post is a example of  source control on sql databases,  You can modify, extend or cut the functions of the next script, ask and discuss,  The author is not responsible of content, only for educational purposes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: green; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;*/&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: green; &quot;&gt;&lt;o:p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: green; &quot;&gt;&lt;o:p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: green; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;/*Create a table where save every change on DB */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: green; &quot;&gt;&lt;o:p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: blue; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;CREATE&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;TABLE&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DEVSQLControl&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;[ID]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;INT&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;IDENTITY&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;       &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;[Name]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;VARCHAR&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;256&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;[Type]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;CHAR&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                      &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Create_date&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;       &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DATETIME&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Modify_date&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;       &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DATETIME&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DataCheckSum&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;BIGINT&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                       &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;stamp&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;             &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;TIMESTAMP&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;               &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;SnapDate&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DATETIME&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: gray; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: gray; &quot;&gt;&lt;o:p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: gray; &quot;&gt;&lt;o:p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: green; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;/*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: green; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Insert in to DEVSQLControl table the new changes, including what I want to seek, you are free to change the list to your wish&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: green; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;*/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: blue; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;INSERT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;INTO&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DEVSQLControl&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: gray; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;[Name]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;[type]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Create_date&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;       &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Modify_date&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;       &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DataCheckSum&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;SnapDate&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; color: gray; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                       &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;type&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                       &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;create_date&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;           &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;modify_date&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;           &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:fuchsia&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;BINARY_CHECKSUM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:fuchsia&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;object_id&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;principal_id&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:fuchsia&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;schema_id&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;parent_object_id&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;type&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;type_desc&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;create_date&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;modify_date&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;is_ms_shipped&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;is_published&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;is_schema_published&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:fuchsia&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Getdate&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:lime&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;SYS&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:lime&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;OBJECTS&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;INNER&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;JOIN&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DEVSQLControl&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DV&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;ON&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:green&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;-- 1 = 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;COLLATE&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DATABASE_DEFAULT&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;         &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DV&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;COLLATE&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DATABASE_DEFAULT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;AND&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;type&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;COLLATE&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DATABASE_DEFAULT&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DV&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;type&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;COLLATE&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DATABASE_DEFAULT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;WHERE&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;TYPE&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;IN&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&#39;U&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:red&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&#39;P&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:red&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&#39;fn&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&#39;C &#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:red&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&#39;PK&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:red&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&#39;UQ&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:red&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&#39;F &#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&#39;D &#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;AND&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;DataCheckSum&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:fuchsia&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;BINARY_CHECKSUM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:fuchsia&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;object_id&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;principal_id&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:fuchsia&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;schema_id&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;parent_object_id&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;type&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;type_desc&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;create_date&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;modify_date&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;is_ms_shipped&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;is_published&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;is_schema_published&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;GROUP&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;BY&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;          &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                        &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                       &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                        &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;type&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                       &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                        &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;create_date&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;           &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                        &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;modify_date&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;           &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                        &lt;/span&gt;&lt;span style=&quot;color:fuchsia&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;BINARY_CHECKSUM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:fuchsia&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;object_id&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;principal_id&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:fuchsia&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;schema_id&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;parent_object_id&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:blue&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;type&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;type_desc&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;create_date&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;modify_date&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;is_ms_shipped&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;is_published&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;O&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:teal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;is_schema_published&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color:gray&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldimention.blogspot.com/feeds/4242524843495582105/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://sqldimention.blogspot.com/2010/10/db-source-control.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/4242524843495582105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/4242524843495582105'/><link rel='alternate' type='text/html' href='http://sqldimention.blogspot.com/2010/10/db-source-control.html' title='DB Source control'/><author><name>SkyNet silverstar</name><uri>http://www.blogger.com/profile/13554111438503881841</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://bp0.blogger.com/_aY_6UVEczgs/R31CohKLrvI/AAAAAAAAC8M/ZLAYouAHYbM/S220/malvina.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059030279395245715.post-9098522533360118322</id><published>2010-09-29T07:16:00.000-07:00</published><updated>2010-09-29T07:23:49.642-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2008"/><category scheme="http://www.blogger.com/atom/ns#" term="audit"/><category scheme="http://www.blogger.com/atom/ns#" term="auditoria"/><category scheme="http://www.blogger.com/atom/ns#" term="ayuda"/><category scheme="http://www.blogger.com/atom/ns#" term="disparador"/><category scheme="http://www.blogger.com/atom/ns#" term="generador"/><category scheme="http://www.blogger.com/atom/ns#" term="one table"/><category scheme="http://www.blogger.com/atom/ns#" term="script"/><category scheme="http://www.blogger.com/atom/ns#" term="sql server"/><category scheme="http://www.blogger.com/atom/ns#" term="trigger"/><category scheme="http://www.blogger.com/atom/ns#" term="truco"/><category scheme="http://www.blogger.com/atom/ns#" term="wizard"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'>Audit Script Wizard (SQL Server 2008) II</title><content type='html'>&lt;h3 style=&quot;margin:0cm;margin-bottom:.0001pt&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 17px; font-weight: normal;&quot;&gt;&lt;h3 style=&quot;margin:0cm;margin-bottom:.0001pt&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span title=&quot;&quot; style=&quot;background-color: rgb(255, 255, 255); &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;After posting my article audit Wizard where you create an additional table for each table to be audited, in this issue propose another solution which is created only once a single table and persist data in a xml field, the differences are many, &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span title=&quot;&quot; style=&quot;background-color: rgb(255, 255, 255); &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;but you have to discover which are the scope and mainly depends on the culture to use xml.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0); &quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span title=&quot;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana; font-weight: normal; font-size: small; &quot;&gt;Best regards&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span title=&quot;&quot; style=&quot;background-color: rgb(255, 255, 255); &quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana; font-weight: normal; font-size: small; &quot;&gt;See also: Audit Script Wizard (SQL Server 2008)&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;span title=&quot;&quot; style=&quot;background-color: rgb(255, 255, 255); &quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana; font-weight: normal; font-size: small; &quot;&gt;http://sqldimention.blogspot.com/2010/09/audit-wizard-script.html&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: justify;margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: justify;margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;Después de publicar mi articulo de Wizard de auditoria donde se crea una tabla adicional por cada tabla a auditar, en esta entrega propongo otra solución donde se crea una única vez una sola tabla y los datos persisten en un campo xml, las diferencias son muchas, pero hay que evaluar cuales son los alcances y sobre todo depende de la cultura a usar xml.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: justify;margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: justify;margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;Saludos cordiales&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: justify;margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: justify;margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;Ver tambien:Audit Wizard Script (SQL server 2008)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: justify;margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;http://sqldimention.blogspot.com/2010/09/audit-wizard-script.html&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 17px; font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 17px; font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 17px; font-weight: normal;&quot;&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;-- =============================================&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;-- Author:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Skynet Silverstar&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;-- Create date: &lt;create&gt;&lt;/create&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;-- Description:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Script maker where you conform &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;--              audit info on a specific SQL table&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;-- =============================================&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;--              Creador de script donde conforma&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;--&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Informacion de auditoria de &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;--              una o mas tablas especificas&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;--              sobre una unica tabla de auditoria&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;-- =============================================&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;DECLARE @object_name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;VARCHAR(50)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;DECLARE @column_name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;VARCHAR(50)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;DECLARE @is_nullable&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;VARCHAR(50)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;DECLARE @type&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;VARCHAR(50)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;DECLARE @max_length&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;INT&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;DECLARE @precision&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;INT&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;DECLARE @scale&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;INT&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;DECLARE @Audit_name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;VARCHAR(255)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;DECLARE @trigger_name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;VARCHAR(255)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;-- The target table name &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;-- El nombre de la tabla &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;SET @object_name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;= &#39;factura&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;--Here change the name of tables and triggers if you want&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;--Aqui cambie el nombre de las tablas y disparadore si usted quiere!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;SET @Audit_name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;= &#39;AUDIT_Table&#39; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;SET @trigger_name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;= &#39;AUDIT_TR_&#39; + @object_name&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;IF EXISTS( SELECT * FROM SYS.OBJECTS WHERE NAME IN ( @trigger_name) )&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;BEGIN&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;---------------------------------------------------------&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--Informe de proceso con error ATENCION!&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;---------------------------------------------------------&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--El trigger &#39; + @trigger_name + &#39;  ya existe, verificar y volver a ejecutar el proceso&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--Sugerido hacer backup de la tabla de auditoria y base de datos&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--copiar el resultado y descomentar los comandos siguientes y ejecutar F5&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--DROP TRIGGER &#39; + @trigger_name &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;---------------------------------------------------------&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--Warning!! proccess info error&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;---------------------------------------------------------&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--Trigger &#39; + @trigger_name + &#39;  already exists, Verify and run again the script&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--Make a backup and save the information&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--Execute the next lines if you want delete the old schema&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--DROP TRIGGER &#39; + @trigger_name &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;END ELSE BEGIN&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;SET NOCOUNT ON&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;-------- Script de creacion de tabla de auditoria &#39; + @Audit_name+ &#39; si existe--------&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;-------- Make the script to make the audit table &#39; + @Audit_name+ &#39; IF EXISTs--------&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;-------- AUTOR: &#39; + USER_NAME()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;-------- WORKPLACE: &#39; + HOST_NAME() + &#39;/&#39; + APP_NAME()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;SET ANSI_NULLS ON&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;GO&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;SET QUOTED_IDENTIFIER ON&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;GO&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;SET ANSI_PADDING ON&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;GO&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;IF NOT EXISTS( SELECT * FROM SYS.OBJECTS WHERE NAME IN ( &#39;&#39;&#39; + @Audit_name + &#39;&#39;&#39;) )&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;BEGIN&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39;CREATE TABLE &#39; + @Audit_name + &#39; (&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39; [AUDIT_ID] &#39; + CHAR(9) +  &#39; INT IDENTITY(1,1) &#39; + CHAR(9) + &#39;,&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39; [AUDIT_ACTION] &#39; + CHAR(9) +  &#39; CHAR(1) &#39; + CHAR(9) + &#39; ,&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39; [AUDIT_SPID] &#39; + CHAR(9) +  &#39; INT &#39; + CHAR(9) + &#39; ,&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39; [AUDIT_DATE] &#39; + CHAR(9) +  &#39; DATETIME &#39; + CHAR(9) + &#39; ,&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39; [AUDIT_USER] &#39; + CHAR(9) +  &#39; VARCHAR(50) &#39; + CHAR(9) + &#39; ,&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39; [AUDIT_APLICATION] &#39; + CHAR(9) +  &#39; VARCHAR(255) &#39; + CHAR(9) + &#39; ,&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39; [AUDIT_HOST] &#39; + CHAR(9) +  &#39; VARCHAR(50) &#39; + CHAR(9) + &#39; NOT NULL,&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39; [AUDIT_TIMESTAMP] &#39; + CHAR(9) +  &#39; TIMESTAMP &#39; + CHAR(9) + &#39; ,&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39; [AUDIT_HASH] &#39; + CHAR(9) +  &#39; BIGINT &#39; + CHAR(9) + &#39; ,&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39; [AUDIT_TABLENAME] &#39; + CHAR(9) +  &#39; VARCHAR(255) &#39; + CHAR(9) + &#39; ,&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39; [AUDIT_XML_CONTENT] &#39; + CHAR(9) +  &#39; XML &#39; + CHAR(9) + &#39; ,&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39; CONSTRAINT [&#39; + @Audit_name + &#39;_PK] PRIMARY KEY CLUSTERED &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39; (&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;[AUDIT_ID] ASC&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39; )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39; ) ON [PRIMARY]&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;END &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39; &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39; GO&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39; &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39; SET ANSI_PADDING OFF&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39; GO&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;/********************************************************************************&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;creacion del disparador&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Make a trigger&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;********************************************************************************/&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;-------- Script de creacion de triger de auditoria AUDIT_TR_&#39; + @object_name+ &#39;--------&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;-------- Make a script of Audit trigger named AUDIT_TR_&#39; + @object_name+ &#39;--------&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;-------- AUTOR: &#39; + USER_NAME()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;-------- WORKPLACE: &#39; + HOST_NAME() + &#39;/&#39; + APP_NAME()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;SET ANSI_NULLS ON&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;GO&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;SET QUOTED_IDENTIFIER ON&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;GO&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;SET ANSI_PADDING ON&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;GO&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;CREATE TRIGGER &#39; + @trigger_name + &#39; &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39; ON &#39; + @object_name + &#39; &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39; AFTER INSERT, UPDATE, DELETE&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39; AS&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39; BEGIN&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39; -- Verifico que tipo de accion se va a realizar&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39; -- U : almaceno el dato a actualizar&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39; -- D : almaceno el dato a ser eliminado&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39; -- I : almaceno el dato a ser insertado&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39; -- Verify the type of operatio to do&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39; -- U : Save on update&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39; -- D : Save on delete&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39; -- I : save on insert&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39;DECLARE @ACTION CHAR(1)&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39;DECLARE @XMLDATA XML&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39;DECLARE @HASHDATA BIGINT&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39;IF EXISTS(SELECT * FROM DELETED) AND  EXISTS(SELECT * FROM INSERTED)&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39;SET @ACTION =  &#39;&#39;U&#39;&#39;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39;ELSE IF EXISTS(SELECT * FROM DELETED) &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39;SET @ACTION =  &#39;&#39;D&#39;&#39; &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39;ELSE IF EXISTS(SELECT * FROM INSERTED)&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39;SET @ACTION =  &#39;&#39;I&#39;&#39; &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;DECLARE @FIELDS VARCHAR(8000)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;SET @FIELDS = &#39;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;DECLARE Table_cursor CURSOR FOR &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;SELECT &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;c.name AS column_name&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;FROM &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;sys.objects AS o &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;INNER JOIN  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;sys.columns AS c &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;ON ( o.object_id  = c.object_id)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;WHERE &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;o.type = &#39;U&#39; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;AND o.name = @object_name&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;ORDER BY &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;o.name , &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;column_id&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;OPEN Table_cursor&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;FETCH NEXT FROM Table_cursor &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;INTO @column_name &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;WHILE @@FETCH_STATUS = 0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;BEGIN&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;SET @FIELDS = @FIELDS  + &#39;&#39; + &#39; [&#39; + @column_name + &#39;] ,&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;FETCH NEXT FROM Table_cursor&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;INTO  @column_name &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;END &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;CLOSE Table_cursor&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;DEALLOCATE Table_cursor&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;SET @FIELDS = substring(@FIELDS  , 1 , len(@FIELDS ) - 1)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39;SET NOCOUNT ON&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39;IF (@ACTION  IN ( &#39;&#39;I&#39;&#39;)) BEGIN&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39;SET @XMLDATA  = CAST((SELECT &#39; + @FIELDS + &#39;,  BINARY_CHECKSUM(&#39; + @FIELDS + &#39;) AS [AUDIT_HASH] FROM INSERTED FOR XML AUTO, Elements) AS XML)&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39;INSERT INTO &#39; + @Audit_name + &#39; &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39;( [AUDIT_ACTION], [AUDIT_DATE], [AUDIT_USER], [AUDIT_APLICATION],[AUDIT_HOST], [AUDIT_HASH], [AUDIT_SPID], [AUDIT_TABLENAME] , [AUDIT_XML_CONTENT]) VALUES&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39;( @ACTION, GetDate(), USER_NAME(), APP_NAME(), HOST_NAME() , 0 , @@SPID, &#39; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39;&#39;&#39;&#39; + @object_name + &#39;&#39;&#39;, @XMLDATA  ) &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39;END&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39;ELSE IF (@ACTION IN (&#39;&#39;U&#39;&#39;, &#39;&#39;D&#39;&#39;)) BEGIN&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39;SET @XMLDATA  = CAST((SELECT &#39; + @FIELDS + &#39;,  BINARY_CHECKSUM(&#39; + @FIELDS + &#39;) AS [AUDIT_HASH] FROM DELETED FOR XML AUTO, Elements) AS XML)&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39;INSERT INTO &#39; + @Audit_name + &#39; &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39;( [AUDIT_ACTION], [AUDIT_DATE], [AUDIT_USER], [AUDIT_APLICATION],[AUDIT_HOST], [AUDIT_HASH], [AUDIT_SPID], [AUDIT_TABLENAME] , [AUDIT_XML_CONTENT]) VALUES&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39;( @ACTION, GetDate(), USER_NAME(), APP_NAME(), HOST_NAME() , 0 , @@SPID, &#39; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + CHAR(9) + &#39;&#39;&#39;&#39; + @object_name + &#39;&#39;&#39;, @XMLDATA  ) &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT CHAR(9) + &#39;END&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;END&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;---------------------------------------------------------&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--Informe de proceso&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;---------------------------------------------------------&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--Se generò sobre tabla &#39; + @object_name + &#39;  el trigger &#39; + @trigger_name + &#39; &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--Copie el contenido de resultado a un archivo. sql&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--Nombre: xxx_creacion_auditoria_&#39; + @object_name  + &#39;.sql&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;---------------------------------------------------------&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--Proccess info&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;---------------------------------------------------------&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--With the target table &#39; + @object_name + &#39;  made the trigger &#39; + @trigger_name + &#39; &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--Copy the result to a new query and save &#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;PRINT &#39;--Name: xxx_Create_Audit_&#39; + @object_name  + &#39;.sql&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;END&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldimention.blogspot.com/feeds/9098522533360118322/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://sqldimention.blogspot.com/2010/09/audit-script-wizard-sql-server-2008-ii.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/9098522533360118322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/9098522533360118322'/><link rel='alternate' type='text/html' href='http://sqldimention.blogspot.com/2010/09/audit-script-wizard-sql-server-2008-ii.html' title='Audit Script Wizard (SQL Server 2008) II'/><author><name>SkyNet silverstar</name><uri>http://www.blogger.com/profile/13554111438503881841</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://bp0.blogger.com/_aY_6UVEczgs/R31CohKLrvI/AAAAAAAAC8M/ZLAYouAHYbM/S220/malvina.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059030279395245715.post-6130142030800979026</id><published>2010-09-24T11:17:00.000-07:00</published><updated>2010-09-24T11:36:09.578-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2008"/><category scheme="http://www.blogger.com/atom/ns#" term="cursor"/><category scheme="http://www.blogger.com/atom/ns#" term="dumy"/><category scheme="http://www.blogger.com/atom/ns#" term="entity"/><category scheme="http://www.blogger.com/atom/ns#" term="example"/><category scheme="http://www.blogger.com/atom/ns#" term="hierarchical"/><category scheme="http://www.blogger.com/atom/ns#" term="identity"/><category scheme="http://www.blogger.com/atom/ns#" term="jerarquica"/><category scheme="http://www.blogger.com/atom/ns#" term="select"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><category scheme="http://www.blogger.com/atom/ns#" term="sys.objects"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'>SIMPLE CURSOR EXAMPLE</title><content type='html'>&lt;div&gt;/*&lt;/div&gt;&lt;div&gt;SIMPLE CURSOR EXAMPLE&lt;/div&gt;&lt;div&gt;Generation of a table with nested entities using cursors,&lt;/div&gt;&lt;div&gt;Logical entities are generated in a hierarchical&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;EJEMPLO SIMPLE DE CURSORES Entities dictionary&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Generacion de una tabla con entidades anidades usando cursores,  &lt;/div&gt;&lt;div&gt;Se generan entidades logicas en forma jerarquica&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;*/&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;br /&gt;&lt;div&gt;--Declare a table&lt;/div&gt;&lt;div&gt;DECLARE @Entionary TABLE  ( &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;[ID]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;INT IDENTITY(1,1) &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;[Type]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;VARCHAR(25)  &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;[PhisicName]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;VARCHAR(255)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;[LogicName]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;VARCHAR(255)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;[Parent]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;INT&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;[Synonym]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;INT&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;[Help]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;xml&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;&lt;/div&gt;&lt;div&gt;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;-- Var where I take the Identity number of Patern row&lt;/div&gt;&lt;div&gt;DECLARE @RootID&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;INTEGER&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;-- Name of table&lt;/div&gt;&lt;div&gt;DECLARE @object_name&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;VARCHAR(255)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;-- Logical name... if you like other name is free to change it&lt;/div&gt;&lt;div&gt;DECLARE @LogicName&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;VARCHAR(255)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;-- Modify Date of  Table, only to show other field&lt;/div&gt;&lt;div&gt;DECLARE @modify_date&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;DATETIME&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;--Insert the root Row where depends every table name&lt;/div&gt;&lt;div&gt;INSERT INTO &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;@Entionary  (&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;[Type]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;[PhisicName]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;,  &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;[LogicName]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;,  &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;[Parent]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;[Synonym] &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;) values (  &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;&#39;Entity&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;&#39;Generic&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;&#39;Generic&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;NULL&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;NULL&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;)&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;&lt;/div&gt;&lt;div&gt;-- Take the Identity value &lt;/div&gt;&lt;div&gt;SET @RootID = @@IDENTITY&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;--Well here declare a cursor, only that&lt;/div&gt;&lt;div&gt;DECLARE Table_cursor CURSOR FOR &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;SELECT &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;name&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;AS [object_name], &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;modify_date&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;FROM &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;sys.objects &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;WHERE &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;type = &#39;U&#39; &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;ORDER BY &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;name&lt;/div&gt;&lt;div&gt;--Open the cursor &lt;/div&gt;&lt;div&gt;OPEN Table_cursor&lt;/div&gt;&lt;div&gt;--Fetch the first&lt;/div&gt;&lt;div&gt;FETCH NEXT FROM Table_cursor &lt;/div&gt;&lt;div&gt;--Use the field values in the declared vars&lt;/div&gt;&lt;div&gt;INTO @object_name , @modify_date&lt;/div&gt;&lt;div&gt;--Loop not eof &lt;/div&gt;&lt;div&gt;WHILE @@FETCH_STATUS = 0&lt;/div&gt;&lt;div&gt;BEGIN&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;--Insert table entity&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;SET @LogicName = &#39;Logic_&#39; + @object_name &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;SET @LogicName = @LogicName + &#39;(&#39;+convert( Varchar(10), @modify_date)+&#39;)&#39;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;INSERT INTO @Entionary (&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;[Type]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;[PhisicName]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;[LogicName]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;[Parent]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;[Synonym]&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;) values (  &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;&#39;SubEntity&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;@object_name&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;@LogicName&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;@RootID&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;NULL &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;)&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;--For each table insert every field&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;INSERT INTO @Entionary (&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;[Type]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;[PhisicName]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;[LogicName]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;[Parent]&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;[Synonym]&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;) &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;select &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;&#39;Field&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;c.name&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;&#39;LogicField_&#39; + c.name&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;@@identity&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;NULL  &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;FROM &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;&lt;/span&gt;sys.columns AS c &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;INNER JOIN &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;sys.objects AS o &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;ON ( &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;     &lt;/span&gt;o.object_id = c.object_id &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;) &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;WHERE &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;&lt;/span&gt;o.name = @object_name&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;--Move next :P&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;FETCH NEXT FROM Table_cursor&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;INTO  @object_name , @modify_date&lt;/div&gt;&lt;div&gt;--End of cursor&lt;/div&gt;&lt;div&gt;END&lt;/div&gt;&lt;div&gt;--Close an Deallocate cursor &lt;/div&gt;&lt;div&gt;CLOSE Table_cursor&lt;/div&gt;&lt;div&gt;DEALLOCATE Table_cursor&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;--I Can&#39;t use agregate functions with update from (I Don&#39;t know why)... with declared tables, use the temp table&lt;/div&gt;&lt;div&gt;SELECT *  INTO #temp FROM  @Entionary&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;-- other example for set a xml field, only that&lt;/div&gt;&lt;div&gt;UPDATE #temp SET  [Help] = t.Result&lt;/div&gt;&lt;div&gt;FROM &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;(SELECT ID, CONVERT(XML, &#39;&lt;help&gt;&#39; &lt;/help&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;+ CHAR(13) + CHAR(9) + &#39;&lt;author&gt;MRP&lt;/author&gt;&#39;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;+ CHAR(13) + CHAR(9) + &#39;&lt;date&gt;23/09/2010&lt;/date&gt;&#39;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;+ CHAR(13) + CHAR(9) + &#39;&lt;logicname&gt;&#39; + [LogicName] + &#39;&lt;/logicname&gt;&#39;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;+ CHAR(13) + CHAR(9) + &#39;&lt;phisicname&gt;&#39; + [PhisicName] + &#39;&lt;/phisicname&gt;&#39;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;+ CHAR(13) + CHAR(9) + &#39;&lt;ref&gt;&lt;/ref&gt;&#39;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;+ CHAR(13) + CHAR(9) + &#39;&lt;notes&gt;&lt;/notes&gt;&#39;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;+ CHAR(13) + &#39; &#39; )  AS Result&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;FROM #temp ) AS t INNER JOIN #temp ON ( #temp.id = t.id) &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;--show the ResultSet&lt;/div&gt;&lt;div&gt;SELECT * FROM #temp&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;--Drop the temp table&lt;/div&gt;&lt;div&gt;DROP TABLE #temp&lt;/div&gt;&lt;/code&gt;&lt;div&gt;&lt;code class=&quot;sql&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldimention.blogspot.com/feeds/6130142030800979026/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://sqldimention.blogspot.com/2010/09/simple-cursor-example.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/6130142030800979026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/6130142030800979026'/><link rel='alternate' type='text/html' href='http://sqldimention.blogspot.com/2010/09/simple-cursor-example.html' title='SIMPLE CURSOR EXAMPLE'/><author><name>SkyNet silverstar</name><uri>http://www.blogger.com/profile/13554111438503881841</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://bp0.blogger.com/_aY_6UVEczgs/R31CohKLrvI/AAAAAAAAC8M/ZLAYouAHYbM/S220/malvina.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059030279395245715.post-7094406191718144043</id><published>2010-09-22T12:11:00.001-07:00</published><updated>2010-09-22T12:21:08.454-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2008"/><category scheme="http://www.blogger.com/atom/ns#" term="calendar"/><category scheme="http://www.blogger.com/atom/ns#" term="date"/><category scheme="http://www.blogger.com/atom/ns#" term="dateadd"/><category scheme="http://www.blogger.com/atom/ns#" term="datediff"/><category scheme="http://www.blogger.com/atom/ns#" term="datetime"/><category scheme="http://www.blogger.com/atom/ns#" term="server"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><category scheme="http://www.blogger.com/atom/ns#" term="task"/><category scheme="http://www.blogger.com/atom/ns#" term="variable table"/><title type='text'>Task Calendar example</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;This example just want to show different ways to solve specific problems, means that this script contains unnecessary processes.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Best regards&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 13px; white-space: pre; &quot;&gt;--Declare a new table where I will insert every task&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color:Black;&quot;&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;DECLARE @CalendarX TABLE  (&lt;br /&gt;[ID] INT IDENTITY(1,1)  ,&lt;br /&gt;[TaskDate] datetime ,&lt;br /&gt;[TaskName] varchar(255)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;--Other table where insert every day of month&lt;br /&gt;DECLARE @DaysofMonth TABLE  (&lt;br /&gt;[ID] INT   ,&lt;br /&gt;[TaskDate] datetime&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;SET NOCOUNT ON&lt;br /&gt;--Insert examples task rows&lt;br /&gt;Insert into @CalendarX ([TaskDate], [TaskName]) values ( &#39;2010-10-20&#39;, &#39;Task 1&#39;)&lt;br /&gt;Insert into @CalendarX ([TaskDate], [TaskName]) values ( &#39;2010-10-19&#39;, &#39;Task 2&#39;)&lt;br /&gt;Insert into @CalendarX ([TaskDate], [TaskName]) values ( &#39;2010-10-15&#39;, &#39;Task 3&#39;)&lt;br /&gt;Insert into @CalendarX ([TaskDate], [TaskName]) values ( &#39;2010-10-8&#39;, &#39;Task 4&#39;)&lt;br /&gt;Insert into @CalendarX ([TaskDate], [TaskName]) values ( &#39;2010-10-21&#39;, &#39;Task 5&#39;)&lt;br /&gt;SET NOCOUNT OFF&lt;br /&gt;&lt;br /&gt;DECLARE @daytosee   DATETIME&lt;br /&gt;DECLARE @FirstDayofMonth DATETIME&lt;br /&gt;DECLARE @LastDayofMonth  DATETIME&lt;br /&gt;DECLARE @CountofDays  SMALLINT&lt;br /&gt;DECLARE @CurrentDay   SMALLINT&lt;br /&gt;DECLARE @XMLDATA   XML&lt;br /&gt;&lt;br /&gt;--Set each var&lt;br /&gt;SET @CurrentDay   = 1&lt;br /&gt;SET @daytosee   = DATEADD(m,1,GETDATE())&lt;br /&gt;SET @CountofDays  = 0 -- Set to zero&lt;br /&gt;SET @FirstDayofMonth         = CONVERT(DATETIME,CONVERT(VARCHAR(4),DATEPART(yyyy, @daytosee)) &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;+ &#39;/&#39; +  CONVERT(VARCHAR(2),DATEPART(m,@daytosee)) &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;+ &#39;/01&#39; )&lt;br /&gt;SET @LastDayofMonth  = DATEADD(d,-1, dateadd(m, 1, @FirstDayofMonth))&lt;br /&gt;SET @CountofDays  = DATEDIFF(d, @FirstDayofMonth, @LastDayofMonth ) + 1&lt;br /&gt;&lt;br /&gt;--Show values&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--Run a simple while&lt;br /&gt;WHILE @CurrentDay &lt; @CountofDays BEGIN  &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;INSERT INTO @DaysofMonth &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;VALUES (@CurrentDay, DATEADD(d, @CurrentDay -1, @FirstDayofMonth))  &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;SET @CurrentDay = @CurrentDay + 1 &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;END  &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;--Join the tables  &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;BEGIN  &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;WITH FinalCalendar AS (SELECT&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;ISNULL(cx.ID, 0) AS ID,        &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;dm.TaskDate ,        &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;ISNULL(cx.TaskName, &#39;[Empty]&#39;) AS TaskName       &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;FROM &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;@DaysofMonth AS dm&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;LEFT join        &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;@CalendarX  AS cx&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;ON (dm.TaskDate = cx.TaskDate))  &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;SELECT @XMLDATA  = CAST((SELECT * FROM FinalCalendar FOR XML AUTO) AS XML)  &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;END  &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;--Show the result  &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;SELECT   &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;@DayToSee   &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;AS DayToSee   &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;,   &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;@FirstDayofMonth &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;AS FirstDayofMonth &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;,   &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;@LastDayofMonth  &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;AS LastDayofMonth &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;,   &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;@CountofDays  &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;AS CountofDays  &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;,  &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;@XMLDATA            &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;AS Calendar  &lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;/* Compatible SQL 2008 SQL 2008 compatible */&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldimention.blogspot.com/feeds/7094406191718144043/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://sqldimention.blogspot.com/2010/09/task-calendar-example.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/7094406191718144043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/7094406191718144043'/><link rel='alternate' type='text/html' href='http://sqldimention.blogspot.com/2010/09/task-calendar-example.html' title='Task Calendar example'/><author><name>SkyNet silverstar</name><uri>http://www.blogger.com/profile/13554111438503881841</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://bp0.blogger.com/_aY_6UVEczgs/R31CohKLrvI/AAAAAAAAC8M/ZLAYouAHYbM/S220/malvina.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059030279395245715.post-4964356567416987430</id><published>2010-09-21T08:03:00.000-07:00</published><updated>2010-09-21T08:05:30.194-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exec"/><category scheme="http://www.blogger.com/atom/ns#" term="select"/><category scheme="http://www.blogger.com/atom/ns#" term="server"/><category scheme="http://www.blogger.com/atom/ns#" term="sp_executeSQL"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'>Resultado XML de un select dinamico</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;-Quiere obtener el resultado de un select dinamico? no puede hacerlo? :D  y ademas quiere sacar un xml como salida?&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;-Aqui esta el ejemplo que usted buscaba... (probado en sql server 2008).&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Saludos cordiales&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;- Want to get the result of a dynamic select? can not do? : D and also wants to get an xml as output?&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;- Here is the example you wanted ... (Tested in SQL Server 2008).&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Best regards&lt;/div&gt;&lt;div style=&quot;color:Black;&quot;&gt;&lt;br /&gt;   &lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;br /&gt;&lt;br /&gt;--I make a temporal table&lt;br /&gt;--Creo una tabla temporal&lt;br /&gt;CREATE TABLE TEMPORALTBL (&lt;br /&gt; ID INT,&lt;br /&gt; DESCRIPTION  varchar(200)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;--Insert the example rows&lt;br /&gt;--Inserto registros de ejemplo&lt;br /&gt;INSERT INTO TEMPORALTBL VALUES (1,&#39;THIS IS A TEST&#39;)&lt;br /&gt;INSERT INTO TEMPORALTBL VALUES (2,&#39;MAY ENGLISH IS POOR&#39;)&lt;br /&gt;INSERT INTO TEMPORALTBL VALUES (3,&#39;MAY SPANISH IS THE POOREST&#39;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DECLARE @cmd NVARCHAR(2000)&lt;br /&gt;DECLARE @result XML&lt;br /&gt;&lt;br /&gt;--My dynamic select&lt;br /&gt;--Mi select dinamico&lt;br /&gt;SET @cmd = N&#39;select top 100 * from temporaltbl &#39;&lt;br /&gt;&lt;br /&gt;--I make a cast to xml&lt;br /&gt;--Hago un cast a xml&lt;br /&gt;SET @cmd = N&#39;select @insideresult= CAST((&#39; +@cmd + &#39; FOR XML AUTO, Elements ) AS xml) &#39;&lt;br /&gt;&lt;br /&gt;--EXECUTE THE SELECT!!!! CAN YOU SEE?&lt;br /&gt;--EJECUTO EL SELECT... CABRON LO PUEDES VER?&lt;br /&gt;EXEC sp_executeSQL @cmd ,N&#39;@insideresult xml output&#39;,@insideresult = @result OUTPUT&lt;br /&gt;&lt;br /&gt;--Show the XML and command&lt;br /&gt;--Muestro el resultado del xml y el comandojavascript:void(0)&lt;br /&gt;SELECT @cmd  as command, @result as Textxml&lt;br /&gt;&lt;br /&gt;--Drop the example table&lt;br /&gt;--Borro la tabla de ejemplo&lt;br /&gt;DROP TABLE temporaltbl&lt;br /&gt;/*&lt;br /&gt;Compatible SQL 2008&lt;br /&gt;SQL 2008 compatible&lt;br /&gt;*/&lt;br /&gt;  &lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldimention.blogspot.com/feeds/4964356567416987430/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://sqldimention.blogspot.com/2010/09/resultado-xml-de-un-select-dinamico.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/4964356567416987430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/4964356567416987430'/><link rel='alternate' type='text/html' href='http://sqldimention.blogspot.com/2010/09/resultado-xml-de-un-select-dinamico.html' title='Resultado XML de un select dinamico'/><author><name>SkyNet silverstar</name><uri>http://www.blogger.com/profile/13554111438503881841</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://bp0.blogger.com/_aY_6UVEczgs/R31CohKLrvI/AAAAAAAAC8M/ZLAYouAHYbM/S220/malvina.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059030279395245715.post-3095891246331532704</id><published>2010-09-16T06:13:00.000-07:00</published><updated>2010-09-16T07:43:38.970-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2008"/><category scheme="http://www.blogger.com/atom/ns#" term="audit"/><category scheme="http://www.blogger.com/atom/ns#" term="auditoria"/><category scheme="http://www.blogger.com/atom/ns#" term="ayuda"/><category scheme="http://www.blogger.com/atom/ns#" term="disparador"/><category scheme="http://www.blogger.com/atom/ns#" term="generador"/><category scheme="http://www.blogger.com/atom/ns#" term="script"/><category scheme="http://www.blogger.com/atom/ns#" term="sql server"/><category scheme="http://www.blogger.com/atom/ns#" term="trigger"/><category scheme="http://www.blogger.com/atom/ns#" term="truco"/><category scheme="http://www.blogger.com/atom/ns#" term="wizard"/><title type='text'>Audit Wizard Script (SQL server 2008)</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;Este es el primer post donde desarrollo lo que realmente puede llegar a interesar, en este caso es un simple hacedor de script que genera tablas de auditoria con su respectivo disparador, como siempre digo, todo se puede mejorar pero partiendo de una primera idea se puede mejorar aun mas, Cualquier consulta o idea no existe problema en compartirla y discutirla.&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;El siguiente script es para educación solamente, no es responsable de cualquier daño o mal uso que el código o parte de el pueda producir.&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;Saludos cordiales&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;This is the first post where I develop what can really get interested, here is a simple script that generates a wizard audit tables with its own release, as I always say, everything can be improved but starting from an initial idea can be improve further, Any question or idea to share it no problem and discuss it.&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;The following script is for education only, is not responsible for any damage or misuse of the code or part of it can produce&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;Best regards&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;    &lt;div style=&quot;color:Black;&quot;&gt;&lt;br /&gt;    &lt;pre&gt;&lt;CODE CLASS=sql&gt;&lt;br /&gt;&lt;br /&gt;-- =============================================&lt;br /&gt;-- Author:  Skynet Silverstar&lt;br /&gt;-- Create date:&lt;br /&gt;-- Description: Script maker where you conform&lt;br /&gt;-- audit info on a specific SQL table&lt;br /&gt;-- =============================================&lt;br /&gt;-- Creador de script donde conforma&lt;br /&gt;--    Informacion de auditoria sobre&lt;br /&gt;-- una tabla especifica&lt;br /&gt;-- =============================================&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DECLARE @object_name VARCHAR(50)&lt;br /&gt;DECLARE @column_name VARCHAR(50)&lt;br /&gt;DECLARE @is_nullable VARCHAR(50)&lt;br /&gt;DECLARE @type   VARCHAR(50)&lt;br /&gt;DECLARE @max_length  INT&lt;br /&gt;DECLARE @precision  INT&lt;br /&gt;DECLARE @scale   INT&lt;br /&gt;DECLARE @Audit_name  VARCHAR(255)&lt;br /&gt;DECLARE @trigger_name VARCHAR(255)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- The target table name&lt;br /&gt;-- El nombre de la tabla&lt;br /&gt;SET @object_name = &#39;factura&#39;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--Here change the name of tables and triggers if you want&lt;br /&gt;--Aqui cambie el nombre de las tablas y disparadore si usted quiere!&lt;br /&gt;SET @Audit_name  = &#39;AUDIT_&#39; + @object_name&lt;br /&gt;SET @trigger_name = &#39;AUDIT_TR_&#39; + @object_name&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if exists( select * from sys.objects where name in ( @Audit_name, @trigger_name) )&lt;br /&gt;BEGIN&lt;br /&gt; PRINT &#39;---------------------------------------------------------&#39;&lt;br /&gt; PRINT &#39;--Informe de proceso con error ATENCION!&#39;&lt;br /&gt; PRINT &#39;---------------------------------------------------------&#39;&lt;br /&gt; PRINT &#39;--La tabla de auditoria &#39; + @Audit_name + &#39; ya existe, verificar y volver a ejecutar el proceso&#39;&lt;br /&gt; PRINT &#39;--El trigger &#39; + @trigger_name + &#39; ya existe, verificar y volver a ejecutar el proceso&#39;&lt;br /&gt; PRINT &#39;--&#39;&lt;br /&gt; PRINT &#39;--Sugerido hacer backup de la tabla de auditoria y base de datos&#39;&lt;br /&gt; PRINT &#39;--copiar el resultado y descomentar los comandos siguientes y ejecutar F5&#39;&lt;br /&gt; PRINT &#39;--DROP TABLE &#39; + @Audit_name&lt;br /&gt; PRINT &#39;--DROP TRIGGER &#39; + @trigger_name&lt;br /&gt; PRINT &#39;&#39;&lt;br /&gt; PRINT &#39;---------------------------------------------------------&#39;&lt;br /&gt; PRINT &#39;--Warning!! proccess info error&lt;br /&gt; PRINT &#39;---------------------------------------------------------&#39;&lt;br /&gt; PRINT &#39;--The audit table &#39; + @Audit_name + &#39; already exists, Verify and run again the script&#39;&lt;br /&gt; PRINT &#39;--Trigger &#39; + @trigger_name + &#39; already exists, Verify and run again the script&#39;&lt;br /&gt; PRINT &#39;--&#39;&lt;br /&gt; PRINT &#39;--Make a backup and save the information&#39;&lt;br /&gt; PRINT &#39;--Execute the next lines if you want delete the old schema&#39;&lt;br /&gt; PRINT &#39;--DROP TABLE &#39; + @Audit_name&lt;br /&gt; PRINT &#39;--DROP TRIGGER &#39; + @trigger_name&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;END ELSE BEGIN&lt;br /&gt; SET NOCOUNT ON&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; PRINT &#39;-------- Script de creacion de tabla de auditoria AUDIT_&#39; + @object_name+ &#39;--------&#39;&lt;br /&gt; PRINT &#39;-------- Make the script to make the audit table AUDIT_&#39; + @object_name+ &#39;--------&#39;&lt;br /&gt; PRINT &#39;-------- AUTOR: &#39; + USER_NAME()&lt;br /&gt; PRINT &#39;-------- WORKPLACE: &#39; + HOST_NAME() + &#39;/&#39; + APP_NAME()&lt;br /&gt;&lt;br /&gt; PRINT &#39;SET ANSI_NULLS ON&#39;&lt;br /&gt; PRINT &#39;GO&#39;&lt;br /&gt; PRINT &#39;&#39;&lt;br /&gt; PRINT &#39;SET QUOTED_IDENTIFIER ON&#39;&lt;br /&gt; PRINT &#39;GO&#39;&lt;br /&gt; PRINT &#39;&#39;&lt;br /&gt; PRINT &#39;SET ANSI_PADDING ON&#39;&lt;br /&gt; PRINT &#39;GO&#39;&lt;br /&gt; PRINT &#39;&#39;&lt;br /&gt; PRINT &#39;CREATE TABLE &#39; + @Audit_name + &#39; (&#39;&lt;br /&gt; PRINT CHAR(9) + &#39; [AUDIT_ID] &#39; + CHAR(9) + &#39; INT IDENTITY(1,1) &#39; + CHAR(9) + &#39;,&#39;&lt;br /&gt; PRINT CHAR(9) + &#39; [AUDIT_ACTION] &#39; + CHAR(9) + &#39; CHAR(1) &#39; + CHAR(9) + &#39; ,&#39;&lt;br /&gt; DECLARE Table_cursor CURSOR FOR&lt;br /&gt;  SELECT&lt;br /&gt;   o.name AS object_name,&lt;br /&gt;   c.name AS column_name,&lt;br /&gt;   is_nullable = CASE WHEN c.is_nullable &lt;&gt; 0 THEN &#39;NULL&#39; ELSE &#39;NOT NULL&#39; END,  &lt;br /&gt;   [type] = &#39;[&#39; + upper(t.name) + &#39;] &#39; + CASE&lt;br /&gt;    WHEN t.name in (&#39;nvarchar&#39;, &#39;nchar&#39;,&#39;char&#39;,&#39;varchar&#39;) THEN&lt;br /&gt;    &#39;(&#39; + convert(varchar(4), c.max_length) + &#39;)&#39;&lt;br /&gt;    WHEN t.name in (&#39;float&#39;, &#39;numeric&#39;,&#39;money&#39;,&#39;smallmoney&#39;,&#39;real&#39;,&#39;decimal&#39;) THEN&lt;br /&gt;    &#39;(&#39; + CONVERT(VARCHAR(4), c.precision) + &#39;,&#39; + CONVERT(VARCHAR(4), c.scale) + &#39;)&#39;&lt;br /&gt;    ELSE &#39;&#39;&lt;br /&gt;&lt;br /&gt;   END,&lt;br /&gt;   c.max_length ,&lt;br /&gt;   c.precision ,&lt;br /&gt;   c.scale&lt;br /&gt;  FROM&lt;br /&gt;   sys.objects AS o&lt;br /&gt;  INNER JOIN&lt;br /&gt;   sys.columns AS c&lt;br /&gt;  ON ( o.object_id = c.object_id)&lt;br /&gt;  INNER JOIN&lt;br /&gt;   systypes as t&lt;br /&gt;  ON ( c.system_type_id = t.xtype )&lt;br /&gt;  WHERE&lt;br /&gt;   o.type = &#39;U&#39;&lt;br /&gt;   AND o.name = @object_name&lt;br /&gt;  ORDER BY&lt;br /&gt;   o.name ,&lt;br /&gt;   column_id&lt;br /&gt; OPEN Table_cursor&lt;br /&gt; FETCH NEXT FROM Table_cursor&lt;br /&gt; INTO @object_name , @column_name ,@is_nullable, @type ,&lt;br /&gt;   @max_length, @precision , @scale&lt;br /&gt;&lt;br /&gt; WHILE @@FETCH_STATUS = 0&lt;br /&gt; BEGIN&lt;br /&gt;&lt;br /&gt;  PRINT CHAR(9) + &#39; [&#39; + @column_name + &#39;] &#39; + CHAR(9) + @TYPE + &#39; &#39; + CHAR(9) + @is_nullable + &#39;,&#39;&lt;br /&gt; &lt;br /&gt;  FETCH NEXT FROM Table_cursor&lt;br /&gt;  INTO @object_name , @column_name ,@is_nullable, @type ,&lt;br /&gt;    @max_length, @precision , @scale&lt;br /&gt; END&lt;br /&gt; CLOSE Table_cursor&lt;br /&gt; DEALLOCATE Table_cursor&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; PRINT CHAR(9) + &#39; [AUDIT_DATE] &#39; + CHAR(9) + &#39; DATETIME &#39; + CHAR(9) + &#39; ,&#39;&lt;br /&gt; PRINT CHAR(9) + &#39; [AUDIT_USER] &#39; + CHAR(9) + &#39; VARCHAR(50) &#39; + CHAR(9) + &#39; ,&#39;&lt;br /&gt; PRINT CHAR(9) + &#39; [AUDIT_APLICATION] &#39; + CHAR(9) + &#39; VARCHAR(255) &#39; + CHAR(9) + &#39; ,&#39;&lt;br /&gt; PRINT CHAR(9) + &#39; [AUDIT_HOST] &#39; + CHAR(9) + &#39; VARCHAR(50) &#39; + CHAR(9) + &#39; NOT NULL,&#39;&lt;br /&gt; PRINT CHAR(9) + &#39; [AUDIT_TIMESTAMP] &#39; + CHAR(9) + &#39; TIMESTAMP &#39; + CHAR(9) + &#39; ,&#39;&lt;br /&gt;&lt;br /&gt; PRINT &#39; CONSTRAINT [&#39; + @Audit_name + &#39;_PK] PRIMARY KEY CLUSTERED &#39;&lt;br /&gt; PRINT &#39; (&#39;&lt;br /&gt; PRINT &#39;  [AUDIT_ID] ASC&#39;&lt;br /&gt; PRINT &#39; )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]&#39;&lt;br /&gt; PRINT &#39; ) ON [PRIMARY]&#39;&lt;br /&gt; PRINT &#39; &#39;&lt;br /&gt; PRINT &#39; GO&#39;&lt;br /&gt; PRINT &#39; &#39;&lt;br /&gt; PRINT &#39; SET ANSI_PADDING OFF&#39;&lt;br /&gt; PRINT &#39; GO&#39;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; /********************************************************************************&lt;br /&gt;  creacion del disparador&lt;br /&gt;  Make a trigger&lt;br /&gt;  &lt;br /&gt; ********************************************************************************/&lt;br /&gt; PRINT &#39;-------- Script de creacion de triger de auditoria AUDIT_TR_&#39; + @object_name+ &#39;--------&#39;&lt;br /&gt; PRINT &#39;-------- Make a script of Audit trigger named AUDIT_TR_&#39; + @object_name+ &#39;--------&#39;&lt;br /&gt; PRINT &#39;-------- AUTOR: &#39; + USER_NAME()&lt;br /&gt; PRINT &#39;-------- WORKPLACE: &#39; + HOST_NAME() + &#39;/&#39; + APP_NAME()&lt;br /&gt;&lt;br /&gt; PRINT &#39;SET ANSI_NULLS ON&#39;&lt;br /&gt; PRINT &#39;GO&#39;&lt;br /&gt; PRINT &#39;&#39;&lt;br /&gt; PRINT &#39;SET QUOTED_IDENTIFIER ON&#39;&lt;br /&gt; PRINT &#39;GO&#39;&lt;br /&gt; PRINT &#39;&#39;&lt;br /&gt; PRINT &#39;SET ANSI_PADDING ON&#39;&lt;br /&gt; PRINT &#39;GO&#39;&lt;br /&gt; PRINT &#39;&#39;&lt;br /&gt; PRINT &#39;CREATE TRIGGER &#39; + @trigger_name + &#39; &#39;&lt;br /&gt; PRINT &#39; ON &#39; + @object_name + &#39; &#39;&lt;br /&gt; PRINT &#39; AFTER INSERT, UPDATE, DELETE&#39;&lt;br /&gt; PRINT &#39; AS&#39;&lt;br /&gt; PRINT &#39; BEGIN&#39;&lt;br /&gt; PRINT CHAR(9) + &#39; -- Verifico que tipo de accion se va a realizar&#39;&lt;br /&gt; PRINT CHAR(9) + &#39; -- U : almaceno el dato a actualizar&#39;&lt;br /&gt; PRINT CHAR(9) + &#39; -- D : almaceno el dato a ser eliminado&#39;&lt;br /&gt; PRINT CHAR(9) + &#39; -- I : almaceno el dato a ser insertado&#39;&lt;br /&gt; PRINT &#39;&#39;&lt;br /&gt; PRINT CHAR(9) + &#39; -- Verify the type of operatio to do&#39;&lt;br /&gt; PRINT CHAR(9) + &#39; -- U : Save on update&#39;&lt;br /&gt; PRINT CHAR(9) + &#39; -- D : Save on delete&#39;&lt;br /&gt; PRINT CHAR(9) + &#39; -- I : save on insert&#39;&lt;br /&gt;&lt;br /&gt; PRINT CHAR(9) + &#39;DECLARE @ACTION CHAR(1)&#39;&lt;br /&gt;&lt;br /&gt; PRINT &#39;&#39;&lt;br /&gt; PRINT CHAR(9) + &#39;IF EXISTS(SELECT * FROM DELETED) AND EXISTS(SELECT * FROM INSERTED)&#39;&lt;br /&gt; PRINT CHAR(9) + CHAR(9) + &#39;SET @ACTION = &#39;&#39;U&#39;&#39;&#39;&lt;br /&gt; PRINT CHAR(9) + &#39;ELSE IF EXISTS(SELECT * FROM DELETED) &#39;&lt;br /&gt; PRINT CHAR(9) + CHAR(9) + &#39;SET @ACTION = &#39;&#39;D&#39;&#39; &#39;&lt;br /&gt; PRINT CHAR(9) + &#39;ELSE IF EXISTS(SELECT * FROM INSERTED)&#39;&lt;br /&gt; PRINT CHAR(9) + CHAR(9) + &#39;SET @ACTION = &#39;&#39;I&#39;&#39; &#39;&lt;br /&gt; PRINT &#39;&#39;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; DECLARE @CAMPOS VARCHAR(8000)&lt;br /&gt; SET @CAMPOS = &#39;&#39;&lt;br /&gt; DECLARE Table_cursor CURSOR FOR&lt;br /&gt;  SELECT&lt;br /&gt;   c.name AS column_name&lt;br /&gt;  FROM&lt;br /&gt;   sys.objects AS o&lt;br /&gt;  INNER JOIN&lt;br /&gt;   sys.columns AS c&lt;br /&gt;  ON ( o.object_id = c.object_id)&lt;br /&gt;  WHERE&lt;br /&gt;   o.type = &#39;U&#39;&lt;br /&gt;   AND o.name = @object_name&lt;br /&gt;  ORDER BY&lt;br /&gt;   o.name ,&lt;br /&gt;   column_id&lt;br /&gt; OPEN Table_cursor&lt;br /&gt; FETCH NEXT FROM Table_cursor&lt;br /&gt; INTO @column_name&lt;br /&gt;&lt;br /&gt; WHILE @@FETCH_STATUS = 0&lt;br /&gt; BEGIN&lt;br /&gt;  SET @CAMPOS = @CAMPOS + &#39;&#39; + &#39; [&#39; + @column_name + &#39;] ,&#39;&lt;br /&gt; &lt;br /&gt;  FETCH NEXT FROM Table_cursor&lt;br /&gt;  INTO @column_name&lt;br /&gt; END&lt;br /&gt; CLOSE Table_cursor&lt;br /&gt; DEALLOCATE Table_cursor&lt;br /&gt; PRINT CHAR(9) + &#39;SET NOCOUNT ON&#39;&lt;br /&gt;&lt;br /&gt; PRINT CHAR(9) + &#39;IF (@ACTION IN ( &#39;&#39;I&#39;&#39;)) BEGIN&#39;&lt;br /&gt; PRINT CHAR(9) + CHAR(9) + &#39;INSERT INTO &#39; + @Audit_name + &#39; &#39;&lt;br /&gt; PRINT CHAR(9) + CHAR(9) + &#39;( &#39; + @CAMPOS + &#39;[AUDIT_ACTION], [AUDIT_DATE], [AUDIT_USER], [AUDIT_APLICATION],[AUDIT_HOST])&#39;&lt;br /&gt; PRINT CHAR(9) + CHAR(9) + &#39; SELECT &#39; + @CAMPOS + &#39;@ACTION, GetDate(), USER_NAME(), APP_NAME(), HOST_NAME() FROM INSERTED&#39;&lt;br /&gt; PRINT CHAR(9) + &#39;END&#39;&lt;br /&gt;&lt;br /&gt; PRINT CHAR(9) + &#39;ELSE IF (@ACTION IN (&#39;&#39;U&#39;&#39;, &#39;&#39;D&#39;&#39;)) BEGIN&#39;&lt;br /&gt; PRINT CHAR(9) + CHAR(9) + &#39;INSERT INTO &#39; + @Audit_name + &#39; &#39;&lt;br /&gt; PRINT CHAR(9) + CHAR(9) + &#39;( &#39; + @CAMPOS + &#39;[AUDIT_ACTION], [AUDIT_DATE], [AUDIT_USER], [AUDIT_APLICATION],[AUDIT_HOST])&#39;&lt;br /&gt; PRINT CHAR(9) + CHAR(9) + &#39; SELECT &#39; + @CAMPOS + &#39;@ACTION, GetDate(), USER_NAME(), APP_NAME(), HOST_NAME() FROM DELETED&#39;&lt;br /&gt; PRINT CHAR(9) + &#39;END&#39;&lt;br /&gt; PRINT &#39;END&#39;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; PRINT &#39;---------------------------------------------------------&#39;&lt;br /&gt; PRINT &#39;--Informe de proceso&#39;&lt;br /&gt; PRINT &#39;---------------------------------------------------------&#39;&lt;br /&gt; PRINT &#39;--Se generò la tabla de auditoria &#39; + @Audit_name&lt;br /&gt; PRINT &#39;--Se generò sobre tabla &#39; + @object_name + &#39; el trigger &#39; + @trigger_name + &#39; &#39;&lt;br /&gt; PRINT &#39;--&#39;&lt;br /&gt; PRINT &#39;--Copie el contenido de resultado a un archivo. sql&#39;&lt;br /&gt; PRINT &#39;--Nombre: xxx_creacion_auditoria_&#39; + @object_name + &#39;.sql&#39;&lt;br /&gt; PRINT &#39;&#39;&lt;br /&gt; PRINT &#39;---------------------------------------------------------&#39;&lt;br /&gt; PRINT &#39;--Proccess info&#39;&lt;br /&gt; PRINT &#39;---------------------------------------------------------&#39;&lt;br /&gt; PRINT &#39;--Made the audit table named &#39; + @Audit_name&lt;br /&gt; PRINT &#39;--With the target table &#39; + @object_name + &#39; made the trigger &#39; + @trigger_name + &#39; &#39;&lt;br /&gt; PRINT &#39;--&#39;&lt;br /&gt; PRINT &#39;--Copy the result to a new query and save &#39;&lt;br /&gt; PRINT &#39;--Name: xxx_Create_Audit_&#39; + @object_name + &#39;.sql&#39;&lt;br /&gt;END&lt;br /&gt;/*&lt;br /&gt;Compatible SQL 2008&lt;br /&gt;SQL 2008 compatible&lt;br /&gt;*/&lt;br /&gt;   &lt;/CODE&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldimention.blogspot.com/feeds/3095891246331532704/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://sqldimention.blogspot.com/2010/09/audit-wizard-script.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/3095891246331532704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/3095891246331532704'/><link rel='alternate' type='text/html' href='http://sqldimention.blogspot.com/2010/09/audit-wizard-script.html' title='Audit Wizard Script (SQL server 2008)'/><author><name>SkyNet silverstar</name><uri>http://www.blogger.com/profile/13554111438503881841</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://bp0.blogger.com/_aY_6UVEczgs/R31CohKLrvI/AAAAAAAAC8M/ZLAYouAHYbM/S220/malvina.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059030279395245715.post-5134349537932223641</id><published>2010-09-15T22:22:00.000-07:00</published><updated>2010-09-15T22:27:11.056-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bienvenida"/><category scheme="http://www.blogger.com/atom/ns#" term="script"/><category scheme="http://www.blogger.com/atom/ns#" term="sql server"/><category scheme="http://www.blogger.com/atom/ns#" term="trucos"/><category scheme="http://www.blogger.com/atom/ns#" term="wizard"/><title type='text'>Bien venidos a SQL Dimention</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;Ante todo bienvenidos al blog, simplemente aquí podrán tener herramientas de SQL server script que son difíciles de encontrar para el profano y que muchos atesoran como un bien de familia, la realidad es que compartir es el mejor camino para poder enriquecer aun más el conocimiento.&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;Saludos cordiales&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;Skynet Silverstar&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldimention.blogspot.com/feeds/5134349537932223641/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://sqldimention.blogspot.com/2010/09/bien-venidos-sql-dimention.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/5134349537932223641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059030279395245715/posts/default/5134349537932223641'/><link rel='alternate' type='text/html' href='http://sqldimention.blogspot.com/2010/09/bien-venidos-sql-dimention.html' title='Bien venidos a SQL Dimention'/><author><name>SkyNet silverstar</name><uri>http://www.blogger.com/profile/13554111438503881841</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://bp0.blogger.com/_aY_6UVEczgs/R31CohKLrvI/AAAAAAAAC8M/ZLAYouAHYbM/S220/malvina.JPG'/></author><thr:total>0</thr:total></entry></feed>