<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlserver.ro/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Intrebari</title><link>http://sqlserver.ro/forums/14/ShowForum.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Re: Triggere SQL Server (RONUA)</title><link>http://sqlserver.ro/forums/thread/1419.aspx</link><pubDate>Thu, 21 Dec 2006 20:52:45 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1419</guid><dc:creator>rsocol</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1419.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=14&amp;PostID=1419</wfw:commentRss><description>&lt;p&gt;Pentru problema cu trunchierea textului în Management Studio (sau în Query Analyzer), se poate configura de la Options / Query Results / SQL Server / Results to text / Maximum number of characters displayed in each column (nu mai ţin minte exact unde e opţiunea din Query Analyzer, dar e ceva similar), mărind valoarea respectivă de la 256 la 8192. Totuşi, dacă trigger-ul are o dimensiune mai mare decât atât, ar trebui folosită altă metodă.&lt;/p&gt;&lt;p&gt;Răzvan&lt;br&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Re: Triggere SQL Server (RONUA)</title><link>http://sqlserver.ro/forums/thread/1418.aspx</link><pubDate>Thu, 21 Dec 2006 19:06:43 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1418</guid><dc:creator>Diana</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1418.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=14&amp;PostID=1418</wfw:commentRss><description>&lt;p&gt;Tot pe SQL 2005 merge si:&lt;/p&gt;&lt;p&gt;USE AdventureWorks&amp;nbsp;&lt;/p&gt;&lt;p&gt;SELECT m.[object_id], m.definition &lt;br&gt;
FROM sys.sql_modules m JOIN sys.triggers t&lt;br&gt;
ON m.[object_id] = t.[object_id]&lt;br&gt;
WHERE m.[object_id] = OBJECT_ID(N'Production.uUnitMeasure')&lt;/p&gt;&lt;p&gt;Din
pacate QA "arata" rezultatul trunchiat, chiar daca il exporti intr-un
fisier...deci sp_helptext e mai comod daca vrei sa citesti textul in
QA, fara alte "ocoluri"...&amp;nbsp;&lt;/p&gt;&lt;p&gt;** Production.uUnitMeasure e numele unui trigger din schema Production &lt;/p&gt;&lt;p&gt;**
Pentru a vedea definitia triggerului, iti trebuie permisiunea "VIEW
DEFINITION" pe schema "Production" (de exemplu) sau sa ai o permisiune (CONTROL, ALTER, TAKE OWNERSHIP)
pe obiect, sau sa fii "owner"-ul obiectului...&lt;br&gt;
&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Triggere SQL Server (RONUA)</title><link>http://sqlserver.ro/forums/thread/1403.aspx</link><pubDate>Wed, 20 Dec 2006 13:35:30 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1403</guid><dc:creator>rsocol</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1403.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=14&amp;PostID=1403</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="http://sqlserver.ro/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;ggciubuc:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;Un altul ar fi :&lt;/p&gt;&lt;p&gt;select text from syscomments where id in (select id from sysobjects where name='uDepartment')&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;Pentru metoda asta e o mică problemă atunci când trigger-ul are mai mult de 4K, pentru că textul va fi returnat în mai multe înregistrări, iar sfârşitul unei înregistrări poate fi chiar în mijlocul unui cuvânt.&lt;/p&gt;&lt;p&gt;Iar a treia soluţie ar fi:&lt;/p&gt;&lt;p&gt;exec sp_helptext 'numetrigger'&lt;/p&gt;&lt;p&gt;Aceasta metodă returnează fiecare linie într-o înregistrare separată. Totuși nici aici nu e chiar perfect, pentru că liniile returnate sunt de maxim 255 de caractere, deci și aici e neplăcut dacă există linii mai lungi de atât, pentru că vor fi returnate în înregistrări separate.&lt;/p&gt;&lt;p&gt;Cel mai bine e să se folosească soluția scrisă de Cristi (cu OBJECT_DEFINITION), dar aceasta nu este disponibilă pe SQL 2000 (e o funcție nouă introdusă în SQL 2005).&lt;br&gt;&lt;/p&gt;&lt;p&gt;Răzvan&lt;br&gt;&lt;/p&gt;</description></item><item><title>Re: Triggere SQL Server (RONUA)</title><link>http://sqlserver.ro/forums/thread/1399.aspx</link><pubDate>Wed, 20 Dec 2006 12:20:58 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1399</guid><dc:creator>ggciubuc</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1399.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=14&amp;PostID=1399</wfw:commentRss><description>&lt;p&gt;Un altul ar fi :&lt;/p&gt;&lt;p&gt;select text from syscomments&lt;/p&gt;&lt;p&gt;where id in (select id from sysobjects where name='uDepartment')&amp;nbsp;&lt;/p&gt;&lt;p&gt;daca va intereseaza triggerul uDepartment din tabela HumanResources.Department din baza de date&lt;/p&gt;&lt;p&gt;AdventureWorks&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Triggere SQL Server (RONUA)</title><link>http://sqlserver.ro/forums/thread/1398.aspx</link><pubDate>Wed, 20 Dec 2006 12:09:09 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1398</guid><dc:creator>xmldeveloper</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1398.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=14&amp;PostID=1398</wfw:commentRss><description>&lt;P&gt;Un posibil raspuns este folosind &lt;EM&gt;OBJECT_DEFINITION&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;USE AdventureWorks;&lt;BR&gt;GO&lt;BR&gt;SELECT &lt;BR&gt;OBJECT_DEFINITION (OBJECT_ID(N'HumanResources.dEmployee')) AS [Trigger Definition]; &lt;BR&gt;GO&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;For all triggers of a table:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;USE AdventureWorks;&lt;BR&gt;GO&lt;BR&gt;SELECT &lt;BR&gt;[name] as TiggerName,&lt;BR&gt;OBJECT_DEFINITION([object_id]) AS [Trigger Definition]&lt;BR&gt;FROM sys.triggers&lt;BR&gt;WHERE parent_id=OBJECT_ID(N'Purchasing.PurchaseOrderDetail');&lt;/STRONG&gt;&lt;/P&gt;</description></item><item><title>Triggere SQL Server (RONUA)</title><link>http://sqlserver.ro/forums/thread/1397.aspx</link><pubDate>Wed, 20 Dec 2006 12:02:12 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1397</guid><dc:creator>xmldeveloper</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1397.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=14&amp;PostID=1397</wfw:commentRss><description>&lt;DIV&gt;&lt;STRONG&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;matincaf wrote the following post at 12-18-2006 7:22 :&lt;/STRONG&gt; &lt;/DIV&gt;
&lt;DIV class=ForumReplyToPostArea&gt;&lt;FONT face=Verdana size=2&gt;Salut,&lt;BR&gt;&lt;BR&gt;Cum se poate obţine printr-un script sql codul unui trigger de pe un tabel ?&lt;BR&gt;&lt;BR&gt;Mulţumesc.&lt;/FONT&gt; &lt;/DIV&gt;
&lt;DIV class=ForumReplyToPostArea&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/DIV&gt;</description></item></channel></rss>