<?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 cursor + order by</title><link>http://sqlserver.ro/forums/thread/3975.aspx</link><pubDate>Mon, 11 Feb 2008 16:38:40 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3975</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3975.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=3975</wfw:commentRss><description>&lt;P&gt;rezolvat.&lt;/P&gt;
&lt;P&gt;am scos parantezele de la select&lt;/P&gt;
&lt;P&gt;alex.&lt;/P&gt;</description></item><item><title>sql server 2000 cursor + order by</title><link>http://sqlserver.ro/forums/thread/3974.aspx</link><pubDate>Mon, 11 Feb 2008 16:33:32 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3974</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3974.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=3974</wfw:commentRss><description>&lt;P&gt;salut, am si eu o eroare de syntaxa (sper) dar nu-mi dau seama ce si cum....am cursorul de mai jos&lt;/P&gt;
&lt;P&gt;declare curs cursor for (select id from altele where id = @id or id = 0x)&lt;BR&gt;open curs&lt;BR&gt;fetch next from curs into @aux_id&lt;BR&gt;while @@fetch_status = 0&lt;BR&gt;begin&lt;/P&gt;
&lt;P&gt;-------&lt;/P&gt;
&lt;P&gt;end&lt;BR&gt;fetch next from curs into @aux_id&lt;BR&gt;close curs&lt;BR&gt;deallocate curs&lt;/P&gt;
&lt;P&gt;totul merge ok...doar ca nu-mi ordoneaza cum trebuie si in concluzie am incercat sa-i bag un order by&lt;/P&gt;
&lt;P&gt;deci sa-l fac astfel&lt;/P&gt;
&lt;P&gt;declare curs cursor for (select id from altele where id = @id or id = 0x &lt;STRONG&gt;order by id asc&lt;/STRONG&gt;)&lt;BR&gt;open curs&lt;BR&gt;fetch next from curs into @aux_id&lt;BR&gt;while @@fetch_status = 0&lt;BR&gt;begin&lt;/P&gt;
&lt;P&gt;-------&lt;/P&gt;
&lt;P&gt;end&lt;BR&gt;fetch next from curs into @aux_id&lt;BR&gt;close curs&lt;BR&gt;deallocate curs&lt;/P&gt;
&lt;P&gt;si primesc eroarea&lt;/P&gt;
&lt;P&gt;Server: Msg 156, Level 15, State 1, Line 27&lt;BR&gt;Incorrect syntax near the keyword 'order'.&lt;/P&gt;
&lt;P&gt;care nu reusesc sa-mi dau seama de la ce.&lt;/P&gt;
&lt;P&gt;multumesc mult.&lt;/P&gt;
&lt;P&gt;alex.&lt;/P&gt;</description></item></channel></rss>