<?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: sql server 2000 - WHILE</title><link>http://sqlserver.ro/forums/thread/5882.aspx</link><pubDate>Fri, 17 Oct 2008 11:00:16 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:5882</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/5882.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=5882</wfw:commentRss><description>&lt;P&gt;am rezolvat cu:&lt;/P&gt;
&lt;P&gt;if exists (select CustomerCode from STARE where CustomerCode = @CustomerCode and Stare = 0)&lt;BR&gt;begin&lt;/P&gt;
&lt;P&gt;select.....&lt;/P&gt;
&lt;P&gt;insert....&lt;/P&gt;
&lt;P&gt;update....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;update STARE&lt;BR&gt;&amp;nbsp;set Stare = 1&lt;BR&gt;&amp;nbsp;where CustomerCode = @CustomerCode&lt;/P&gt;
&lt;P&gt;end&lt;/P&gt;
&lt;P&gt;si tot asa if exists cu update stare la sfarsit pana unde se sfarseste while-ul&lt;/P&gt;
&lt;P&gt;multumesc&lt;/P&gt;
&lt;P&gt;alex.&lt;/P&gt;</description></item><item><title>Re: sql server 2000 - WHILE</title><link>http://sqlserver.ro/forums/thread/5881.aspx</link><pubDate>Fri, 17 Oct 2008 09:49:27 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:5881</guid><dc:creator>ignatandrei</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/5881.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=5881</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;Alex:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;salut,&lt;/p&gt;
&lt;p&gt;am o tabela STARE cu 2 coloane CustomerCode, Stare int&lt;/p&gt;
&lt;p&gt;iar in interiorul unei proceduri am un WHILE cu o gramada de insert-uri, select-uri, update-uri&lt;/p&gt;
&lt;p&gt;select @CustomerCode = min(CustomerCode) from TEST where Process = 0&lt;/p&gt;
&lt;p&gt;while @CustomerCode is not null&lt;br&gt;begin&lt;/p&gt;
&lt;p&gt;select...&lt;/p&gt;
&lt;p&gt;insert...&lt;/p&gt;
&lt;p&gt;update...&lt;/p&gt;
&lt;p&gt;end&lt;/p&gt;
&lt;p&gt;procedura se ruleaza pe zeci de mii de CustomerCode&lt;/p&gt;
&lt;p&gt;as vrea sa am un parametru la procedura astfel incat daca crapa la un moment dat si trebuie sa rulez procedura iar sa nu&amp;nbsp;se mai execute pt CustomerCode pt care a terminat si sa&amp;nbsp;se ruleze de unde a ramas&amp;nbsp;functie de valoarea int din coloana STARE din tabela STARE&lt;/p&gt;
&lt;p&gt;aveti cumva vreun exemplu sau vreun sfat&lt;/p&gt;
&lt;p&gt;multumesc.&lt;/p&gt;
&lt;p&gt;alex&lt;/p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;br&gt;salveaza in alta tabela ce inregistrari ai procesat . Apoi in functie de stare , poti sa le faci sau nu - verificind in tabela(probabil ar fi bun si un index)&lt;br&gt;</description></item><item><title>Re: sql server 2000 - WHILE</title><link>http://sqlserver.ro/forums/thread/5880.aspx</link><pubDate>Fri, 17 Oct 2008 09:21:23 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:5880</guid><dc:creator>MrSmersh</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/5880.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=5880</wfw:commentRss><description>&lt;P&gt;prima idee sa rulezi in tranzactie si sa afisezi unde ai dat de eroare.&lt;BR&gt;2 in handler exceptie sa faci asta dar sa incerci sa continuii...&lt;/P&gt;</description></item><item><title>sql server 2000 - WHILE</title><link>http://sqlserver.ro/forums/thread/5879.aspx</link><pubDate>Fri, 17 Oct 2008 09:13:45 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:5879</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/5879.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=5879</wfw:commentRss><description>&lt;P&gt;salut,&lt;/P&gt;
&lt;P&gt;am o tabela STARE cu 2 coloane CustomerCode, Stare int&lt;/P&gt;
&lt;P&gt;iar in interiorul unei proceduri am un WHILE cu o gramada de insert-uri, select-uri, update-uri&lt;/P&gt;
&lt;P&gt;select @CustomerCode = min(CustomerCode) from TEST where Process = 0&lt;/P&gt;
&lt;P&gt;while @CustomerCode is not null&lt;BR&gt;begin&lt;/P&gt;
&lt;P&gt;select...&lt;/P&gt;
&lt;P&gt;insert...&lt;/P&gt;
&lt;P&gt;update...&lt;/P&gt;
&lt;P&gt;end&lt;/P&gt;
&lt;P&gt;procedura se ruleaza pe zeci de mii de CustomerCode&lt;/P&gt;
&lt;P&gt;as vrea sa am un parametru la procedura astfel incat daca crapa la un moment dat si trebuie sa rulez procedura iar sa nu&amp;nbsp;se mai execute pt CustomerCode pt care a terminat si sa&amp;nbsp;se ruleze de unde a ramas&amp;nbsp;functie de valoarea int din coloana STARE din tabela STARE&lt;/P&gt;
&lt;P&gt;aveti cumva vreun exemplu sau vreun sfat&lt;/P&gt;
&lt;P&gt;multumesc.&lt;/P&gt;
&lt;P&gt;alex&lt;/P&gt;</description></item></channel></rss>