<?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>T-SQL</title><link>http://sqlserver.ro/forums/15/ShowForum.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Re: view</title><link>http://sqlserver.ro/forums/thread/6446.aspx</link><pubDate>Mon, 15 Dec 2008 08:20:20 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:6446</guid><dc:creator>aflorin27</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/6446.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=6446</wfw:commentRss><description>Are logica :) Multumesc.</description></item><item><title>Re: view</title><link>http://sqlserver.ro/forums/thread/6394.aspx</link><pubDate>Thu, 11 Dec 2008 16:40:00 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:6394</guid><dc:creator>rsocol</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/6394.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=6394</wfw:commentRss><description>&amp;#206;n cazul de faţă, un trigger INSTEAD OF nu ar fi recomandat pentru că e mult mai simplu ca aplicaţia să şteargă din tabela corectă. &amp;#206;n cazul &amp;#238;n care aplicaţia nu se poate modifica, atunci se poate pune problema şi de un trigger INSTEAD OF. &lt;br /&gt;&lt;br /&gt;&amp;#206;n general, sunt două probleme cu trigger-ele INSTEAD OF:&lt;br /&gt;- trebuie &amp;#238;ntreţinute (de fiecare dată c&amp;#226;nd se adaugă o nouă coloană &amp;#238;n tabelă, trebuie modificate trigger-ele de INSTEAD OF INSERT şi INSTEAD OF UPDATE);&lt;br /&gt;- pot afecta puţin performanţa, deoarece implică &amp;#238;ncă o operaţiune, de copiere a datelor din pseudo-tabelele inserted/deleted &amp;#238;n tabelele reale.&lt;br /&gt;&lt;br /&gt;Răzvan</description></item><item><title>Re: view</title><link>http://sqlserver.ro/forums/thread/6393.aspx</link><pubDate>Thu, 11 Dec 2008 15:48:29 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:6393</guid><dc:creator>aflorin27</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/6393.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=6393</wfw:commentRss><description>&lt;DIV&gt;Pentru curiozitatea mea:&lt;/DIV&gt;
&lt;DIV&gt;de ce nu ar fi recomandat un INSTEAD OF trigger?&lt;/DIV&gt;</description></item><item><title>Re: view</title><link>http://sqlserver.ro/forums/thread/6113.aspx</link><pubDate>Mon, 10 Nov 2008 11:53:29 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:6113</guid><dc:creator>rremus</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/6113.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=6113</wfw:commentRss><description>Razvan tzi-a raspuns deja cum se face, dar pentru 'record': ca sa faci updatabil un view care implicit nu se poate updata se poate folosi in &lt;a href="http://msdn.microsoft.com/en-us/library/ms175521%28SQL.90%29.aspx"&gt;trigger INSTEAD OF&lt;/a&gt; care sa transforme operatiunile pe view in operatiuni pe tabelele care-l compun. Desi eu nu as recomanda asa ceva.&lt;br&gt;</description></item><item><title>Re: view</title><link>http://sqlserver.ro/forums/thread/6111.aspx</link><pubDate>Mon, 10 Nov 2008 10:58:00 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:6111</guid><dc:creator>marius_i</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/6111.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=6111</wfw:commentRss><description>Multumesc mult&amp;nbsp;! A mers ! Scuzati-mi lipsa de concentrare !</description></item><item><title>Re: view</title><link>http://sqlserver.ro/forums/thread/6109.aspx</link><pubDate>Mon, 10 Nov 2008 10:23:45 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:6109</guid><dc:creator>rsocol</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/6109.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=6109</wfw:commentRss><description>Înţeleg că atunci când vrei să ştergi din view un rând, de fapt vrei să se şteargă din tabelul Sharing (nu din tabelul Albume). În acest caz, încearcă:&lt;br&gt;&lt;br&gt;DELETE dbo.Sharing FROM SharedView WHERE dbo.Sharing.idAlbum=26&lt;br&gt;&lt;br&gt;sau, mai simplu:&lt;br&gt;&lt;br&gt;DELETE FROM dbo.Sharing WHERE idAlbum=26&lt;br&gt;&lt;br&gt;Răzvan&lt;br&gt;</description></item><item><title>view</title><link>http://sqlserver.ro/forums/thread/6108.aspx</link><pubDate>Mon, 10 Nov 2008 10:00:07 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:6108</guid><dc:creator>marius_i</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/6108.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=6108</wfw:commentRss><description>&lt;P&gt;Tabelul&lt;BR&gt;Albume ( idAlbum,NumeAlbum,Activ,idUtilizator,PozaAlbum(image),DescriereAlbum&lt;/P&gt;
&lt;P&gt;Sharing ( idSharing,idAlbum,idUtilizator,idTo,Activ)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;vreau ca un idUtilizator sa faca share cu un alt utilizator.Astfel, inregistrarile vor intra in&lt;BR&gt;tabelul Sharing &lt;/P&gt;
&lt;P&gt;am creat un view&lt;/P&gt;
&lt;P&gt;SELECT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOP (100) PERCENT dbo.Albume.NumeAlbum, dbo.Albume.Activ AS Expr1, dbo.Albume.idUtilizator AS Expr2, dbo.Albume.PozaAlbum, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbo.Albume.DescriereAlbum, dbo.Albume.idAlbum, dbo.Sharing.idTo, dbo.Sharing.Activ, dbo.Sharing.idUtilizator&lt;BR&gt;FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbo.Albume RIGHT OUTER JOIN&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbo.Sharing ON dbo.Albume.idAlbum = dbo.Sharing.idAlbum&lt;/P&gt;
&lt;P&gt;afisez albumele utilzatorului 1 din tabelul Albume&lt;/P&gt;
&lt;P&gt;afisez albumele utilizatorului 2 din tabelul Albume&lt;/P&gt;
&lt;P&gt;afisez albumele pe care utilizatorul 1 le face share cu utilizatorul 2, din acel view,ShareView&lt;/P&gt;
&lt;P&gt;acum cand vreau sa sterg o inregistrare din acest view :&lt;BR&gt;Sa zicem ca utilizatorul 2 care are un album share de la utilizatorul 1 vrea sa il stearga.Dar sa il stearga doar din lista lui nu si din lista utilizatorului 1.ADica sa fie sters doar din view si nu din tabel.&lt;/P&gt;
&lt;P&gt;delete from sharedView where idalbum = 26&lt;/P&gt;
&lt;P&gt;View or function 'SharedView' is not updatable because the modification affects multiple base tables.&lt;/P&gt;
&lt;P&gt;Ce anume sa modific la View?Pot face ce vreau eu cu View sau sa folosesc altceva?&lt;/P&gt;
&lt;P&gt;Sper ca am explicat bine unde vreau sa ajung.&lt;BR&gt;Multumesc !&lt;/P&gt;
&lt;P&gt;Nu stiu cat conteaza :sqlServer2005 si lucru in asp simplu&lt;/P&gt;</description></item></channel></rss>