<?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-5471390318983737874</id><updated>2024-11-06T02:45:53.675+00:00</updated><category term="SQL"/><category term="SQL Truques e Dicas"/><category term="Web Analytics"/><category term="Vista"/><category term="web 2"/><category term="windows vista"/><category term="Ano Novo"/><category term="Natal"/><category term="SQL Expressions"/><category term="Vista SP1"/><category term="Crystal"/><category term="Database Triggers"/><category term="Google"/><category term="It Tech Blogers"/><category term="SP"/><category term="VISTA Ecrã Preto"/><category term="Bem vindo IT web 2.0"/><category term="Bill Gates"/><category term="Birmânia"/><category term="Business Objects"/><category term="Cursor"/><category term="Entretenimento"/><category term="Excel"/><category term="Google Gphone"/><category term="Google Pesquisa Personalizada"/><category term="LOG"/><category term="MSSQL"/><category term="Movel"/><category term="Newsletter"/><category term="OPEN ID"/><category term="Rootkits"/><category term="SQL Identity"/><category term="TI"/><category term="UAC"/><category term="Urchin"/><category term="VM"/><category term="Virtualização"/><category term="WhilePrintingRecords"/><category term="Windows Filesystem"/><category term="_uacct"/><category term="espaco em disco"/><category term="férias"/><category term="informática"/><category term="segurança"/><category term="software Grátis"/><category term="web Office Online"/><title type='text'>IT Tech BuZ -  SQL - Crystal - OS</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>52</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-6661706763086433856</id><published>2011-09-05T01:30:00.000+01:00</published><updated>2011-09-05T14:55:55.750+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="espaco em disco"/><category scheme="http://www.blogger.com/atom/ns#" term="LOG"/><category scheme="http://www.blogger.com/atom/ns#" term="MSSQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Diminuir arquivos Log do MS SQL</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&amp;nbsp;Quando se tenta apagar/diminuir&amp;nbsp; o ficheiro log, por vezes pode-se tornar um pouco complicado.&lt;br /&gt;
Partilho aqui este script que vai ajudar a resolver, mas não se esqueçam de efetuar backup ao vosso sistema.&lt;br /&gt;
Basta alterar o nome de BaseDados para a tua base de dados.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;USE&amp;nbsp; BaseDados&lt;/span&gt;&lt;br style=&quot;color: blue;&quot; /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;GO&lt;/span&gt;&lt;br style=&quot;color: blue;&quot; /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;DBCC SHRINKFILE(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;BaseDados&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;_log, 10)&lt;/span&gt;&lt;br style=&quot;color: blue;&quot; /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;GO&lt;/span&gt;&lt;br style=&quot;color: blue;&quot; /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;BACKUP LOG&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;BaseDados&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt; WITH TRUNCATE_ONLY&lt;/span&gt;&lt;br style=&quot;color: blue;&quot; /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; GO&lt;/span&gt;&lt;br style=&quot;color: blue;&quot; /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;DBCC SHRINKFILE(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;BaseDados&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;, 10)&lt;/span&gt;&lt;br style=&quot;color: blue;&quot; /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;GO &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Aplica-se a: MSSQL Server 2005&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/6661706763086433856/comments/default' title='Enviar feedback'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/6661706763086433856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/6661706763086433856'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-520806004246976462</id><published>2009-12-18T18:47:00.000+00:00</published><updated>2009-12-18T18:47:53.136+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ano Novo"/><category scheme="http://www.blogger.com/atom/ns#" term="Database Triggers"/><category scheme="http://www.blogger.com/atom/ns#" term="Natal"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Triggers no Microsoft SQL Server</title><content type='html'>Os Triggers no MSSQL são muito úteis, mas temos de ter algumas precauções no seu uso, porque &amp;nbsp;ao usarmos &amp;nbsp;&quot;nested triggers&quot; o SQL Server só nos permite correr até 32 de uma só vez (execmplo um trigger dispara com um insert numa tabela que depois dispara outro trigger para outra tabela e assim sucessivamente até 32).&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Podem ser usados para:&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Inserir (Insert), actualizar (Update), Apagar (Delete)&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Se usar a sintaxe AFTER, ou seja depois de uma acção e também podemos usar a sintaxe FOR&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Exemplo usando &lt;span style=&quot;color: blue;&quot;&gt;FOR&lt;/span&gt;&amp;nbsp;e&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;deleted&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066; font-family: Courier, Verdana, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;span style=&quot;font-size: 11px; white-space: pre-wrap;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;CREATE TRIGGER Save_Deleted_records&lt;br /&gt;
&amp;nbsp;ON dbo.Table_Test&lt;br /&gt;
&amp;nbsp;FOR DELETE&lt;br /&gt;
&amp;nbsp;AS&lt;br /&gt;
&amp;nbsp;INSERT deleted_records_mark&lt;br /&gt;
SELECT * FROM deleted&lt;/span&gt;     &lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;mais no Site da Microsoft neste link&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms190739(SQL.90).aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/ms190739(SQL.90).aspx&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms190739(SQL.90).aspx&quot;&gt;&lt;/a&gt;Exemplo usando &lt;span style=&quot;color: blue;&quot;&gt;AFTER&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Create TRIGGER dbo.UpdateTrigger ON dbo.Table3&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;AFTER INSERT AS&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;BEGIN&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; SET NOCOUNT ON;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; declare @ticket &amp;nbsp;as varchar(8)&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; set @ticket = (select callid from inserted)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; update subset set uticketrem = @ticket where custtype&amp;lt;&amp;gt;&#39;Facility&#39; and callid=@ticket&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;END&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Instead of Insert, Update, Delete&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Isto quer dizer que poderá uma outra acção se for um insert poderá não fazer nada ou efectuar outra acção.&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;CREATE TRIGGER Example_Trigger on Table1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;INSTEAD OF INSERT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;BEGIN&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;-- Instead of inserting you can do other operations&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;INSERT INTO Table45&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; SELECT RowMatCol, Date_Doc&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; FROM inserted&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;END&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Mais no site da Microsoft aqui &lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://technet.microsoft.com/en-us/library/ms175089.aspx&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;http://technet.microsoft.com/en-us/library/ms175089.aspx&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: medium;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;color: blue; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;&quot;&gt;&lt;a href=&quot;http://ittechbuz.blogspot.com/?utm_source=Post_trigger_IT_Tech_Buz_SQL_PT&amp;amp;utm_medium=post&amp;amp;utm_campaign=Cartao_Natal&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIyqIJXiariGi9hdBBxqYREGhh_h2-rEEt9S9muRInIfPw4S37TbQVyF2DS0XXtNg3p3XvODFu6Sj3k7k-cQcKKLzc3CP7c61qLulddXVFUqgCW3P_GW8hO3UptY-L6ouvmtyINMLBw1p5/s400/Cartao_Natal_3x2.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;Bom Natal e Boas Entradas em 2010&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;Particionado&amp;nbsp;por &amp;nbsp;&lt;a href=&quot;http://ittechbuz.com/?Post_Triggers_IT_TechBuz#&quot;&gt;IT Tech BuZ&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/520806004246976462/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2009/12/triggers-no-microsoft-sql-server.html#comment-form' title='3 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/520806004246976462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/520806004246976462'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2009/12/triggers-no-microsoft-sql-server.html' title='Triggers no Microsoft SQL Server'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIyqIJXiariGi9hdBBxqYREGhh_h2-rEEt9S9muRInIfPw4S37TbQVyF2DS0XXtNg3p3XvODFu6Sj3k7k-cQcKKLzc3CP7c61qLulddXVFUqgCW3P_GW8hO3UptY-L6ouvmtyINMLBw1p5/s72-c/Cartao_Natal_3x2.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-4519419656193540318</id><published>2009-10-30T20:48:00.000+00:00</published><updated>2009-10-30T20:48:51.761+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Expressions"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Truques e Dicas"/><title type='text'>Função SQL Útil para Usar a Data e Hora</title><content type='html'>&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Hoje trago-vos uma função que é muito util que &quot;pega&quot; na data actual que é executada &amp;nbsp;e transforma para este formato numa&amp;nbsp;única&amp;nbsp;string YYYYMMDDHHMMSS (example for 30-10-2009 &amp;nbsp;20:01:01 will be 20091030200101).&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Use &amp;nbsp;ASuaBasedeDados&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 16px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Create function [dbo].[F_DataHora]()&lt;br /&gt;
returns varchar(50)&lt;br /&gt;
as&lt;br /&gt;
begin&lt;br /&gt;
declare @datanext varchar(50)&lt;br /&gt;
select @datanext =&lt;br /&gt;
(select (substring ((select convert(varchar(10),getdate(),103)),7,4)))+&amp;nbsp; -- Ano&lt;br /&gt;
(select (substring ((select convert(varchar(10),getdate(),103)),4,2)))+ -- Mês&lt;br /&gt;
((select (substring ((select convert(varchar(10),getdate(),103)),1,2)))+ -- Dia&lt;br /&gt;
replace((select convert(varchar(8),getdate(),108) ),&#39;:&#39;,&#39;&#39;)) -- hora e mnutos HHMMSS&lt;br /&gt;
&lt;br /&gt;
return @datanext&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 16px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Depois podemos experimentar e verificar o resultado:&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Use&amp;nbsp;ASuaBasedeDados&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Go&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Select&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 16px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;[dbo].[F_DataHora]()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;20091030203830&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/4519419656193540318/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2009/10/funcao-sql-util-para-usar-data-e-hora.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/4519419656193540318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/4519419656193540318'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2009/10/funcao-sql-util-para-usar-data-e-hora.html' title='Função SQL Útil para Usar a Data e Hora'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-7639453629411858579</id><published>2009-08-28T16:43:00.004+01:00</published><updated>2009-09-01T17:57:01.656+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SP"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Truques e Dicas"/><title type='text'>Gestão de Erros no SQL</title><content type='html'>&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Deve usar as melhores praticas quando estamos a elaborar Stored procedures para evitarmos problemas futuros, vamos ver 1º a sintaxe:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;/span&gt;&lt;br /&gt;Create Procedure Nametheprocedure&lt;br /&gt;-- Parâmetros  input or output ( Variaveis )&lt;br /&gt;As&lt;br /&gt;BEGIN TRY&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;    Begin Transaction&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;            -- Comandos&lt;br /&gt;  &lt;/span&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;commit transaction  -- Se correr sem erros aplica a transacção na base de dados&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt; &lt;br /&gt;END TRY&lt;br /&gt;&lt;br /&gt;BEGIN CATCH&lt;br /&gt;&lt;br /&gt;   SELECT ERROR_NUMBER(), ERROR_MESSAGE()&lt;br /&gt;&lt;br /&gt;   Rollback  -- Em caso erro não aplica a transacção&lt;br /&gt;&lt;br /&gt;END CATCH&lt;br /&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Em baixo está um exemplo para a abase dados Adventure Works&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;CREATE PROCEDURE Production.AddProductReview&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;    @ProductID int,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;    @ReviewerName nvarchar(50),          &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;    @EmailAddress nvarchar(50),&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;    @Rating int,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;    @Comments nvarchar(3850)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;as&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;BEGIN TRY&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;Begin transaction;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;    INSERT    Production.ProductReview (ProductID, ReviewerName, EmailAddress, Rating, Comments)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;    VALUES    (@ProductID, @ReviewerName, @EmailAddress, @Rating, @Comments)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;    commit transaction;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;END TRY&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;BEGIN CATCH&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;    SELECT ERROR_NUMBER(), ERROR_MESSAGE()&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;    rollback transaction;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;END CATCH&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;-- Test stored procedure with error handling&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;EXECUTE Production.AddReview 715, &#39;Doug&#39;, &#39;doug@siteexample.com&#39;, 10, &#39;Great product!&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Temas relacionados :&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://ittechblogers.blogspot.com/2009/04/sp-para-copiar-ficheiros.html?utm_source=relacionado&amp;amp;utm_medium=blog&quot;&gt;SP para copiar ficheiros&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/7639453629411858579/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2009/08/gestao-de-erros-no-sql.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/7639453629411858579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/7639453629411858579'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2009/08/gestao-de-erros-no-sql.html' title='Gestão de Erros no SQL'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-8223578594268156666</id><published>2009-07-26T15:51:00.005+01:00</published><updated>2009-07-26T16:56:37.692+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Truques e Dicas"/><title type='text'>Manipulação da Data no SQL Server</title><content type='html'>&lt;div style=&quot;text-align: left;&quot;&gt;A manipulação da data no SQL Server, vamos ver na pratica alguns exemplos:&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 204, 0);&quot;&gt;-- Exemplo 1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;select getdate()&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Esta função retorna a data actual   &lt;i&gt;2009-07-26 14:55:03.210&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#33cc00;&quot;&gt;-- Exemplo 2&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;select GETDATE()+60&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Neste exemplo adicionamos 60 dias a data actual e o resultado é &lt;i&gt;2009-09-24 14:56:40.210&lt;/i&gt; &lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#33cc00;&quot;&gt;-- Exemplo 3 &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;select DATEADD(M,2,getdate()) -- M month, y year, d day&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;A função DateAdd function adiciona neste exemplo meses ou dias,ou  anos, a data actual ou outra colocada em variável . Então adicionando 2 meses a data corrente o resultado é &lt;i&gt;2009-09-26 14:57:48.117&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;a diferença de resultados entre o exemplo 2 e 3 (2 dias), porque no exemplo 2 adicionamos 60 dias e não 2 meses.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 204, 0);&quot;&gt;-- Exemplo 4&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;select DATEDIFF(DAY,(DATEADD(M,2,getdate())),(GETDATE()+60))&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Esta função calcula a diferença entre datas e retorna um numero inteiro,  usando o exemplo o resultado é -2 &lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#33cc00;&quot;&gt;-- Exemplo 5&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;SET DATEFORMAT dmy;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;DECLARE @datevar datetime&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;Set @datevar=GETDATE()&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;select @datevar&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Neste exemplo formata-mos a data do tipo dd-mm-aaaa&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#33cc00;&quot;&gt;-- Exemplo 6&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;select substring((convert(varchar(10),@datevar,127)),1,10)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;resultado 2009-07-26&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Conversão de tipo de dados de DateTime para varchar(10),  usando o parâmetro 127 ( yyyy-mm-dd) que nos indica o formato da data&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 204, 0);&quot;&gt;-- Exemplo 7&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;select substring((convert(varchar(10),@datevar,103)),1,10) &lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366ff;&quot;&gt;resultado 26/07/2009&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Conversão de tipo de dados de DateTime para varchar(10),  usando o parâmetro 103 ( yyyy-mm-dd) que nos indica o formato da data (dd/mm/aaaa)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Mais documentação sobre a função convert em &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa226054%28SQL.80%29.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/aa226054(SQL.80).aspx&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Mais sobre as funções de data em &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa258863%28SQL.80%29.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/aa258863(SQL.80).aspx&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/8223578594268156666/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2009/07/manipulacao-da-data-no-sql-server.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/8223578594268156666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/8223578594268156666'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2009/07/manipulacao-da-data-no-sql-server.html' title='Manipulação da Data no SQL Server'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-7907147207792195263</id><published>2009-06-05T22:32:00.006+01:00</published><updated>2009-06-05T23:07:05.345+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Database Triggers"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Expressions"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Truques e Dicas"/><title type='text'>Database Triggers</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_r5476PqopRMeaxQp6p2xD3IlbrS9zcbjmEdNK_cZZr-84rVdSXw7yYICTml1vSMvhO8C3TEJLHD9fXWXMQByKc7st9Zgv_qP3nrHBy6VbzEFkErcZ5_r4ntby-b77UHw1bs8aPaDSwk/s1600-h/SQL_Truques+e+Dicas.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 301px; height: 74px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_r5476PqopRMeaxQp6p2xD3IlbrS9zcbjmEdNK_cZZr-84rVdSXw7yYICTml1vSMvhO8C3TEJLHD9fXWXMQByKc7st9Zgv_qP3nrHBy6VbzEFkErcZ5_r4ntby-b77UHw1bs8aPaDSwk/s320/SQL_Truques+e+Dicas.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5343960843403405042&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Mais um apontamento nesta rubrica que eu pretendo que seja uma mais valia e como tal acrescente saber. Posto isto, hoje vou-te falar dos Database Triggers  estes servem para várias funções referente a auditoria das nossas base de dados em que alteramos as tabelas e necessitamos de colocar numa tabela para efeitos de auditoria. Vou então mostrar-te com um exemplo para evitar que tabelas sejam apagadas ou criadas, atenção é só um exemplo.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;Use BaseDados&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;go&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;Create TRIGGER [DBTR_Teste_Drop_Create]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;ON DATABASE&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;FOR DDL_TABLE_VIEW_EVENTS&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;AS&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;DECLARE @data xml&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;DECLARE @cmd nvarchar(350)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;DECLARE @logMsg nvarchar(400)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;SET @data = eventdata()&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;SET @cmd = @data.value&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;  (&#39;(/EVENT_INSTANCE/TSQLCommand/CommandText)[1]&#39;, &#39;nvarchar(350)&#39;)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;SET @logMsg = @cmd + &#39; (&#39; + SYSTEM_USER + &#39; on &#39; + HOST_NAME() + &#39;)&#39;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;RAISERROR (@logMsg, 10, 1) WITH LOG&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 204, 0);&quot;&gt;-- Para Visualizar o Comando executado&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 204, 0);&quot;&gt;-- select @cmd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 204, 0);&quot;&gt;-- Aqui não permitimos criar objectos na base de dados (Exemplo: Create Table)&lt;br /&gt;-- pois efectuamos o rollback&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;br /&gt;if left(@cmd,6)=&#39;Create&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;rollback &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 204, 0);&quot;&gt;-- Aqui não permitimos apagar objectos na base de dados (Exemplo: drop table)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 204, 0);&quot;&gt;-- pois efectuamos o rollback&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;if left(@cmd,4)=&#39;drop&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;rollback &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Nota: podemos criar uma tabela com as variáveis com o tipo indicado e inserir os erros&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/7907147207792195263/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2009/06/database-triggers.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/7907147207792195263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/7907147207792195263'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2009/06/database-triggers.html' title='Database Triggers'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_r5476PqopRMeaxQp6p2xD3IlbrS9zcbjmEdNK_cZZr-84rVdSXw7yYICTml1vSMvhO8C3TEJLHD9fXWXMQByKc7st9Zgv_qP3nrHBy6VbzEFkErcZ5_r4ntby-b77UHw1bs8aPaDSwk/s72-c/SQL_Truques+e+Dicas.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-6049666808277274741</id><published>2009-04-21T12:23:00.003+01:00</published><updated>2009-04-21T12:27:26.419+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Truques e Dicas"/><title type='text'>SP para Copiar Ficheiros</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zGU4940Obz5rPugnvEUFT-zhH_XrsBnPLXHTqowwIdSdhWlK6HYKvYOYjmN-dr9BZI9pZh2s0isYAu_jifRbpOD8x4posLAZsK5X53iCNFRlW0GBBpGjc6hBwAod3UmaUE1S118iw8g/s1600-h/SQL_Truques+e+Dicas.jpg&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 301px; height: 74px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zGU4940Obz5rPugnvEUFT-zhH_XrsBnPLXHTqowwIdSdhWlK6HYKvYOYjmN-dr9BZI9pZh2s0isYAu_jifRbpOD8x4posLAZsK5X53iCNFRlW0GBBpGjc6hBwAod3UmaUE1S118iw8g/s320/SQL_Truques+e+Dicas.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5327104586556706578&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sp para copiar ficheiros muito útil&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255); &quot;&gt;USE [aspnetdb] -- Replace with your DB&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;/****** Object:  StoredProcedure [dbo].[usp_copiamsg]    Script Date: 04/21/2009 09:22:20 ******/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;SET ANSI_NULLS ON&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;SET QUOTED_IDENTIFIER ON&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;Create procedure [dbo].[usp_copiamsg]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;@msg as varchar(200),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;@input as varchar(100)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;,@retorno as varchar(200) output&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;as&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;Begin &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;br /&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;declare @drive as varchar(100)&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;declare @drive_dest as varchar(100)&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;declare @path as varchar(800)&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;declare @path_dest as varchar(800)&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;declare @cmd as varchar(800)&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;declare @ext as char(3)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;br /&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;set @path_dest=&#39;\Dest_Path\&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;-- Para Exemplo, não esquecer barra de directorio final &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255); &quot;&gt;--&lt;/span&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 class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;set @path=&#39;\PROGRA~1\DATA\&#39;&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;set @drive=&#39;c:&#39;&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;set @drive_dest=&#39;d:&#39;&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;set @cmd=&#39;copy &#39;+@drive+@path+@msg+@ext&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;set @cmd=@cmd+@drive_dest+@path_dest+ltrim(rtrim(@input))+(select  cast(day(getdate())  as varchar(2)))&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;+(select  cast(month(getdate())  as varchar(2)))&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;+(select  cast(year(getdate())  as varchar(4)))&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;+replace((select convert(varchar(8),getdate(),108)),&#39;:&#39;,&#39;&#39;)+@ext&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;-- Para Testar Caminhos e Visualizar&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255); &quot;&gt;-- select @cmd&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;br /&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;color: rgb(51, 102, 255);&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;exec master..xp_cmdshell @cmd ,no_output&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;br /&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;Set @retorno=@drive_dest+@path_dest+ltrim(rtrim(@input))+(select  cast(day(getdate())  as varchar(2)))&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;+(select  cast(month(getdate())  as varchar(2)))&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;+(select  cast(year(getdate())  as varchar(4)))&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;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;+replace((select convert(varchar(8),getdate(),108)),&#39;:&#39;,&#39;&#39;)+@ext&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/6049666808277274741/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2009/04/sp-para-copiar-ficheiros.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/6049666808277274741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/6049666808277274741'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2009/04/sp-para-copiar-ficheiros.html' title='SP para Copiar Ficheiros'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zGU4940Obz5rPugnvEUFT-zhH_XrsBnPLXHTqowwIdSdhWlK6HYKvYOYjmN-dr9BZI9pZh2s0isYAu_jifRbpOD8x4posLAZsK5X53iCNFRlW0GBBpGjc6hBwAod3UmaUE1S118iw8g/s72-c/SQL_Truques+e+Dicas.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-2592192000310256172</id><published>2009-03-09T20:42:00.004+00:00</published><updated>2009-03-09T21:15:53.056+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISTA Ecrã Preto"/><category scheme="http://www.blogger.com/atom/ns#" term="windows vista"/><title type='text'>Vista Ecrã Preto parte II</title><content type='html'>Depois de uma analise cuidada verifiquei que existe muitos pedidos, ou leitores que passavam por cá, não obtinham a resposta adequada as suas necessidades, por isso cá vai.&lt;br /&gt;&lt;br /&gt;Caros o que se deve fazer quando o Windows Vista fica com o Ecrã preto, de certo instalaram alguma aplicação não compativel com o Vista.&lt;br /&gt;&lt;br /&gt;A solução mais rápida é efectuar o &lt;span style=&quot;font-weight: bold;&quot;&gt;restauro do sistema&lt;/span&gt; depois de entrar em &lt;span style=&quot;font-weight: bold;&quot;&gt;Modo de Segurança&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Vocês perguntam como ?&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Desligar o pc e voltar ligar, depois do teste de memória pressionar a tecla F8&lt;/li&gt;&lt;li&gt;Quando o computador ligar e apresentar no ecrã que esta em Modo de Segurança&lt;/li&gt;&lt;li&gt;Seleccionar &quot; Restauro do Sistema&quot;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifuNPosqACshiI2gULyDfyLmcPcFnGaJkQkEao36lgBZ6S_2jk-d_PO-4kp0m7b74a-udQPWksQtBR3SOFGmonGugFbgED7Uf9coTPGJVTn_jhE4sdQdMPsxHbXQLdbYyD_qw3iKqbXDE/s1600-h/Restauro+do+sistema.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 335px; height: 400px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifuNPosqACshiI2gULyDfyLmcPcFnGaJkQkEao36lgBZ6S_2jk-d_PO-4kp0m7b74a-udQPWksQtBR3SOFGmonGugFbgED7Uf9coTPGJVTn_jhE4sdQdMPsxHbXQLdbYyD_qw3iKqbXDE/s400/Restauro+do+sistema.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5311297309255914130&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Escolher o último caso tenha sido muito recentemente, ou escolher outro.&lt;/li&gt;&lt;li&gt;Depois aguarde enquanto o computador repõe o modo de restauro&lt;/li&gt;&lt;li&gt;Quando iniciar normalmente, em principio estará resolvido  o problema&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Nota Muito Importante&lt;/span&gt;:&lt;br /&gt;Os documentos, fotografias e dados de aplicações devem estar salvaguardados através de cópias de segurança.</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/2592192000310256172/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2009/03/vista-ecra-preto-parte-ii.html#comment-form' title='2 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/2592192000310256172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/2592192000310256172'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2009/03/vista-ecra-preto-parte-ii.html' title='Vista Ecrã Preto parte II'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifuNPosqACshiI2gULyDfyLmcPcFnGaJkQkEao36lgBZ6S_2jk-d_PO-4kp0m7b74a-udQPWksQtBR3SOFGmonGugFbgED7Uf9coTPGJVTn_jhE4sdQdMPsxHbXQLdbYyD_qw3iKqbXDE/s72-c/Restauro+do+sistema.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-258884738849521447</id><published>2009-03-04T14:19:00.008+00:00</published><updated>2009-03-17T21:41:03.891+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Business Objects"/><category scheme="http://www.blogger.com/atom/ns#" term="Crystal"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Expressions"/><category scheme="http://www.blogger.com/atom/ns#" term="WhilePrintingRecords"/><title type='text'>Mais ainda sobre Crystal SQL Expressions e WhilePrintingRecords</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;Times New Roman&#39;;&quot;&gt;&lt;div style=&quot;border-width: 0px; margin: 0px; padding: 3px; width: auto; font-family: Georgia,serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 100%; line-height: normal; font-size-adjust: none; font-stretch: normal; text-align: left;&quot;&gt;&lt;div&gt;&lt;div&gt;Caros como existe muitas pesquisas sobre este tema aqui vai desta vez com imagens&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpQg77B4AOvy-VkxkvD1X9p2so1GLqqk_cLviwjAGsSERNAfdovrg822mg0wuF4Pp1tCJE6MSixIn2Iuyv3ic2A-Z4t6e2RrbiUwQfpI6lN0OPIKrxPZwWf3XbPngDOnkLBwkMdamBrMo/s400/Crystal_Sql_Express_1.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5309314696752462930&quot; style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 243px;&quot; border=&quot;0&quot; /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;Vamos ver mais de perto&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipvyIdrsDAdkldwkmdETB4bduFa4Gmjax8i09vJ4Ch8U-9j2rJovrF5qpngvWXHHIqURkyE0759psKeaGGgIjgsNVNoEgMmL2Dpyf6hMLYFa8EtP68jNGvuu2WNLTENBTDgBLwaRkM5F4/s400/Crystal_Sql_Express_1_2.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5309332883228165218&quot; style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 98px;&quot; border=&quot;0&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;Convert campo Text para varchar&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivF2GaWll_7npfT7UBg2I6IJG-yi6GU0p1BA7wBtlMBDlxCoHzGDzZuYRvkFAahNSKmZQxD5NCJC1tobvyFvSUKxtxCEiAqU3wpqGZC0QDKhFEFvunfNFqoP83q0sixBc4nhJGqELLOfc/s400/Crystal_Sql_Express_2.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5309334740840839074&quot; style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 161px;&quot; border=&quot;0&quot; /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt; Soma na formula o campo na 1ª posição e agrupa pelo campo2&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;Whileprintingrecords;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sum ({tabela1.campo1},{tabela1.campo2})&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Soma dois campos da tabela na formula em baixo&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;WhilePrintingRecords;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt; ({file.Qty1}+ {file.Qty2})&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;clique &lt;a href=&quot;http://publib.boulder.ibm.com/infocenter/iadthelp/v7r0/index.jsp?topic=/com.businessobjects.integration.eclipse.designer.doc/designer/Functions233.html&quot;&gt;aqui&lt;/a&gt; para visualizar uma ajuda&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Veja mais ainda em &lt;a href=&quot;http://ittechblogers.blogspot.com/2008/06/crystal-while-printing-records-e-sql.html&quot;&gt;http://ittechblogers.blogspot.com/2008/06/crystal-while-printing-records-e-sql.html&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/258884738849521447/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2009/03/mais-ainda-sobre-crystal-sql.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/258884738849521447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/258884738849521447'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2009/03/mais-ainda-sobre-crystal-sql.html' title='Mais ainda sobre Crystal SQL Expressions e WhilePrintingRecords'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpQg77B4AOvy-VkxkvD1X9p2so1GLqqk_cLviwjAGsSERNAfdovrg822mg0wuF4Pp1tCJE6MSixIn2Iuyv3ic2A-Z4t6e2RrbiUwQfpI6lN0OPIKrxPZwWf3XbPngDOnkLBwkMdamBrMo/s72-c/Crystal_Sql_Express_1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-843563398282059705</id><published>2009-01-18T17:10:00.011+00:00</published><updated>2009-01-18T18:41:39.960+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cursor"/><category scheme="http://www.blogger.com/atom/ns#" term="SP"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Truques e Dicas"/><title type='text'>Criar SP com Cursor</title><content type='html'>Após alguma ausência derivado a diversos acontecimentos profissionais , já reparam que o Blog mudou de nome em virtude do registo do dominio &lt;a href=&quot;http://www.ittechbuz.com&quot;&gt;www.ITTechBuZ.com&lt;/a&gt; e novo logo.&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikEb7THsE9kvXjmdHjJh1O7fIAW4_sIEOVZ0J3sv7jgvqA-G6BdxaIML_w3EE3Wlpz1dCv6CnT0h-MTMtkNcU3b3PMHMdK6HZb85odXywGokURqKsYi5oaK_0aJa1ZVgnc-bV892m4JrA/s1600-h/ITTECHBUZ_LOGO_120x120.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 120px; height: 120px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikEb7THsE9kvXjmdHjJh1O7fIAW4_sIEOVZ0J3sv7jgvqA-G6BdxaIML_w3EE3Wlpz1dCv6CnT0h-MTMtkNcU3b3PMHMdK6HZb85odXywGokURqKsYi5oaK_0aJa1ZVgnc-bV892m4JrA/s400/ITTECHBUZ_LOGO_120x120.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5292693120716555074&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Este logo transmite a comunicação como grande vertente pilar nas tecnologias de informação com o mundo empresárial e entre todos. Este Blog continua em 2009 a principalmente a publicar para técnicos. Hoje Domingo aproveito para deixar mais um apontamento da rubrica SQL Truques &amp;amp; Dicas com uma SP com um cursor.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf4JjijbzdH7yp0DOBHVPdjEgwabAjSd4NvSk2vh3MnKRvOMhul5L7I2ZXEMsG47iO5EFF4CCD-Iwu6-nFBpcul56iJhYpirWTj8Un9yiRAG9wfYi-QP8YjFthzNlF-c6YaNN2qCDp7Vg/s1600-h/SQL_Truques+e+Dicas.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 301px; height: 74px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf4JjijbzdH7yp0DOBHVPdjEgwabAjSd4NvSk2vh3MnKRvOMhul5L7I2ZXEMsG47iO5EFF4CCD-Iwu6-nFBpcul56iJhYpirWTj8Un9yiRAG9wfYi-QP8YjFthzNlF-c6YaNN2qCDp7Vg/s400/SQL_Truques+e+Dicas.jpg&quot; alt=&quot;SQL Truques &amp;amp; Dicas &quot; id=&quot;BLOGGER_PHOTO_ID_5292702020855237042&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;Esta sp é para usar para actualizar consumo de horas numa aplicação&lt;br /&gt;&lt;br /&gt;--&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;-- Cria a SP com o nome sp_actualiza_onsite&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;--&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;create procedure [dbo].[sp_actualiza_onsite]&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt; as Begin&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;--&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;-- Insere Ticket depois de Fechado (Estado &#39;Closed&#39;)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;-- Uso um Insert a partir de um Select&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;--&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;INSERT INTO [HEAT].[dbo].[Tickets] ([CallId] ,[CallType] ,[CriData] ,[Valor] ,[Saldo] ,[UIDMANUT])&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt; select d.callid,c.calltype,c.closeddate, d.horas_gastas, d.horas_saldo&lt;br /&gt;,d.uidmanut&lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;,c.custid&lt;br /&gt;from detail d&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;inner join calllog c on c.callid=d.callid&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;inner join subset s on s.callid=c.callid&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;inner join config cfg on cfg.u_idreg=d.uidmanut&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;where (c.calltype=&#39;Onsite&#39; or c.calltype=&#39;Packs&#39;) and c.callstatus=&#39;Closed&#39; and c.actualiza&lt;&gt;&#39;SIM&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;and c.callid not in (select callid from tickets )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;-- &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;-- Actualiza contratos com as Horas Gastas&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;-- Cursor usado para update&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;-- &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;-- &lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Declaração do Cursor com o nome de &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;cursor_Tickets&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; --  Select aonde vai correr o cursor&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;DECLARE Cursor_tickets CURSOR for   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;SELECT t.CallId,c.custid,t.Valor,t.UIDMANUT &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt; from tickets t&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;inner join calllog c on c.callid=t.callid&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;where t.[CallType]=&#39;Onsite&#39; and c.actualiza &lt;&gt;&#39;SIM&#39;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;--&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;-- Declaração de Variaveis para passar do Cursor&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;--&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;Declare @Callid varchar(8)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;declare @custid varchar(50)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;declare @valor decimal(17,2)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;declare @uidmanut varchar(25)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;set @callid=&#39;&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;set @custid=&#39;&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;set @valor=0&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;set @uidmanut=&#39;&#39;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;Open Cursor_tickets /* abrir o cursor */&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;fetch next from Cursor_tickets&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;into @callid,@custid,@valor,@uidmanut&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;while @@fetch_Status=0&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;--- Actualização das Horas Gastas&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;--- select @valor,@custid,@uidmanut  (usado para verificação e teste)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;update config set horas_gastas=isnull(@valor,0)+(isnull(horas_gastas,0)) ,horas_saldo=isnull(horas_saldo,0)-isnull(@valor,0)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;where u_idreg=@uidmanut and custid=@custid&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;set @callid=&#39;&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;set @custid=&#39;&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;set @valor=0&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;set @uidmanut=&#39;&#39;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;fetch next from Cursor_Tickets&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;into @callid,@custid,@valor,@uidmanut&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;end&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;close Cursor_tickets&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;Deallocate Cursor_tickets&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;-- &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;-- &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;No Final actualiza a tabela de forma a não repetir os registos já processados&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;-- &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;update calllog set actualiza=&#39;SIM&#39; where callid in (select callid from tickets) and actualiza&lt;&gt;&#39;SIM&#39;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;end&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/843563398282059705/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2009/01/criar-sp-com-cursor.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/843563398282059705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/843563398282059705'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2009/01/criar-sp-com-cursor.html' title='Criar SP com Cursor'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikEb7THsE9kvXjmdHjJh1O7fIAW4_sIEOVZ0J3sv7jgvqA-G6BdxaIML_w3EE3Wlpz1dCv6CnT0h-MTMtkNcU3b3PMHMdK6HZb85odXywGokURqKsYi5oaK_0aJa1ZVgnc-bV892m4JrA/s72-c/ITTECHBUZ_LOGO_120x120.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-8775433811533608306</id><published>2008-12-21T00:13:00.001+00:00</published><updated>2008-12-21T00:15:06.342+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ano Novo"/><category scheme="http://www.blogger.com/atom/ns#" term="Natal"/><title type='text'>Boas Festas e Boas Entradas</title><content type='html'>&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://jorge.m.cunha.googlepages.com/arvore_natal2.jpg&quot;&gt;&lt;img src=&quot;http://jorge.m.cunha.googlepages.com/Arvore_Natal2.jpg?utm_source=Newsletter&amp;amp;utm_medium=eamil&amp;amp;utm_content=Imagem&amp;amp;utm_campaigan=Newsletter4+img&quot; longdesc=&quot;http://jorge.m.cunha.googlepages.com/Arvore_Natal2.jpg&quot; width=&quot;180&quot; height=&quot;134&quot; /&gt;&lt;/a&gt;&lt;/p&gt;Votos de Boas Festas e Feliz Ano Novo.&lt;br /&gt;&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/8775433811533608306/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2008/12/boas-festas-e-boas-entradas.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/8775433811533608306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/8775433811533608306'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2008/12/boas-festas-e-boas-entradas.html' title='Boas Festas e Boas Entradas'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-8513182463763666262</id><published>2008-11-18T15:09:00.003+00:00</published><updated>2008-11-19T22:28:54.118+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Truques e Dicas"/><title type='text'>Criar Trigger - SQL</title><content type='html'>&lt;table style=&quot;width: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;http://picasaweb.google.com/lh/photo/pPYSdxoA7DqPk4h3fRhNMQ&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY2jdz12MhREKhyUU2ydHEdCi1i0q6SwcT9_uZp7JIcd5_xt23Ph4IBm60iuzH_gofRfC6iXmQsXB2snNP7Rt_FI-Jlmm5wVGkvmC9kPVmtIPFA47KNt2bJoDdDl5ypiqOXNDg1J-ZsRM/s400/SQL_Tips%20and%20Tricks.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;font-family: arial,sans-serif; font-size: 11px; text-align: right;&quot;&gt;From &lt;a href=&quot;http://picasaweb.google.com/jorge.m.cunha/ItTechBlogers&quot;&gt;It Tech Blogers&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Esta sp cria automaticamente um trigger a correr a partir de um job no SQL Server, dá muito jeito quando necessitamos de alterar a tabela.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;Create procedure [dbo].[sp_creates_trigger]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;as&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;declare @texto nvarchar (800 ) &lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;-- Declara a variavel texto&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;set @texto=&#39;CREATE TRIGGER [subset_trig] ON [dbo].[Subtable] AFTER INSERT AS BEGIN SET NOCOUNT ON; declare @tfield as varchar(8) set @tfiled = (select id_num from inserted)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;update subtable set ufield = @tifield where customer&lt;&gt;&#39;&#39;Web&#39;&#39; and id_num=@tfield&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;END&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;-- set the trigger in table subtable for an action After Inserted that updates the table&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;exec sp_executesql @texto&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; -- executa sp com a variavel texto&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;end&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Esta funcionalidade é muito boa quando necessitamos de garantir que este trigger está presente.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/8513182463763666262/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2008/11/criar-trigger-sql.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/8513182463763666262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/8513182463763666262'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2008/11/criar-trigger-sql.html' title='Criar Trigger - SQL'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY2jdz12MhREKhyUU2ydHEdCi1i0q6SwcT9_uZp7JIcd5_xt23Ph4IBm60iuzH_gofRfC6iXmQsXB2snNP7Rt_FI-Jlmm5wVGkvmC9kPVmtIPFA47KNt2bJoDdDl5ypiqOXNDg1J-ZsRM/s72-c/SQL_Tips%20and%20Tricks.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-4089601942882474301</id><published>2008-11-06T22:38:00.006+00:00</published><updated>2008-11-20T20:53:04.233+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="web 2"/><category scheme="http://www.blogger.com/atom/ns#" term="Web Analytics"/><title type='text'>Novas funcionalidades no Google Analytics</title><content type='html'>Hoje não abordar o Microsoft SQL Server, mas sim o Google Analytics, é pena que outras ferramentas potentes do calibre do Google não me possa fornecer acesso a elas por isso, vamos lá falar.&lt;br /&gt;Estou maravilhado com o Google Analytics e as novas opções que são a possibilidade de configurar relatórios elaborados de acordo com a nossa vontade com as métricas, depois também podemos usar a opção de criar-mos a nossa própria segmentação vou mostar embaixo na imagem para poderem ver aquilo que eu quero dizer.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqNs7CS0BmdMofcsKIDMfBx8qAd7NtwqpAGd1Kn9xabFg5_n06AKVnQGFfdSXsCn1QXmg_wHOOyiDkWsAIbj9J-Ymb19I0dVZQGd9oNdu9pizf8BqBmqIyUeNJIqk_2ym8WKdtwuRHfMU/s1600-h/Google+Custom+Reports.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 677px; height: 404px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqNs7CS0BmdMofcsKIDMfBx8qAd7NtwqpAGd1Kn9xabFg5_n06AKVnQGFfdSXsCn1QXmg_wHOOyiDkWsAIbj9J-Ymb19I0dVZQGd9oNdu9pizf8BqBmqIyUeNJIqk_2ym8WKdtwuRHfMU/s400/Google+Custom+Reports.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5265680139721312354&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/4089601942882474301/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2008/11/novas-funcionalidades-no-google.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/4089601942882474301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/4089601942882474301'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2008/11/novas-funcionalidades-no-google.html' title='Novas funcionalidades no Google Analytics'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqNs7CS0BmdMofcsKIDMfBx8qAd7NtwqpAGd1Kn9xabFg5_n06AKVnQGFfdSXsCn1QXmg_wHOOyiDkWsAIbj9J-Ymb19I0dVZQGd9oNdu9pizf8BqBmqIyUeNJIqk_2ym8WKdtwuRHfMU/s72-c/Google+Custom+Reports.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-3141362777109501759</id><published>2008-09-30T11:21:00.005+01:00</published><updated>2008-10-13T00:33:06.710+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="web 2"/><category scheme="http://www.blogger.com/atom/ns#" term="Web Analytics"/><title type='text'>Email tracking com o Google Analytics</title><content type='html'>Nunca foi tão simples colocar link&#39;s nos email para efectuar a analise de quantas pessoas chegam ao seu site através do seu email e depois analisar o retorno. vejamos um exemplo :&lt;br /&gt;&lt;br /&gt;Vamos enviar um email e nos links devemos colocar a frente o que se encontra a azul&lt;br /&gt;&lt;a href=&quot;http://jorge.m.cunha.googlepages.com/newsletter3.html?utm_source=Newsletter&amp;amp;utm_medium=email&amp;amp;utm_content=Newsletter&amp;amp;utm_campaign=Newsletter3&quot;&gt;http://jorge.m.cunha.googlepages.com/newsletter3.htm&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;l?utm_source=&lt;span style=&quot;color: rgb(51, 204, 0); font-weight: bold;&quot;&gt;Newsletter&lt;/span&gt;&amp;amp;utm_medium=&lt;span style=&quot;color: rgb(51, 204, 0); font-weight: bold;&quot;&gt;email&lt;/span&gt;&amp;amp;utm_content=&lt;span style=&quot;font-weight: bold; color: rgb(51, 204, 0);&quot;&gt;Newsletter&lt;/span&gt;&amp;amp;utm_campaign=&lt;span style=&quot;color: rgb(0, 153, 0); font-weight: bold;&quot;&gt;Newsletter3&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A seguir ao seu link colocar o seguinte alterando para o desejado&lt;br /&gt;&lt;a href=&quot;http://jorge.m.cunha.googlepages.com/newsletter3.htm?utm_source=Newsletter&amp;amp;utm_medium=email&amp;amp;utm_content=Newsletter&amp;amp;utm_campaign=Newsletter3&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;?utm_source=&lt;span style=&quot;color: rgb(51, 204, 0); font-weight: bold;&quot;&gt;Newsletter&lt;/span&gt;&amp;amp;utm_medium=&lt;span style=&quot;color: rgb(51, 204, 0); font-weight: bold;&quot;&gt;email&lt;/span&gt;&amp;amp;utm_content=&lt;span style=&quot;font-weight: bold; color: rgb(51, 204, 0);&quot;&gt;Newsletter&lt;/span&gt;&amp;amp;utm_campaign=&lt;span style=&quot;color: rgb(0, 153, 0); font-weight: bold;&quot;&gt;Newsletter3&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span&gt;- O que está a verde é para alterar:&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span&gt;    - Utm_source=Newsletter ,ou seja, para determinar qual a nossa  acção&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span&gt;    - utm_medium=email , ou seja , qual a forma de envio da nossa  acção&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span&gt;    - utm_content=Newsletter , ou seja, desta forma determino qual o conteúdo&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span&gt;    - utm_campaign,ou seja, Nº da Newsletter &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Depois desta Informação podemos visualizar a informação seguinte&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOZF4UacHfax1iL10YmTWC4yJ1qnUYk4Egk0ZmHqVcXLLINNksioyES0HvpCZs6vB2K6pJWC84MXdifP9EmX5qKtd_YG-5DDOFW6NyWw9d8bz-yAowBDTvQbPcF43l7d-xpzU5M7hnx1LI/s1600-h/campaigns.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOZF4UacHfax1iL10YmTWC4yJ1qnUYk4Egk0ZmHqVcXLLINNksioyES0HvpCZs6vB2K6pJWC84MXdifP9EmX5qKtd_YG-5DDOFW6NyWw9d8bz-yAowBDTvQbPcF43l7d-xpzU5M7hnx1LI/s320/campaigns.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5251773784030618642&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;Não esquecer de colocar o script que coloca também nas suas páginas do seu site</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/3141362777109501759/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2008/09/email-tracking-com-o-google-analytics.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/3141362777109501759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/3141362777109501759'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2008/09/email-tracking-com-o-google-analytics.html' title='Email tracking com o Google Analytics'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOZF4UacHfax1iL10YmTWC4yJ1qnUYk4Egk0ZmHqVcXLLINNksioyES0HvpCZs6vB2K6pJWC84MXdifP9EmX5qKtd_YG-5DDOFW6NyWw9d8bz-yAowBDTvQbPcF43l7d-xpzU5M7hnx1LI/s72-c/campaigns.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-1262212283974207645</id><published>2008-09-21T18:23:00.004+01:00</published><updated>2008-09-21T18:32:15.747+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Newsletter"/><category scheme="http://www.blogger.com/atom/ns#" term="web 2"/><title type='text'>Newsletter</title><content type='html'>&lt;style type=&quot;text/css&quot;&gt;&lt;br /&gt;&lt;!-- .style1 {  font-family: arial;  font-size: 20px;  color: #CC6600; } .style2 {font-family: Verdana, Arial, Helvetica, sans-serif} --&gt;&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;style&gt;&lt;br /&gt; .headerTop { background-color:#FFCC66; border-top:0px solid #000000; border-bottom:1px solid #FFFFFF; text-align:center; }&lt;br /&gt; .adminText { font-size:10px; color:#996600; line-height:200%; font-family:verdana; text-decoration:none; }&lt;br /&gt; .headerBar { background-color:#FFFFFF; border-top:0px solid #333333; border-bottom:10px solid #FFFFFF; }&lt;br /&gt; .title { font-size:20px; font-weight:bold; color:#CC6600; font-family:arial; line-height:110%; }&lt;br /&gt; .subTitle { font-size:11px; font-weight:normal; color:#666666; font-style:italic; font-family:arial; }&lt;br /&gt; .defaultText { font-size:12px; color:#000000; line-height:150%; font-family:trebuchet ms; }&lt;br /&gt; .footerRow { background-color:#FFFFCC; border-top:10px solid #FFFFFF; }&lt;br /&gt; .footerText { font-size:10px; color:#996600; line-height:100%; font-family:verdana; }&lt;br /&gt; a { color:#FF6600; color:#FF6600; color:#FF6600;&lt;/style&gt;&lt;br /&gt;&lt;center&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogger.com/post-create.g?blogID=5471390318983737874&quot;&gt;&lt;img src=&quot;http://jorge.m.cunha.googlepages.com/JC_logo_original_v1_pt.jpg?utm_source=Newsletter&amp;amp;utm_medium=email&amp;amp;utm_content=Newsletter&amp;amp;utm_campaign=Newsletter3&quot; alt=&quot;Imagem do Logo Jorge Cunha&quot; name=&quot;editableImg1&quot; id=&quot;editableImg1&quot; title=&quot;Newsletter 2 - Jorge Cunha&quot; align=&quot;left&quot; border=&quot;0&quot; width=&quot;193&quot; height=&quot;73&quot; /&gt;&lt;span class=&quot;style2&quot;&gt;&lt;span style=&quot;font-size:7;&quot;&gt;NewsLetter 3&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table bg=&quot;&quot; style=&quot;color: rgb(255, 255, 255);&quot; cellpadding=&quot;20&quot; cellspacing=&quot;0&quot; width=&quot;550&quot;&gt;&lt;br /&gt;&lt;tbody&gt;&lt;tr&gt;&lt;br /&gt;&lt;td   style=&quot;line-height: 150%; color: rgb(255, 255, 255);font-family:trebuchet ms;font-size:12px;&quot; bg=&quot;&quot; valign=&quot;top&quot;&gt;&lt;br /&gt;&lt;p style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span class=&quot;style1&quot;&gt;Newsletter nº 3&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;color: rgb(0, 0, 0);&quot;&gt;Sumário:&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;color: rgb(0, 0, 0);&quot;&gt;Nesta Newsletter vou vos dar conhecimento de estou a por uma rubrica acerca do Microsoft SQL Server que se denomina de SQL Truques e Dicas em &lt;a href=&quot;http://www.ittechblogers.tk/?utm_source=Newsletter&amp;amp;utm_medium=email&amp;amp;utm_content=Newsletter&amp;amp;utm_campaign=Newsletter3&quot;&gt;http://itechblogers.tk&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;color: rgb(0, 0, 0);&quot;&gt; &lt;img src=&quot;http://jorge.m.cunha.googlepages.com/SQL_TruqueseDicas.jpg?utm_source=Newsletter&amp;amp;utm_medium=email&amp;amp;utm_content=Newsletter&amp;amp;utm_campaign=Newsletter3&quot; longdesc=&quot;Imagem de Logo SQL Truques e Dicas&quot; onclick=&quot;http://ittechblogers.tk?utm_source=Newsletter&amp;amp;utm_medium=email&amp;amp;utm_content=Newsletter&amp;amp;utm_campaign=Newsletter3&quot; align=&quot;middle&quot; width=&quot;301&quot; height=&quot;74&quot; /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;color: rgb(0, 0, 0);&quot;&gt;Neste momento estou a participar no RVCC para tentar finalizar este trabalho ainda este ano. Umas questões que ponho a todos porque que será que as Empresas Portuguesas, não usam o conceito Web 2 nos seus sites corporativos?, será por falta de conhecimento?, ou porque não acham que tenham vantagem competitiva? &lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;color: rgb(0, 0, 0);&quot;&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; Para Navegar ao&lt;/span&gt; &lt;a href=&quot;http://jorge.m.cunha.googlepages.com/newsletter3.html?utm_source=Newsletter&amp;amp;utm_medium=email&amp;amp;utm_content=Link+site&amp;amp;utm_campaign=Newsletter3&quot;&gt;Site&lt;br /&gt;Principal &lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td style=&quot;border-top: 10px solid rgb(255, 255, 255); background-color: rgb(255, 255, 204);&quot; valign=&quot;top&quot;&gt;&lt;br /&gt;&lt;p style=&quot;font-size: 10px; color: rgb(153, 102, 0); line-height: 100%; font-family: verdana;&quot;&gt;&lt;br /&gt;Copyright (C) 2007 Jorge Cunha  All rights reserved.&lt;br /&gt;Envie este E-mail aos seus Amigos&lt;/p&gt;  &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/1262212283974207645/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2008/09/uacct-ua-377819-1-urchintracker.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/1262212283974207645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/1262212283974207645'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2008/09/uacct-ua-377819-1-urchintracker.html' title='Newsletter'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-8907142444568795369</id><published>2008-09-15T21:14:00.004+01:00</published><updated>2008-09-21T16:49:00.962+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Truques e Dicas"/><title type='text'>Mudar o nome do SQL SERVER</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQIkPYG9yGD34vcew7hd3oZNl5wpwxg2v6c5iFuOR7aw2MGpLFoMia4Pu3ganZfGFSa-HCjxN5iG6SRSHlKs5-yxXMUYIxPMRQDgYuW_yB3Q8CMow_ai_EtSHfsCrFYv3448hPJ57-NDE/s1600-h/SQL_Truques+e+Dicas.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQIkPYG9yGD34vcew7hd3oZNl5wpwxg2v6c5iFuOR7aw2MGpLFoMia4Pu3ganZfGFSa-HCjxN5iG6SRSHlKs5-yxXMUYIxPMRQDgYuW_yB3Q8CMow_ai_EtSHfsCrFYv3448hPJ57-NDE/s320/SQL_Truques+e+Dicas.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5246345465554890962&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; color: rgb(102, 102, 102);font-family:arial;font-size:13;&quot;  &gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:16;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;Quando necessitamos de mudar o nome do servidor ao nivel do sistema operativo, torna-se obrigatório mudar o nome do SQL Server&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;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;Ih2E3d&quot; style=&quot;color: rgb(80, 0, 80);&quot;&gt;&lt;div class=&quot;gmail_quote&quot;&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;ol&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;Backup das bases de dados&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: italic;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;select @@SERVERNAME &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal; font-weight: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt; devolve o nome do SQL Server&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: italic;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;sp_dropserver &#39;jmc-pc&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal; font-weight: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;   nome do servidor anterior&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: italic;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;go&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: italic;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;sp_addserver &#39;ws-jmc&#39;, local  &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0);&quot;&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:medium;&quot;&gt;nome novo do servidor&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: italic;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;go&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;repetir o passo 2 after depois de reiniciar os serviços d&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;o SQL Server para verificar que o nome é aquele que lhe demos no passo 5&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms143799.aspx&quot; target=&quot;_blank&quot; style=&quot;font-weight: bold; color: rgb(51, 102, 204);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;Mais Informação em http://msdn.microsoft.com/en-&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;wbr&gt;us/library/ms143799.aspx&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/8907142444568795369/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2008/09/mudar-o-nome-do-sql-server.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/8907142444568795369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/8907142444568795369'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2008/09/mudar-o-nome-do-sql-server.html' title='Mudar o nome do SQL SERVER'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQIkPYG9yGD34vcew7hd3oZNl5wpwxg2v6c5iFuOR7aw2MGpLFoMia4Pu3ganZfGFSa-HCjxN5iG6SRSHlKs5-yxXMUYIxPMRQDgYuW_yB3Q8CMow_ai_EtSHfsCrFYv3448hPJ57-NDE/s72-c/SQL_Truques+e+Dicas.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-2374746132983715660</id><published>2008-08-31T15:11:00.011+01:00</published><updated>2008-08-31T15:54:16.032+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="férias"/><title type='text'>Vindo de Férias</title><content type='html'>&lt;div  style=&quot;text-align: left;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOr7_04MhbSjCi1aY9l0YjJ9EmufcotMQGlWh1yvE4MlYF7oV8aHxUwodTz_urgVDfEP4x4mb33u7UP_iST292KKR0q3VhpWQpB4jFpQkgOa58nmpNdXxntHUxrUxWnL0Mxkp8bG2FfSE/s1600-h/Pnh%C3%A3o2.jpg&quot;&gt;Estas Férias estive uma semana em Trás os montes que gostei muito deixo algumas imagens&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOr7_04MhbSjCi1aY9l0YjJ9EmufcotMQGlWh1yvE4MlYF7oV8aHxUwodTz_urgVDfEP4x4mb33u7UP_iST292KKR0q3VhpWQpB4jFpQkgOa58nmpNdXxntHUxrUxWnL0Mxkp8bG2FfSE/s1600-h/Pnh%C3%A3o2.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOr7_04MhbSjCi1aY9l0YjJ9EmufcotMQGlWh1yvE4MlYF7oV8aHxUwodTz_urgVDfEP4x4mb33u7UP_iST292KKR0q3VhpWQpB4jFpQkgOa58nmpNdXxntHUxrUxWnL0Mxkp8bG2FfSE/s320/Pnh%C3%A3o2.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5240692845597375410&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Vista do Pinhão&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih59HF-9evAjtDLjVMxYhO4v2UQxGUkt-uY5CHqc_-yV7rYTbikihIRCESq2ipsAQ9QuTZYu0R92v_6HRhsEvaQ3g2LMKnyU_CnUCV5GGktm7lnyuABn-rIzeD6o8KCWrYTG7VrGpVDWo/s1600-h/Rio+de+Onor.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih59HF-9evAjtDLjVMxYhO4v2UQxGUkt-uY5CHqc_-yV7rYTbikihIRCESq2ipsAQ9QuTZYu0R92v_6HRhsEvaQ3g2LMKnyU_CnUCV5GGktm7lnyuABn-rIzeD6o8KCWrYTG7VrGpVDWo/s320/Rio+de+Onor.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5240689701268531298&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Rio de Onor&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd32GkAyhEXWngMoyZIKZ7A0vsDa1RsyaocQjvByVo6oP-jKEvX2ZEo7dLV-X9Yx1_0hOhT-O-sk-ujYTTPOyukqYTyGU-0y1vjk3SONpokBuMD0gGLIiorOYhUN1HNImSAoVW9dufaX4/s1600-h/Museu+do+Mascara+Iberica.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd32GkAyhEXWngMoyZIKZ7A0vsDa1RsyaocQjvByVo6oP-jKEvX2ZEo7dLV-X9Yx1_0hOhT-O-sk-ujYTTPOyukqYTyGU-0y1vjk3SONpokBuMD0gGLIiorOYhUN1HNImSAoVW9dufaX4/s320/Museu+do+Mascara+Iberica.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5240689321624709874&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Museu da Mascara Ibérico&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl8B1alGxKs8jsrMeyKFa4E28_uBZ3VIjHdWEDhKUYZQTLlBBvdjX-aWsIZckCRMMP57BrOiGH4aY8VSMc5VRdHawvw_Szw5iYNgZv_rEpwvYvavuJowEgI573f3cJmPOnorOR1DYBlGI/s1600-h/Bragan%C3%A7a+vista+do+Castelo.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl8B1alGxKs8jsrMeyKFa4E28_uBZ3VIjHdWEDhKUYZQTLlBBvdjX-aWsIZckCRMMP57BrOiGH4aY8VSMc5VRdHawvw_Szw5iYNgZv_rEpwvYvavuJowEgI573f3cJmPOnorOR1DYBlGI/s320/Bragan%C3%A7a+vista+do+Castelo.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5240688470262982498&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Bragança Vista do Castelo&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix7cuxK01ETqO0r_a8669Snd9apMyDrRjitzLpg1LfjJrOl5YAipuM4vm_H7OPf4JpewRtaqOp6HPSyJNK_hEakQHYrA-0EaEXgTDkofl2ql5olpoCHqdxJMLN1nR2QxRwkuJBkp8sZdg/s1600-h/Miranda+do+Douro.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix7cuxK01ETqO0r_a8669Snd9apMyDrRjitzLpg1LfjJrOl5YAipuM4vm_H7OPf4JpewRtaqOp6HPSyJNK_hEakQHYrA-0EaEXgTDkofl2ql5olpoCHqdxJMLN1nR2QxRwkuJBkp8sZdg/s320/Miranda+do+Douro.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5240688049734711794&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Miranda Do Douro&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPIQ91lVxpuqtaKFEpbCdKUklsthtHy9pVgNm6YQnqMdUXIBCqz-soaHEeqDz8e3ZTJMsq61nBw5SFmSrUX-TxjRvi7XDMIFPGVGeDAP-ljvO-Q0tbhV6xKVzCaLZdFs5FAvlqD6vnaMg/s1600-h/trancoso.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPIQ91lVxpuqtaKFEpbCdKUklsthtHy9pVgNm6YQnqMdUXIBCqz-soaHEeqDz8e3ZTJMsq61nBw5SFmSrUX-TxjRvi7XDMIFPGVGeDAP-ljvO-Q0tbhV6xKVzCaLZdFs5FAvlqD6vnaMg/s320/trancoso.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5240687651388217586&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Trancoso&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/2374746132983715660/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2008/08/vindo-de-frias-bragana.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/2374746132983715660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/2374746132983715660'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2008/08/vindo-de-frias-bragana.html' title='Vindo de Férias'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOr7_04MhbSjCi1aY9l0YjJ9EmufcotMQGlWh1yvE4MlYF7oV8aHxUwodTz_urgVDfEP4x4mb33u7UP_iST292KKR0q3VhpWQpB4jFpQkgOa58nmpNdXxntHUxrUxWnL0Mxkp8bG2FfSE/s72-c/Pnh%C3%A3o2.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-4670531576921432536</id><published>2008-07-30T22:30:00.007+01:00</published><updated>2008-09-21T16:50:20.389+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Identity"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Truques e Dicas"/><title type='text'>Resolvendo problemas com Identity no SQL</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyqtNR5zkkZ-c25Cw2GKjMJaTXhRSp0HPuuVnRZIzfqSN7i4Wm2aj5suOjNLc1ipQloyRjiGUgdE_3wefpcx3evIJpc7AaxSBqg-7aKtZ7WpBrFDKMJm7QUnY7rA3x2uxyO8-Nn1XgKOo/s1600-h/SQL_Truques+e+Dicas.jpg&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyqtNR5zkkZ-c25Cw2GKjMJaTXhRSp0HPuuVnRZIzfqSN7i4Wm2aj5suOjNLc1ipQloyRjiGUgdE_3wefpcx3evIJpc7AaxSBqg-7aKtZ7WpBrFDKMJm7QUnY7rA3x2uxyO8-Nn1XgKOo/s320/SQL_Truques+e+Dicas.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5228922983903059810&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Estava a procura de uma solução para os problemas com as colunas de identity no SQL e encontrei uma solução&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Para ver qual o número que esta a nossa coluna de identity:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255); font-style: italic;&quot;&gt;DBCC CHECKIDENT&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255); font-style: italic;&quot;&gt;(&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255); font-style: italic;&quot;&gt; articles&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255); font-style: italic;&quot;&gt;)&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);font-size:100%;&quot; &gt;A resposta é que o valor é 6 como se pode visualizar aqui em baixo&lt;/span&gt;&lt;br /&gt;Checking identity information: current identity value &#39;6&#39;, current column value &#39;6&#39;.&lt;br /&gt;DBCC execution completed. If DBCC printed error messages, contact your system administrator.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Para colocar um novo número na nossa coluna da tabela article:&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(51, 102, 255);font-size:85%;&quot; &gt;&lt;br /&gt;DBCC CHECKIDENT&lt;br /&gt;&lt;br /&gt;(&lt;br /&gt;&lt;br /&gt;articles,reseed ,6000&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);font-size:100%;&quot; &gt;retorna:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(51, 102, 255);font-size:85%;&quot; &gt;Checking identity information: current identity value &#39;1000&#39;, current column value &#39;6000&#39;.&lt;br /&gt;DBCC execution completed. If DBCC printed error messages, contact your system administrator.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);font-size:100%;&quot; &gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Nota:&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Não se deve usar o comando &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;truncate&lt;/span&gt; pois este faz um reset a coluna Identity, por esta razão deve-se usar o comando &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;delete&lt;/span&gt;.&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/4670531576921432536/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2008/07/resolvendo-problemas-com-identity-no.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/4670531576921432536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/4670531576921432536'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2008/07/resolvendo-problemas-com-identity-no.html' title='Resolvendo problemas com Identity no SQL'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyqtNR5zkkZ-c25Cw2GKjMJaTXhRSp0HPuuVnRZIzfqSN7i4Wm2aj5suOjNLc1ipQloyRjiGUgdE_3wefpcx3evIJpc7AaxSBqg-7aKtZ7WpBrFDKMJm7QUnY7rA3x2uxyO8-Nn1XgKOo/s72-c/SQL_Truques+e+Dicas.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-6258488066685485265</id><published>2008-07-14T20:53:00.004+01:00</published><updated>2008-09-21T16:50:52.539+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Excel"/><category scheme="http://www.blogger.com/atom/ns#" term="It Tech Blogers"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Truques e Dicas"/><title type='text'>Select Excel</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi642oSCdEzJKKL7HKxZ8WbHNOibtTN_Z9z7ZigDGEPVEfb8wa0qlZ55EXMWK74o-6tJJgYbL9K-d-6wYWKK1YTTZ6EDf_cSqArA496CIof0A-Qz_F-0O8LYxKO9NSq6MEVcOZMBko7ILQ/s1600-h/Stop.jpeg&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi642oSCdEzJKKL7HKxZ8WbHNOibtTN_Z9z7ZigDGEPVEfb8wa0qlZ55EXMWK74o-6tJJgYbL9K-d-6wYWKK1YTTZ6EDf_cSqArA496CIof0A-Qz_F-0O8LYxKO9NSq6MEVcOZMBko7ILQ/s320/Stop.jpeg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5222953933642890786&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;Vou mostrar como eu uso um select para  lêr um ficheiro do Excel&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Exemplo:&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(51, 51, 255);&quot;&gt;Select * &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(51, 51, 255);&quot;&gt;FROM OPENDATASOURCE(&#39;Microsoft.Jet.OLEDB.4.0&#39;,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(51, 51, 255);&quot;&gt;   &#39;Data Source=D:\importa\Ficheiro_Excel.xls;Extended Properties=Excel 8.0&#39;)...Folha1$ &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Para usarmos com a eficácia que sempre pretendemos. Os cabeçalhos devem ser únicos&lt;br /&gt;e aonde está o &lt;span style=&quot;font-style: italic; color: rgb(51, 51, 255);&quot;&gt;Data Source&lt;/span&gt; deve-se indicar a localização do ficheiro e a folha  do ficheiro de Excel que queremos efectuar o select(nota: o &lt;span style=&quot;font-style: italic; color: rgb(51, 51, 255);&quot;&gt;$ &lt;/span&gt;faz parte do comando). Os nomes quer do ficheiro quer da folha deve-ser simples, ou seja, sem espaços e caracteres especiais, as colunas do ficheiro de Excel deve estar bem formatadas.&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Seja Solidário  vá a  &lt;a href=&quot;http://www.ami.pt/&quot;&gt;http://www.ami.pt&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/6258488066685485265/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2008/07/select-excel.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/6258488066685485265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/6258488066685485265'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2008/07/select-excel.html' title='Select Excel'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi642oSCdEzJKKL7HKxZ8WbHNOibtTN_Z9z7ZigDGEPVEfb8wa0qlZ55EXMWK74o-6tJJgYbL9K-d-6wYWKK1YTTZ6EDf_cSqArA496CIof0A-Qz_F-0O8LYxKO9NSq6MEVcOZMBko7ILQ/s72-c/Stop.jpeg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-6791661853389979697</id><published>2008-06-19T19:30:00.007+01:00</published><updated>2008-09-21T16:51:23.035+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Truques e Dicas"/><category scheme="http://www.blogger.com/atom/ns#" term="TI"/><title type='text'>SQL - Como Resolver Problemas com Nulos</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://ittechblogers.blogspot.com/&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDI_S1SM_5F7Askwm2OiNs66ulY9qw7qsUiSTigNBVVXFQuTJtEfoPxH_3aXJkigzn07t11nRceAsEWgtFraze5YN5cVnZHy3xw7sJl79497vj-eV2BqfCMwibjGWxpLGAf8qYA8zqLsA/s320/SQL_Truques+e+Dicas.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5213646331823729122&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Caros Leitores hoje traga-vos um exemplo para evitar&lt;br /&gt;os problemas de campos que são nulos no SQL e como uma simples instrução, podemos resolver o problema&lt;br /&gt;a sintaxe é a seguinte:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span style=&quot;font-weight: bold; font-style: italic;font-family:trebuchet ms;&quot; &gt;Isnull(campo ou expressão,número)&lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;, ou seja, &lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold; font-style: italic;&quot;&gt;Isnull(fila_teste,0) &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Explicação  se campo for nulo o valor é zero, se a operação for divisão ou multiplicação pode-se usar em vez do zero um 1, ou um &lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold; font-style: italic;&quot;&gt;case &lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;mas em relação a este irei abordar brevemente,&lt;br /&gt;espero que seja útil este &quot;post&quot; e que Portugal&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; ganhe&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; no Euro 2008 frente a Alemanha.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://jorge.m.cunha.googlepages.com/home_pt2&quot;&gt;Site: Pessoal &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/6791661853389979697/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2008/06/sql-como-resolver-problemas-com-nulos.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/6791661853389979697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/6791661853389979697'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2008/06/sql-como-resolver-problemas-com-nulos.html' title='SQL - Como Resolver Problemas com Nulos'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDI_S1SM_5F7Askwm2OiNs66ulY9qw7qsUiSTigNBVVXFQuTJtEfoPxH_3aXJkigzn07t11nRceAsEWgtFraze5YN5cVnZHy3xw7sJl79497vj-eV2BqfCMwibjGWxpLGAf8qYA8zqLsA/s72-c/SQL_Truques+e+Dicas.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-6739888006496824513</id><published>2008-06-05T23:42:00.004+01:00</published><updated>2008-06-05T23:59:59.523+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Crystal"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Crystal While Printing Records e Sql Expression fields</title><content type='html'>Vou colocar uma Dica sobre o Crystal Reports que dá muito jeito. Uma delas tem a com o sql expressions em que podemos usar outra tabela e colocar o campo no report em que podemos efectuar colocando da seguinte forma:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;(select top 1 registo from tabela where registo=1)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Podemos usar esta expressão sempre entre parênteses.&lt;br /&gt;&lt;br /&gt;Em relação ao While Printing Records é muito util quando estamos a calcular totais ou se queremos avaliar se a impressão de registos de detalhe já terminou   para  possamos suprimir o page footer a sintaxe para exemplo:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;WhilePrintingRecords;&lt;/span&gt; &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;Booleanvar myvar true&lt;/span&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxcDuylnmJWfk2CPd3Z_Ie0pUxVcEus7UMDPSBNVgrMwGO2UcCnU_MMaLrmgwLPAyJtrvLSGBrFMWNaf9ncX538SE8RZCvQg9AgdZKoJ7mF5KX-a-h9bJcDts4vpwUEsdLMcnt5tHrsEY/s1600-h/JC_logo_original_v1_pt.jpg&quot;&gt;&lt;img style=&quot;margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxcDuylnmJWfk2CPd3Z_Ie0pUxVcEus7UMDPSBNVgrMwGO2UcCnU_MMaLrmgwLPAyJtrvLSGBrFMWNaf9ncX538SE8RZCvQg9AgdZKoJ7mF5KX-a-h9bJcDts4vpwUEsdLMcnt5tHrsEY/s320/JC_logo_original_v1_pt.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5208535656635294050&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/6739888006496824513/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2008/06/crystal-while-printing-records-e-sql.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/6739888006496824513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/6739888006496824513'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2008/06/crystal-while-printing-records-e-sql.html' title='Crystal While Printing Records e Sql Expression fields'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxcDuylnmJWfk2CPd3Z_Ie0pUxVcEus7UMDPSBNVgrMwGO2UcCnU_MMaLrmgwLPAyJtrvLSGBrFMWNaf9ncX538SE8RZCvQg9AgdZKoJ7mF5KX-a-h9bJcDts4vpwUEsdLMcnt5tHrsEY/s72-c/JC_logo_original_v1_pt.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-8220640458737360788</id><published>2008-05-21T23:18:00.005+01:00</published><updated>2008-05-22T00:19:10.970+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Vista"/><category scheme="http://www.blogger.com/atom/ns#" term="windows vista"/><title type='text'>Reflexão sobre o Windows Vista</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6qG7o7we5LNpNucWSjl9-B-VzLUB0ZyMcNamOldYGDSkxKCctpNDGvjMpAJn4itf3iBfXD_I0-NMRSzTBWu8-CAL0eecVXG4wccBVEFXQgIp8qakubpNsZQFaSeawrTlX0d_Dgc9WkB0/s1600-h/Caminho.JPG&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 261px; height: 195px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6qG7o7we5LNpNucWSjl9-B-VzLUB0ZyMcNamOldYGDSkxKCctpNDGvjMpAJn4itf3iBfXD_I0-NMRSzTBWu8-CAL0eecVXG4wccBVEFXQgIp8qakubpNsZQFaSeawrTlX0d_Dgc9WkB0/s320/Caminho.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5202962137396873666&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Depois de algum caminho percorrido, penso que tem vindo a estabilizar.&lt;br /&gt;&lt;br /&gt;Neste momento pela minha experiência com o Vista em Português e em Inglês penso que as Empresas podem começar já a pensar em actualizar os seus parques informáticos mas devem ter atenção ao seguinte:&lt;br /&gt;&lt;br /&gt;- Hardware&lt;br /&gt;O Hardware dever ter como processador pelo menos um Duo Core e pelo menos 2 GB de Ram na memória.Uma boa placa de vídeo. Verificar se o hardware está homologado para o Vista, ou seja Drivers para os mesmos. &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyId=67240B76-3148-4E49-943D-4D9EA7F77730&amp;amp;displaylang=en&quot;&gt;( existe uma Ferramenta neste link para avaliar na vossa rede). &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Existe também para computadores com o Windows XP no site da microsoft um programa para avaliar e aconselhar ( aqui vai o link da microsoft  &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?displaylang=pt-pt&amp;amp;FamilyID=42b5ac83-c24f-4863-a389-3ffc194924f8&quot;&gt;http://www.microsoft.com/downloads/details.aspx?displaylang=pt-pt&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?displaylang=pt-pt&amp;amp;FamilyID=42b5ac83-c24f-4863-a389-3ffc194924f8&quot;&gt;&amp;amp;FamilyID=42b5ac83-c24f-4863-a389-3ffc194924f8)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Software&lt;br /&gt;&lt;br /&gt;Efectuar um levantamento exaustivo em termos de aplicações para que estas corram no Vista.&lt;br /&gt;com estas indicações penso que poderá avançar para um teste piloto para assegurar que a transição é calma e segura.&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI14Nw_yMu3SNJHqqkEO8uddRGCuH1r3xXuuzumnrttzzkLGNiHlCakbR4Wx8I6xEbo2uxmpjXaRPxFiYMDZhhbMK5h5Onwb2PlxMTnn9oPSQeC4GeSCxT7Lb3WfbuxtMe8LeCZdsPBzs/s1600-h/cascata.JPG&quot;&gt;&lt;img style=&quot;margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 264px; height: 198px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI14Nw_yMu3SNJHqqkEO8uddRGCuH1r3xXuuzumnrttzzkLGNiHlCakbR4Wx8I6xEbo2uxmpjXaRPxFiYMDZhhbMK5h5Onwb2PlxMTnn9oPSQeC4GeSCxT7Lb3WfbuxtMe8LeCZdsPBzs/s320/cascata.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5202964916240714210&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;Se o seu parque de PC&#39;s  for das maiores marcas mundiais&lt;br /&gt;deve consultar o site do fabricante&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A versão do Vista que recomendo é o Vista Business e as versões mais estaveis como sempre são as Nativas, ou seja, em Inglês.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;WebSite JC&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://jorge.m.cunha.googlepages.com&quot;&gt;&lt;img style=&quot;cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMGwN8v5zSgf4BtxiHyZB66AX-uNUK-8CMHJKSav5M8YTWLn9veuUAOfFqWr0GCqY1Wkd_R4Zm_ecojIV8DHXPDtk1eBuNJP15ShRggTsQDgcCFqHHddv4cUQCWgdIC9FL9-ew32BWAcE/s320/IconFlyer_small.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5202973828297853426&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/8220640458737360788/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2008/05/reflexo-sobre-o-windows-vista.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/8220640458737360788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/8220640458737360788'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2008/05/reflexo-sobre-o-windows-vista.html' title='Reflexão sobre o Windows Vista'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6qG7o7we5LNpNucWSjl9-B-VzLUB0ZyMcNamOldYGDSkxKCctpNDGvjMpAJn4itf3iBfXD_I0-NMRSzTBWu8-CAL0eecVXG4wccBVEFXQgIp8qakubpNsZQFaSeawrTlX0d_Dgc9WkB0/s72-c/Caminho.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-2229158824167719761</id><published>2008-04-20T14:42:00.007+01:00</published><updated>2008-04-20T15:07:58.861+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Google Pesquisa Personalizada"/><title type='text'>Motor de Pesquisa</title><content type='html'>Caros em virtude de ter muito trabalho foi-me completamente impossível de elaborar conteúdo. Por isso deixo-vos com o meu motor de pesquisa, proporcionado pelo Google com o nome de pesquisa personalizada Beta em Português.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.google.com/custom?hl=pt-PT&amp;amp;client=pub-3975014148230661&amp;amp;channel=0983544504&amp;amp;cof=FORID%3A1%3BAH%3Aleft%3BCX%3ABest%2520Resources%2520for%2520IT%3BL%3Ahttp%3A%2F%2Fwww.google.com%2Fcoop%2Fintl%2Fpt-US%2Fimages%2Fcustom_search_sm.gif%3BLH%3A65%3BLP%3A1%3BLC%3A%23333366%3BVLC%3A%23FFCC00%3BDIV%3A%23FFFF00%3B&amp;amp;adkw=AELymgXdD8XIFkrRQDjVobofDPdBJXz9C1Cz-8yJ-9dl6SDU0dZmzt_6KSIcCYlT_-fdBrkScYDJLp-J_MCPcfu2uYzyXfpvGA5zarPDNdq_MONzHR115TG2nRu6kHvH-s0DycvuIEbKhEgrjtGlp-KJSEblEVm02mV5rVHj5t80w6ib-TzNGSo&amp;amp;q=&amp;amp;btnG=Pesquisar&amp;amp;cx=004549758172018987066%3Anbduvfzyy1s&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwKrIFiiCKQpsLuQAoOo5cKyH4BB-X4fzTZ69K4HtugOQLy6f0Wgpb7M_6fBs_YpRAS7YHBCXDHRPCeKOLzXgWIlweea6kvpUpowgclkYI2Euzd8SqzFWl5_kquDGihR4B0k-TQCfkskk/s320/google_pesquisa.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5191324231446376178&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Este motor de pesquisa que utilizo no meu dia a dia, desta forma foi seleccionado fontes de informação colocando todos os sites que utilizo para trabalhar. Desta forma partilho está informação com todos.&lt;br /&gt;Se clicarem a imagem poderam usar também e ver se funciona para vocês.&lt;br /&gt;Se puderem dêem o feedback que julgam adequado para melhorar.&lt;br /&gt;&lt;br /&gt;Deixo-vos mais uma imagem a baixo para verem&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.google.com/custom?hl=pt-PT&amp;amp;client=pub-3975014148230661&amp;amp;channel=0983544504&amp;amp;cof=FORID%3A1%3BAH%3Aleft%3BCX%3ABest%2520Resources%2520for%2520IT%3BL%3Ahttp%3A%2F%2Fwww.google.com%2Fcoop%2Fintl%2Fpt-US%2Fimages%2Fcustom_search_sm.gif%3BLH%3A65%3BLP%3A1%3BLC%3A%23333366%3BVLC%3A%23FFCC00%3BDIV%3A%23FFFF00%3B&amp;amp;adkw=AELymgXdD8XIFkrRQDjVobofDPdBJXz9C1Cz-8yJ-9dl6SDU0dZmzt_6KSIcCYlT_-fdBrkScYDJLp-J_MCPcfu2uYzyXfpvGA5zarPDNdq_MONzHR115TG2nRu6kHvH-s0DycvuIEbKhEgrjtGlp-KJSEblEVm02mV5rVHj5t80w6ib-TzNGSo&amp;amp;q=&amp;amp;btnG=Pesquisar&amp;amp;cx=004549758172018987066%3Anbduvfzyy1s&quot;&gt;&lt;img style=&quot;cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOz2SjVdvuVQdNGlz2E7gGraDwMsA24kB5h73a3pTdjEXtX131FQD0LsHKj315f0JBY5bPqMg7agB0KNh2Gr5qTdIBk91VrtLRzhqQDJrNfnTwShbt1TVdJxn97MDOiwxIrMlJjtjcmVU/s320/google_pesquisa2.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5191328255830732546&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/2229158824167719761/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2008/04/motor-de-pesquisa.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/2229158824167719761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/2229158824167719761'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2008/04/motor-de-pesquisa.html' title='Motor de Pesquisa'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwKrIFiiCKQpsLuQAoOo5cKyH4BB-X4fzTZ69K4HtugOQLy6f0Wgpb7M_6fBs_YpRAS7YHBCXDHRPCeKOLzXgWIlweea6kvpUpowgclkYI2Euzd8SqzFWl5_kquDGihR4B0k-TQCfkskk/s72-c/google_pesquisa.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-2920581393704737173</id><published>2008-03-29T23:00:00.004+00:00</published><updated>2008-03-29T23:11:32.194+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OPEN ID"/><title type='text'>OPEN ID</title><content type='html'>Hoje vamos falar sobre o OPEN ID esta tecnologia permite efectuar o acesso em múltiplos sites com toda a segurança. Esta tecnologia em que tive o conhecimento a partir do Microsoft Passport, mas não vingou pelo menos generalizou a outros sites não Microsoft.&lt;br /&gt;Voltando a tecnologia com a Web 2.0 e as redes sociais em que o utilizador tem de inserir o utilizador e password múltiplas vezes. Esta tecnologia lançada através da Fundação Open ID&lt;br /&gt;que não é proprietária tem já múltiplos  sites a fornecer  está solução tais como a Verisign entre outras, o que torna ainda mais credível esta iniciativa, também existem já muitos sites a aderirem a está solução de autenticação. Apesar deste post não ser de uma actualidade gritante penso que depois de lerem atentamente através deste link &lt;a href=&quot;http://www.openid.net&quot;&gt;http://www.openid.net.&lt;/a&gt; No mundo das empresas estas já tem muitas soluções de &quot;Single Sign On&quot;.</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/2920581393704737173/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2008/03/open-id.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/2920581393704737173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/2920581393704737173'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2008/03/open-id.html' title='OPEN ID'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5471390318983737874.post-5605585552119622700</id><published>2008-03-15T16:14:00.005+00:00</published><updated>2008-03-15T16:33:58.970+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISTA Ecrã Preto"/><title type='text'>VISTA e o Ecrã Preto</title><content type='html'>Mais uma vez tive de efectuar um restauro do sistema porque a actualização que efectuei  estava sempre a dizer que estava a concluir, mesmo depois de ter reiniciado. Mais uma vez tive de efectuar um ponto de restauro, uma ferramenta muito útil.&lt;br /&gt;- Descrição de passos Entrar em modo de segurança e depois seleccionar o ponto de restauro anterior a actualização.&lt;br /&gt; &lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0j_QfO2GF1ewsV4we650qKhuu3CcTL8VyHKEC453NBuJ133h6O7O8jLO-SCxr_ckORoq9epDru9t2Uwh6I4a9Y-pBAsU6_uEX-LJqvKpNrTjRNWa5jzlGZoJAtIDV9PPZMRWH42plAaU/s1600-h/Actualiza%C3%A7%C3%A3o+KB946041.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0j_QfO2GF1ewsV4we650qKhuu3CcTL8VyHKEC453NBuJ133h6O7O8jLO-SCxr_ckORoq9epDru9t2Uwh6I4a9Y-pBAsU6_uEX-LJqvKpNrTjRNWa5jzlGZoJAtIDV9PPZMRWH42plAaU/s320/Actualiza%C3%A7%C3%A3o+KB946041.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5178005079061729170&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;Espero que apesar do continuado esforço  da Microsoft, esta não  fique  enfadado com este post, pois nós  sabemos que por vezes estas situações ocorrem . Temos de esperar pelo SP1 para que  fiquem ultrapassados  estes  pequenos  problemas.&lt;img src=&quot;file:///c:/temp/moz-screenshot.jpg&quot; alt=&quot;&quot; /&gt;&lt;img src=&quot;file:///c:/temp/moz-screenshot-1.jpg&quot; alt=&quot;&quot; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://ittechblogers.blogspot.com/feeds/5605585552119622700/comments/default' title='Enviar feedback'/><link rel='replies' type='text/html' href='http://ittechblogers.blogspot.com/2008/03/vista-e-o-ecr-preto.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/5605585552119622700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5471390318983737874/posts/default/5605585552119622700'/><link rel='alternate' type='text/html' href='http://ittechblogers.blogspot.com/2008/03/vista-e-o-ecr-preto.html' title='VISTA e o Ecrã Preto'/><author><name>Jorge Cunha</name><uri>http://www.blogger.com/profile/00293908621152410559</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0j_QfO2GF1ewsV4we650qKhuu3CcTL8VyHKEC453NBuJ133h6O7O8jLO-SCxr_ckORoq9epDru9t2Uwh6I4a9Y-pBAsU6_uEX-LJqvKpNrTjRNWa5jzlGZoJAtIDV9PPZMRWH42plAaU/s72-c/Actualiza%C3%A7%C3%A3o+KB946041.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>