<?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: Internal SQL Server error. (Server: Msg 8624, Level 16, State 21, Line 29)</title><link>http://sqlserver.ro/forums/thread/3945.aspx</link><pubDate>Tue, 05 Feb 2008 11:33:53 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3945</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3945.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=3945</wfw:commentRss><description>&lt;P&gt;exista vreo varianta sa inlocuiesc conditia&lt;/P&gt;
&lt;P&gt;and &amp;nbsp;dbo.GetGrupareByIDTipMatricola(dbf.id_tipmatr,dbf.id_matr)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbo.GetGrupareByIDTipMatricola(p.id_tipmatr,p.id_matr)&lt;/P&gt;
&lt;P&gt;dureaza f mult daca rulez procedura pt mai mult de 100 persoane....si cred ca e din cauza acestei conditii....&lt;/P&gt;
&lt;P&gt;sau sa simplific cumva functia......daca e posibil&lt;/P&gt;
&lt;P&gt;multumesc mult.&lt;/P&gt;
&lt;P&gt;alex.&lt;/P&gt;</description></item><item><title>Re: Internal SQL Server error. (Server: Msg 8624, Level 16, State 21, Line 29)</title><link>http://sqlserver.ro/forums/thread/3900.aspx</link><pubDate>Thu, 31 Jan 2008 13:35:39 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3900</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3900.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=3900</wfw:commentRss><description>&lt;P&gt;daca ii scot conditia ----and dbf.an &amp;lt;= year(@dataCurenta)&lt;/P&gt;
&lt;P&gt;atunci e ok....&amp;lt;2 sec&lt;/P&gt;
&lt;P&gt;alex.&lt;/P&gt;</description></item><item><title>Re: Internal SQL Server error. (Server: Msg 8624, Level 16, State 21, Line 29)</title><link>http://sqlserver.ro/forums/thread/3899.aspx</link><pubDate>Thu, 31 Jan 2008 13:13:48 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3899</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3899.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=3899</wfw:commentRss><description>&lt;P&gt;ai dreptate merge...multumesc mult (nu stiu cum am testat eu de primeam aceeasi eroare....imi cer scuze)&lt;/P&gt;
&lt;P&gt;singura problema este ca dureaza f mult......2 min....si chiar nu e din cauza ca ar fi f multe date.....&lt;/P&gt;
&lt;P&gt;alex.&lt;/P&gt;</description></item><item><title>Re: Internal SQL Server error. (Server: Msg 8624, Level 16, State 21, Line 29)</title><link>http://sqlserver.ro/forums/thread/3898.aspx</link><pubDate>Thu, 31 Jan 2008 12:59:33 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3898</guid><dc:creator>rsocol</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3898.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=3898</wfw:commentRss><description>La mine a mers. Adică am reuşit să reproduc fenomenul, obţinând eroarea respectivă folosind query-ul tău şi următoarele tabele:&lt;br&gt;&lt;br&gt;create table debite_pf (&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id_tipdebit int,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; suma money,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id_matr uniqueidentifier,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id_tipmatr int,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id_rol int,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; an int&lt;br&gt;)&lt;br&gt;&lt;br&gt;create table roluri_fiz (&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id int,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id_prim uniqueidentifier&lt;br&gt;)&lt;br&gt;&lt;br&gt;Iar apoi am încercat următorul query, care nu a mai dat eroare:&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp;select distinct dbo.GetGrupareByIDTipMatricola(dbf.id_tipmatr,dbf.id_matr) as grup,&lt;br&gt;&amp;nbsp; dbf.an,&lt;br&gt;&amp;nbsp; coalesce(&lt;br&gt;&amp;nbsp;&amp;nbsp; (select sum(suma)from debite_pf p&lt;br&gt;&amp;nbsp;&amp;nbsp; where &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; p.id_tipdebit = 2&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and p.an = dbf.an&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and&amp;nbsp; dbo.GetGrupareByIDTipMatricola(dbf.id_tipmatr,dbf.id_matr)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbo.GetGrupareByIDTipMatricola(p.id_tipmatr,p.id_matr)&lt;br&gt;&amp;nbsp;&amp;nbsp; ),0) as ramasite,&lt;br&gt;&amp;nbsp; coalesce(&lt;br&gt;&amp;nbsp;&amp;nbsp; (select sum(suma)from debite_pf p&lt;br&gt;&amp;nbsp;&amp;nbsp; where &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (p.id_tipdebit = 5 or p.id_tipdebit = 8)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and p.an = dbf.an&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and&amp;nbsp; dbo.GetGrupareByIDTipMatricola(dbf.id_tipmatr,dbf.id_matr)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbo.GetGrupareByIDTipMatricola(p.id_tipmatr,p.id_matr)&lt;br&gt;&amp;nbsp;&amp;nbsp; ),0) as accesorii&lt;br&gt;&amp;nbsp;from&amp;nbsp;&amp;nbsp; roluri_fiz r&lt;br&gt;&amp;nbsp;inner join&amp;nbsp; debite_pf dbf&lt;br&gt;&amp;nbsp;&amp;nbsp; on r.id = dbf.id_rol&lt;br&gt;&amp;nbsp;where&amp;nbsp; r.id_prim = @idprim and&lt;br&gt;&amp;nbsp; dbf.id_tipdebit in (2,5,8)&lt;br&gt;&amp;nbsp; and dbf.an &amp;lt;= year(@dataCurenta)&lt;br&gt;&lt;br&gt;Răzvan&lt;br&gt;</description></item><item><title>Re: Internal SQL Server error. (Server: Msg 8624, Level 16, State 21, Line 29)</title><link>http://sqlserver.ro/forums/thread/3897.aspx</link><pubDate>Thu, 31 Jan 2008 12:49:09 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3897</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3897.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=3897</wfw:commentRss><description>&lt;P&gt;nu merge&lt;/P&gt;
&lt;P&gt;problema e ca in selecturile cu coalesce, ca acesta&amp;nbsp;(sunt 2 la numar unul as ramasite altul as accesorii):&lt;/P&gt;
&lt;P&gt;coalesce(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(select sum(suma)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;from gotax.dbo.debite_pf p&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;where &amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;p.id_tipdebit = 2&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;and p.an = dbf.an&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;and &amp;nbsp;dbo.GetGrupareByIDTipMatricola(dbf.id_tipmatr,dbf.id_matr)&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;=&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;dbo.GetGrupareByIDTipMatricola(p.id_tipmatr,p.id_matr)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;,0) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;as ramasite&lt;/P&gt;
&lt;P&gt;folosesc dbo.GetGrupareByIDTipMatricola(dbf.id_tipmatr,dbf.id_matr) unde aliasul &lt;EM&gt;dbf &lt;/EM&gt;este din from-ul primului select....selectul mare....dar nu stiu cum sa fac altfel&lt;/P&gt;
&lt;P&gt;multumesc.&lt;/P&gt;
&lt;P&gt;alex.&lt;BR&gt;&lt;/P&gt;</description></item><item><title>Re: Internal SQL Server error. (Server: Msg 8624, Level 16, State 21, Line 29)</title><link>http://sqlserver.ro/forums/thread/3896.aspx</link><pubDate>Thu, 31 Jan 2008 12:27:01 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3896</guid><dc:creator>rsocol</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3896.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=3896</wfw:commentRss><description>Sorry, m-am grăbit şi nu am citit suficient de atent problema. KB-ul pe care l-am menţionat are alte simptome (rezultate incorecte), iar circumstanţele sunt doar vag asemănătoare. &lt;br&gt;&lt;br&gt;Problema ta este cea descrisă în &lt;a href="http://support.microsoft.com/kb/274729"&gt;KB 274729&lt;/a&gt;, însă pentru aceasta nu există hotfix, ci doar un workaround: să foloseşti DISTINCT (imediat după primul select) în loc de GROUP BY-ul de la sfârşit.&lt;br&gt;&lt;br&gt;&lt;br&gt;Răzvan</description></item><item><title>Re: Internal SQL Server error. (Server: Msg 8624, Level 16, State 21, Line 29)</title><link>http://sqlserver.ro/forums/thread/3895.aspx</link><pubDate>Thu, 31 Jan 2008 11:31:10 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3895</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3895.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=3895</wfw:commentRss><description>&lt;P&gt;am rulat&lt;/P&gt;
&lt;P&gt;DBCC TRACEON(9056, -1)&lt;/P&gt;
&lt;P&gt;dar primesc aceeasi eroare&lt;/P&gt;
&lt;P&gt;daca nu pot rezolva astfel problema cum as putea modifica scriptul pt. e evita folosirea&amp;nbsp;conditiei&lt;/P&gt;
&lt;P&gt;and &amp;nbsp;(dbo.GetGrupareByIDTipMatricola (dbf.id_tipmatr,dbf.id_matr)&amp;nbsp;= dbo.GetGrupareByIDTipMatricola (p.id_tipmatr,p.id_matr))&amp;nbsp;&lt;/P&gt;
&lt;P&gt;multumesc.&lt;/P&gt;
&lt;P&gt;alex.&lt;/P&gt;
&lt;P&gt;p.s. imi cer scuze dar am omis sa zic ca este corba de sql server 2000&lt;/P&gt;</description></item><item><title>Re: Internal SQL Server error. (Server: Msg 8624, Level 16, State 21, Line 29)</title><link>http://sqlserver.ro/forums/thread/3894.aspx</link><pubDate>Thu, 31 Jan 2008 10:40:00 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3894</guid><dc:creator>rsocol</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3894.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=3894</wfw:commentRss><description>Problema este descrisă în &lt;a href="http://support.microsoft.com/kb/883415"&gt;KB 883415&lt;/a&gt;, iar hotfix-ul aferent este inclus într-adevăr în SP4, însă KB-ul menţionat precizează:&lt;br&gt;"To resolve this problem, you must install this hotfix &lt;b&gt;and turn on
		  trace flag 9056&lt;/b&gt;. You can turn on trace flag 9056 by adding -T9056 to the SQL Server command line or by using DBCC TRACEON(9056, -1)
		  from a query connection."&lt;br&gt;&lt;br&gt;Am sesizat această problemă mai demult, fiind discutată în &lt;a href="http://groups.google.ro/group/microsoft.public.sqlserver.programming/browse_frm/thread/f7a2b47ac87aa575"&gt;acest thread&lt;/a&gt;. Este ciudat faptul că trebuie să activezi un trace flag pentru a evita un bug, însă mai sunt şi alte hotfix-uri (incluse în SP4) în aceeaşi situaţie. Am scris despre ele &lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.programming/msg/04b7d1e65df64435"&gt;aici&lt;/a&gt;.&lt;br&gt;&lt;br&gt;Răzvan&lt;br&gt;</description></item><item><title>Re: Internal SQL Server error. (Server: Msg 8624, Level 16, State 21, Line 29)</title><link>http://sqlserver.ro/forums/thread/3892.aspx</link><pubDate>Thu, 31 Jan 2008 10:05:11 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3892</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3892.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=3892</wfw:commentRss><description>&lt;P&gt;da am verificat.......am SP4.......care cica ar rezolva problema....sau cel putin ar intoarce alta eroare&lt;/P&gt;
&lt;P&gt;alex.&lt;/P&gt;</description></item><item><title>Re: Internal SQL Server error. (Server: Msg 8624, Level 16, State 21, Line 29)</title><link>http://sqlserver.ro/forums/thread/3891.aspx</link><pubDate>Thu, 31 Jan 2008 09:47:51 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3891</guid><dc:creator>Diana</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3891.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=3891</wfw:commentRss><description>&lt;P&gt;Esti "la zi" cu service pack-urile?&lt;/P&gt;</description></item><item><title>Internal SQL Server error. (Server: Msg 8624, Level 16, State 21, Line 29)</title><link>http://sqlserver.ro/forums/thread/3890.aspx</link><pubDate>Thu, 31 Jan 2008 09:16:22 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3890</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3890.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=3890</wfw:commentRss><description>&lt;P&gt;Salut, la rularea urmatorului select primesc eroarea din Subject....aveti idee de ce?.....cum pot s-o evit (cu siguranta esle legata de conditia din where unde functie = functie (--and &amp;nbsp;dbo.GetGrupareByIDTipMatricola(dbf.id_tipmatr,dbf.id_matr)&amp;nbsp;=dbo.GetGrupareByIDTipMatricola(p.id_tipmatr,p.id_matr)) )......daca o scot intoarce ceva dar nu datele pe care mi le doresc&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;declare&lt;BR&gt;&amp;nbsp;@dataCurenta smalldatetime,&lt;BR&gt;&amp;nbsp;@idprim uniqueidentifier,&lt;BR&gt;&amp;nbsp;@filtru_tip_persoana tinyint,&lt;/P&gt;
&lt;P&gt;set @dataCurenta = getdate()&lt;BR&gt;set @idprim = 'B9F77393-F3EA-46C5-BA15-FB70C6199A20'&lt;BR&gt;set @filtru_tip_persoana = 1&lt;/P&gt;
&lt;P&gt;IF @filtru_tip_persoana = 1&lt;BR&gt;begin&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;select &amp;nbsp;dbo.GetGrupareByIDTipMatricola(dbf.id_tipmatr,dbf.id_matr) as grup,&lt;BR&gt;&amp;nbsp;&amp;nbsp;dbf.an,&lt;BR&gt;&amp;nbsp;&amp;nbsp;coalesce(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(select sum(suma)from gotax.dbo.debite_pf p&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;where &amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;p.id_tipdebit = 2&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;and p.an = dbf.an&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;and &amp;nbsp;dbo.GetGrupareByIDTipMatricola(dbf.id_tipmatr,dbf.id_matr)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbo.GetGrupareByIDTipMatricola(p.id_tipmatr,p.id_matr)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;),0) as ramasite,&lt;BR&gt;&amp;nbsp;&amp;nbsp;coalesce(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(select sum(suma)from gotax.dbo.debite_pf p&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;where &amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(p.id_tipdebit = 5 or p.id_tipdebit = 8) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;and p.an = dbf.an&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;and &amp;nbsp;dbo.GetGrupareByIDTipMatricola(dbf.id_tipmatr,dbf.id_matr)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbo.GetGrupareByIDTipMatricola(p.id_tipmatr,p.id_matr)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;),0) as accesorii&lt;BR&gt;&amp;nbsp;from &amp;nbsp;&amp;nbsp;gotax.dbo.roluri_fiz r&lt;BR&gt;&amp;nbsp;inner join &amp;nbsp;gotax.dbo.debite_pf dbf&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;on r.id = dbf.id_rol&lt;BR&gt;&amp;nbsp;where &amp;nbsp;r.id_prim = @idprim and&lt;BR&gt;&amp;nbsp;&amp;nbsp;dbf.id_tipdebit in (2,5,8)&lt;BR&gt;&amp;nbsp;&amp;nbsp;and dbf.an &amp;lt;= year(@dataCurenta)&lt;BR&gt;&amp;nbsp;group by dbf.an,dbo.GetGrupareByIDTipMatricola(dbf.id_tipmatr,dbf.id_matr)&lt;BR&gt;end &lt;/P&gt;
&lt;P&gt;functia este:&lt;/P&gt;
&lt;P&gt;CREATE FUNCTION GetGrupareByIDTipMatricola (@id_tipmatr tinyint,@id_matr uniqueidentifier)&amp;nbsp; &lt;BR&gt;RETURNS varchar(100) AS&amp;nbsp; &lt;BR&gt;BEGIN &lt;BR&gt;declare @aux varchar(100)&lt;BR&gt;if @id_tipmatr = 1 SET @Aux = (select label from gotax.dbo.tip_matricole where id = 1)&lt;/P&gt;
&lt;P&gt;if @id_tipmatr = 2&lt;BR&gt;begin&lt;BR&gt;&amp;nbsp;SET @Aux =(select label from gotax.dbo.tip_matricole where id = 2)&lt;BR&gt;&lt;BR&gt;end&lt;BR&gt;if @id_tipmatr = 3 SET @Aux = (select label from gotax.dbo.tip_matricole where id = 3)&lt;/P&gt;
&lt;P&gt;if @id_tipmatr = 4 SET @Aux =&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(select denumire from gotax.dbo.tip_alte_taxe where id = &lt;BR&gt;&amp;nbsp;&amp;nbsp;coalesce(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(select id_tipalte from gotax.dbo.matricole_alte_pf where id = @id_matr),&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(select id_tipalte from gotax.dbo.matricole_alte_pj where id = @id_matr)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;)&lt;BR&gt;return @aux&lt;BR&gt;END&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;multumesc mult.&lt;/P&gt;
&lt;P&gt;alex.&lt;/P&gt;</description></item></channel></rss>