<?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 generale</title><link>http://sqlserver.ro/forums/16/ShowForum.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Re: Ajutor la concepere procedura stocata...</title><link>http://sqlserver.ro/forums/thread/6609.aspx</link><pubDate>Sun, 25 Jan 2009 22:45:19 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:6609</guid><dc:creator>ignatandrei</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/6609.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=6609</wfw:commentRss><description>pai , la modul simplist:&lt;br&gt;1. &lt;br&gt;fara cursoare &lt;br&gt;insert into&amp;nbsp; tAbela(cimp1, cimp2, etc)&amp;nbsp; select (cimp1, cimp2, etc) from clienti where &amp;lt;conditiii&amp;gt;&lt;br&gt;Apoi vezi daca where il poti optimiza cu indecsi&lt;br&gt;La fel, insert into operatii(valori) select id from clienti where apa =true )&lt;br&gt;&lt;br&gt;2. Pentru siguranta&amp;nbsp; - begin transaction / commit /rollback&lt;br&gt;</description></item><item><title>Ajutor la concepere procedura stocata...</title><link>http://sqlserver.ro/forums/thread/6608.aspx</link><pubDate>Sun, 25 Jan 2009 22:05:50 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:6608</guid><dc:creator>ThePuiu</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/6608.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=6608</wfw:commentRss><description>&lt;P&gt;Salut! Trebuie sa fac (in citeva cuvinte) urmatoarea chestie: am o tabela cu &lt;STRONG&gt;clienti &lt;/STRONG&gt;(ID,NUME,adresa,APA,GAZ,CANAL), o tabela cu antete &lt;STRONG&gt;facturi &lt;/STRONG&gt;(ID,NRDOC, DATA,ID_CLIENT) si o tabela cu &lt;STRONG&gt;operatii &lt;/STRONG&gt;(ID,ID_FACTURA,PRET) si trebuie&amp;nbsp;sa fac o procedura stocata care sa baleeze toti clientii care au o anumita adresa si pt fiecare din ei sa insereze o linie in tabela &lt;STRONG&gt;facturi &lt;/STRONG&gt;(daca&amp;nbsp;oricare din campurile APA,GAZ,CANAL este true), apoi daca&amp;nbsp;oricare din campurile APA,GAZ,CANAL este true, sa insereze pt acel camp o linie in tabelul &lt;STRONG&gt;operatii&lt;/STRONG&gt;. Cu alte cuvinte, o facturare in bloc a unui grup de clienti. Chestiile de inserare, de scope_identity(), etc imi sunt cunoscute, dar nu stiu cum sa concep baleerea tabelei &lt;STRONG&gt;clienti&lt;/STRONG&gt; intr-un mod optim.... Am citit ca nu este recomandata utilizarea cursoarelor daca este vorba de un numar mare de coloane si de inregistrari. Ce imi recomandati sa fac avand in vedere ca numarul de clienti este aprox 3000, iar 'facturarea' nu se face de pe computerul unde este instalat serverul SQL ci de pe un comp conectat prin internet la server. Problema nu se pune atit de viteza cit de siguranta efectuarii operatiei. Lansarea in executie a unei PS de pe o statie are ca efect executia pe server a operatiilor din SP, nu?&lt;/P&gt;
&lt;P&gt;Multumesc!&lt;/P&gt;</description></item></channel></rss>