<?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: intrebari/raspunsuri de pe la interviuri</title><link>http://sqlserver.ro/forums/thread/3121.aspx</link><pubDate>Tue, 30 Oct 2007 08:31:12 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3121</guid><dc:creator>ggciubuc</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3121.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=3121</wfw:commentRss><description>Niste lucruri de stiut inainte de un interviu pentru&amp;nbsp;un post de DBA in articolul &amp;nbsp;"&lt;A class="" href="http://www.sqlservercentral.com/articles/Miscellaneous/surviveasqlserverdbatechnicalinterview/2486/"&gt;Survive A SQL Server DBA Technical Interview&lt;/A&gt;"</description></item><item><title>Re: intrebari/raspunsuri de pe la interviuri</title><link>http://sqlserver.ro/forums/thread/2359.aspx</link><pubDate>Tue, 31 Jul 2007 18:33:09 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:2359</guid><dc:creator>crestinul</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/2359.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=2359</wfw:commentRss><description>&lt;P&gt;Asta a fost inmateria de exam e in mcts training kit ala intradevar sunt niste chestii neclare cel putin pentru mine&lt;/P&gt;</description></item><item><title>Re: intrebari/raspunsuri de pe la interviuri</title><link>http://sqlserver.ro/forums/thread/2350.aspx</link><pubDate>Tue, 31 Jul 2007 07:53:25 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:2350</guid><dc:creator>rsocol</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/2350.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=2350</wfw:commentRss><description>&lt;p&gt;Vezi şi &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=564C5704-D4F5-4EE8-9F3C-CB429499D075&amp;amp;displaylang=en" target="_blank"&gt;SQL Server DataSizer Tool&lt;/a&gt; (e un fişier Excel cu formulele necesare pentru a calcula dimensiunea unei tabele).&lt;/p&gt;&lt;p&gt;În cazul menţionat, avem 4 coloane cu dimensiune fixă (4+4+8+8=24), iar indexul clustered pe ID înţeleg că e şi cheie primară (adică vreau să spun că ID este unic). Atunci avem Null_Bitmap=3 bytes, Row_Size=24+0+3+4=31 bytes, Rows_Per_Page=8096/(31+2)=245. Dacă luăm în considerare un Fill Factor de 90%, atunci Free_Rows_Per_Page=24, iar Num_Pages=5000/(245-24)=23, deci Leaf_space_used=8192*23=188416 bytes. Însă dacă introducem datele după ce indexul e deja creat, atunci fill factor-ul nu e luat în considerare, deci avem 21 de pagini, adică 172032 bytes.&lt;br&gt;&lt;/p&gt;&lt;p&gt;Apoi ar fi dimensiunea indexului, pentru care avem Index_Row_Size=4+0+0+1+6=11 bytes, Index_Rows_Per_Page=8096/(11+2)=622, adică mult mai puţin decât numărul de pagini de date (21), deci avem nevoie doar de 2 pagini pentru index (pentru că leaf-level pages sunt chiar datele), deoarece e nevoie de 2 nivele. Rezultă Index_space_used=8192*2=16384 bytes, iar dimensiunea totală ar fi&amp;nbsp; aproximativ 184KB.&lt;br&gt;&lt;/p&gt;&lt;p&gt;Din fişierul de mai sus iese altceva (192KB), dar oricum, ar trebui să poţi obţine o valoare orientativă. La acest număr de rânduri, poţi încerca şi practic:&lt;/p&gt;&lt;p&gt;CREATE TABLE TabelaA (&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID int IDENTITY PRIMARY KEY,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; VendorID int,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BalanceDue money,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateDue datetime&lt;br&gt;)&lt;br&gt;&lt;br&gt;INSERT INTO TabelaA (VendorID, BalanceDue, DateDue)&lt;br&gt;SELECT TOP 5000 1, 0, GETDATE() FROM syscolumns a, syscolumns b&lt;br&gt;&lt;br&gt;EXEC sp_spaceused 'TabelaA', @updateusage='true'&lt;br&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Şi observăm că tabela ocupă 200KB (dintre care 16KB sunt nefolosiţi).&lt;/p&gt;&lt;p&gt;Răzvan&lt;br&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Re: intrebari/raspunsuri de pe la interviuri</title><link>http://sqlserver.ro/forums/thread/2343.aspx</link><pubDate>Mon, 30 Jul 2007 13:17:47 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:2343</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/2343.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=2343</wfw:commentRss><description>&lt;P&gt;1. pai asa ma gandeam si eu ...... dar am niste intrebari unde imi da raspunsul corect ca fiind B. 1.620.......:)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; (se pare ca ei au pus&amp;nbsp;problema pt 90% dar au dat raspunsul pt 80%)&lt;/P&gt;
&lt;P&gt;2. as fi vrut sa-mi explice si mie cineva.......problema e ca nu inteleg cum se calculeaza&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;pana acum am inteles ca (dar asta doar daca tabela nu are campuri de timpul varchar etc)&lt;/P&gt;
&lt;P&gt;"1. se aduna dimensiunile campurilor a.&lt;/P&gt;
&lt;P&gt;2. se calculeaza "null bitmap" cu formula b = 2+[(q+7)/8] unde q este numarul de campuri/coloane&lt;BR&gt;&amp;nbsp;&amp;nbsp; si se rotunjeste in minus&lt;/P&gt;
&lt;P&gt;3. fiecare pagina are 8096 bytes&lt;/P&gt;
&lt;P&gt;3'. se face suma din y = a+b+2 (unde ultimul 2bytes nu stiu cine e? )&lt;/P&gt;
&lt;P&gt;4. se face w = 8096/y si ne da numarul de rows/page&lt;/P&gt;
&lt;P&gt;5. calculam x = nr de inregistrari(se da in problema) / w si ne da numarul de pages&lt;/P&gt;
&lt;P&gt;6. fiercare pagina are 8192 bytes si inmultind 8192*x ne da spatiul ocupat de tabela."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;multumesc&lt;/P&gt;
&lt;P&gt;alex.&lt;/P&gt;</description></item><item><title>Re: intrebari/raspunsuri de pe la interviuri</title><link>http://sqlserver.ro/forums/thread/2342.aspx</link><pubDate>Mon, 30 Jul 2007 13:08:51 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:2342</guid><dc:creator>ggciubuc</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/2342.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=2342</wfw:commentRss><description>&lt;P&gt;1.Daca o pagina are disponibili 8096 bytes (din 8k) atunci cat ar fi 10%?&lt;/P&gt;
&lt;P&gt;2.Cel mai repede, in BOL asa cum a spus si Diana, mai e si cartea lui Cristi Lefter de &lt;A class="" href="http://www.sybex.com/WileyCDA/SybexTitle/productCd-0470108800,navId-291004,descCd-authorInfo.html"&gt;aici.&lt;/A&gt;&lt;/P&gt;</description></item><item><title>Re: intrebari/raspunsuri de pe la interviuri</title><link>http://sqlserver.ro/forums/thread/2341.aspx</link><pubDate>Mon, 30 Jul 2007 12:37:51 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:2341</guid><dc:creator>Diana</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/2341.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=2341</wfw:commentRss><description>Vezi in books online - exista cateva capitole "Estimating the Size of a Table" ...&lt;br&gt;</description></item><item><title>Re: intrebari/raspunsuri de pe la interviuri</title><link>http://sqlserver.ro/forums/thread/2340.aspx</link><pubDate>Mon, 30 Jul 2007 12:29:01 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:2340</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/2340.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=2340</wfw:commentRss><description>&lt;P&gt;o alta intrebare:&lt;/P&gt;
&lt;P&gt;cum se calculeaza cat spatiu va ocupa o tabela ca nu inteleg de nici un fel?&lt;/P&gt;
&lt;P&gt;sa zicem ca avem tabela urmatoare:&lt;/P&gt;
&lt;P&gt;TabelaA&lt;/P&gt;
&lt;P&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataType&lt;/P&gt;
&lt;P&gt;ID&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;int&lt;/P&gt;
&lt;P&gt;VendorID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;int&lt;/P&gt;
&lt;P&gt;BalanceDue&amp;nbsp; money&lt;/P&gt;
&lt;P&gt;DateDue&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datetime&lt;/P&gt;
&lt;P&gt;si presupunand ca va avea 5000 de inregistrari si index cluster pe ID.....cum se calculeaza spatiul ocupat de tabela?&lt;/P&gt;
&lt;P&gt;multumesc&lt;/P&gt;
&lt;P&gt;alex.&lt;/P&gt;</description></item><item><title>Re: intrebari/raspunsuri de pe la interviuri</title><link>http://sqlserver.ro/forums/thread/2339.aspx</link><pubDate>Mon, 30 Jul 2007 09:58:14 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:2339</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/2339.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=2339</wfw:commentRss><description>&lt;P&gt;You have created a table with a fill factor of 90 percent. How many bytes per page are reserved for future input?&lt;/P&gt;
&lt;P&gt;a. 7.286&lt;/P&gt;
&lt;P&gt;b. 1.620&lt;/P&gt;
&lt;P&gt;c. 810&lt;/P&gt;
&lt;P&gt;d. 405&lt;/P&gt;</description></item><item><title>Re: intrebari/raspunsuri de pe la interviuri</title><link>http://sqlserver.ro/forums/thread/1971.aspx</link><pubDate>Tue, 29 May 2007 04:35:59 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1971</guid><dc:creator>rsocol</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1971.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=1971</wfw:commentRss><description>&lt;p&gt;Totuşi, funcţia pe care am făcut-o se bazează pe o facilitate nedocumentată. &lt;/p&gt;&lt;p&gt;Vezi: &lt;a href="http://support.microsoft.com/default.aspx/kb/287515" target="_blank"&gt;http://support.microsoft.com/default.aspx/kb/287515&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Zice acolo: "&lt;i&gt;The correct behavior for an aggregate concatenation query is undefined.&lt;/i&gt;" Dar apoi spune: "&lt;i&gt;In order to achieve the expected results from an aggregate
concatenation query, apply any Transact-SQL function or expression to
the columns in the SELECT list rather than in the ORDER BY clause.&lt;/i&gt;"&lt;/p&gt;&lt;p&gt;Vezi şi: &lt;/p&gt;&lt;p&gt;&lt;a href="http://databases.aspfaq.com/general/how-do-i-concatenate-strings-from-a-column-into-a-single-row.html" target="_blank"&gt;http://databases.aspfaq.com/general/how-do-i-concatenate-strings-from-a-column-into-a-single-row.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.programming/msg/2d85bf366dd9e73e" target="_blank"&gt;http://groups.google.com/group/microsoft.public.sqlserver.programming/msg/2d85bf366dd9e73e&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Răzvan&lt;/p&gt;</description></item><item><title>Re: intrebari/raspunsuri de pe la interviuri</title><link>http://sqlserver.ro/forums/thread/1968.aspx</link><pubDate>Mon, 28 May 2007 19:32:43 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1968</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1968.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=1968</wfw:commentRss><description>&lt;p&gt;prima varianta care e si pe sql 2000 si 2005 (cea cu functie) e super misto...eu ma declar multumit :)&lt;br&gt;&lt;br&gt;ahh.......o alta intrebare de pe la interviuri pe care mi-am amintit-o acum.......diferenta dintre UNION si UNION ALL.&lt;/p&gt;</description></item><item><title>Re: intrebari/raspunsuri de pe la interviuri</title><link>http://sqlserver.ro/forums/thread/1967.aspx</link><pubDate>Mon, 28 May 2007 19:16:07 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1967</guid><dc:creator>rsocol</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1967.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=1967</wfw:commentRss><description>&lt;p&gt;Folosind datele de test ale lui katalyn, am făcut o altă variantă fără cursor, dar cu o funcţie:&lt;/p&gt;&lt;p&gt;&lt;b&gt;CREATE FUNCTION dbo.TreiClientiMariDinOrasul(@Oras nvarchar(40))&lt;br&gt;RETURNS nvarchar(126) AS BEGIN&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DECLARE @lista nvarchar(126)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT TOP 3 @lista=ISNULL(@lista+'; ','')+Client&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM T WHERE Oras=@Oras&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORDER BY Total DESC&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RETURN @lista&lt;br&gt;END&lt;br&gt;&lt;br&gt;GO&lt;br&gt;SELECT Oras, dbo.TreiClientiMariDinOrasul(Oras)&lt;br&gt;FROM (SELECT DISTINCT Oras FROM T) X&lt;/b&gt;&lt;/p&gt;&lt;p&gt;În SQL 2005 s-ar putea cu un "simplu" SELECT, astfel:&lt;/p&gt;&lt;p&gt;&lt;b&gt;SELECT Oras, MIN(CASE WHEN rn=1 THEN Client END)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; +ISNULL(';'+MIN(CASE WHEN rn=2 THEN Client END),'')&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; +ISNULL(';'+MIN(CASE WHEN rn=3 THEN Client END),'') AS Clienti&lt;br&gt;FROM (&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT *, ROW_NUMBER() OVER (&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PARTITION BY Oras ORDER BY Total DESC&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) rn FROM T&lt;br&gt;) X GROUP BY Oras&lt;/b&gt;&lt;/p&gt;&lt;p&gt;E interesant de observat că putem obţine rezultate diferite (cel puţin la aceste date de test), deoarece nu s-a precizat ce facem dacă sunt mai mulţi clienţi cu exact acelaşi total.&lt;br&gt;&lt;/p&gt;&lt;p&gt;Răzvan&lt;br&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Re: intrebari/raspunsuri de pe la interviuri</title><link>http://sqlserver.ro/forums/thread/1966.aspx</link><pubDate>Mon, 28 May 2007 17:11:34 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1966</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1966.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=1966</wfw:commentRss><description>si eu care credeam ca e un simplu select dar nu-l vad eu &lt;img src="http://sqlserver.ro/emoticons/emotion-5.gif" alt="Wink" /&gt;&lt;br&gt;</description></item><item><title>Re: intrebari/raspunsuri de pe la interviuri</title><link>http://sqlserver.ro/forums/thread/1965.aspx</link><pubDate>Mon, 28 May 2007 14:28:25 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1965</guid><dc:creator>lmsasu</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1965.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=1965</wfw:commentRss><description>&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;Am rezolvat asta:&amp;nbsp;pentru cele mai banoase orase (suma banilor pe orase)&amp;nbsp;se aduce lista clientilor care au cotizat. Dca n-am inteles corect, ghinion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Ca veni vorba: ce daca e BL pe stocatura?&amp;nbsp; e rapid....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;select&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;top&lt;/FONT&gt;&lt;FONT size=2&gt; 3 &lt;/P&gt;
&lt;P&gt;t1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;oras&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/P&gt;
&lt;P&gt;(&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;select&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;replace&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;replace&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;replace&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;replace&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;replace&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;replace&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;replace&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/P&gt;
&lt;P&gt;(&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;select&lt;/FONT&gt;&lt;FONT size=2&gt; myTable&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;x&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;from&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;select&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;distinct&lt;/FONT&gt;&lt;FONT size=2&gt; client x&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;from&lt;/FONT&gt;&lt;FONT size=2&gt; tab&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;where&lt;/FONT&gt;&lt;FONT size=2&gt; oras &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt; t1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;oras&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;/FONT&gt;&lt;FONT size=2&gt; mytable&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;for&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;xml&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;auto&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;
&lt;P&gt;),&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'x="'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;''&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;),&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'&amp;lt;mytable '&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'&amp;lt;'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;),&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'"'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;''&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;),&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'/&amp;gt;&amp;lt;'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;','&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;),&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'&amp;lt;'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;''&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;),&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;' '&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;''&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;),&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'/&amp;gt;'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;''&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;/P&gt;
&lt;P&gt;)&lt;/FONT&gt;&lt;FONT size=2&gt; t2&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;
&lt;P&gt;sum&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;t1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;total&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;from&lt;/FONT&gt;&lt;FONT size=2&gt; tab t1&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;group&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;by&lt;/FONT&gt;&lt;FONT size=2&gt; t1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;oras&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;order&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;by&lt;/FONT&gt;&lt;FONT size=2&gt; 3 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;desc&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;smecheria cu aducerea clientilor cu virgula se face fortand un xml.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;Mama, chiar ca m-am plictisit...&lt;/P&gt;&lt;/FONT&gt;</description></item><item><title>Re: intrebari/raspunsuri de pe la interviuri</title><link>http://sqlserver.ro/forums/thread/1963.aspx</link><pubDate>Mon, 28 May 2007 14:15:21 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1963</guid><dc:creator>Diana</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1963.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=1963</wfw:commentRss><description>&lt;p&gt;...hm, sa zicem ca as"intoarce" un set de forma:&lt;/p&gt;&lt;p&gt;Brasov&amp;nbsp;&amp;nbsp;&amp;nbsp; Client1&amp;nbsp;&amp;nbsp;&amp;nbsp; 500&amp;nbsp;&lt;/p&gt;&lt;p&gt;Brasov&amp;nbsp;&amp;nbsp;&amp;nbsp; Client3 &amp;nbsp;&amp;nbsp; 250&lt;/p&gt;&lt;p&gt;Brasov&amp;nbsp;&amp;nbsp;&amp;nbsp; Client2 &amp;nbsp; 100... &lt;br&gt;
&lt;/p&gt;&lt;p&gt;... de exemplu folosind un cursor (&lt;img src="http://sqlserver.ro/emoticons/emotion-10.gif" alt="Embarrassed" /&gt;) pe campul "oras" si
selectand TOP 3 (sau TOP 3 WITH TIES) Oras, Client, Total ..... ORDER
BY Total DESC&lt;/p&gt;&lt;p&gt;...dar
eu nu as face in viata de "zi cu zi" ceea ce imi cere intrabarea asta
in TSQL - adica as evita lucrul cu siruri in TSQL - pentru asta exista
functiile CLR...&lt;/p&gt;&lt;p&gt;Aici sunt multe discutii - ce "business logic" isi gaseste locul in proceduri SQL, etc...&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: intrebari/raspunsuri de pe la interviuri</title><link>http://sqlserver.ro/forums/thread/1962.aspx</link><pubDate>Mon, 28 May 2007 14:10:07 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1962</guid><dc:creator>katalyn</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1962.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=1962</wfw:commentRss><description>&lt;P&gt;Din greşeală am postat de două ori acelaşi raspuns. Rog un administrator să şteargă un post (am în cercat să o fac eu dar nu am permisiunea)&lt;/P&gt;</description></item></channel></rss>