<?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: script gresit....dar unde?</title><link>http://sqlserver.ro/forums/thread/1781.aspx</link><pubDate>Tue, 13 Feb 2007 10:35:31 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1781</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1781.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=1781</wfw:commentRss><description>&lt;P&gt;Razvan, multumesc de raspuns&lt;/P&gt;
&lt;P&gt;nu am creat eu procedurile respective incerc doar sa le modific dupa niste cerinte (sincer e prima data cand vad niste proceduri create in felul asta.....pe respectiva baza de date toate sunt create in felul ala)....multumesc pt linkuri nu am apucat inca sa ma uit pe ele dar o s-o fac cu siguranta&lt;/P&gt;
&lt;P&gt;alex&lt;/P&gt;</description></item><item><title>Re: script gresit....dar unde?</title><link>http://sqlserver.ro/forums/thread/1743.aspx</link><pubDate>Wed, 07 Feb 2007 16:16:29 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1743</guid><dc:creator>rsocol</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1743.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=1743</wfw:commentRss><description>&lt;p&gt;N-am citit atent codul tău, dar mi se pare cam mult dynamic SQL şi peste tot e vulneriabil la SQL Injection. Citeşte:&lt;br&gt;&lt;a href="http://www.sommarskog.se/dynamic_sql.html" target="_blank"&gt;http://www.sommarskog.se/dynamic_sql.html&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.nextgenss.com/papers/advanced_sql_injection.pdf" target="_blank"&gt;http://www.nextgenss.com/papers/advanced_sql_injection.pdf&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Răzvan&lt;/p&gt;</description></item><item><title>Re: script gresit....dar unde?</title><link>http://sqlserver.ro/forums/thread/1742.aspx</link><pubDate>Wed, 07 Feb 2007 15:08:36 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1742</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1742.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=1742</wfw:commentRss><description>&lt;P&gt;am rezolvat pana la urma.......am modificat partea cu 'WHEN...TEHN PAUSE' cu&lt;/P&gt;
&lt;P&gt;WHEN dbo.N_QASStation.TimeStation&amp;lt;&amp;gt;0 and Cycle.timeInWsSeconds&amp;gt;dbo.N_QASStation.TimeStation&lt;BR&gt;&amp;nbsp;and ((Cycle.startTime&amp;gt;= &lt;A href="mailto:'''+@dataInP1+'''"&gt;'''+@dataInP1+'''&lt;/A&gt; and Cycle.startTime&amp;lt;= &lt;A href="mailto:'''+@dataOutP1+'''"&gt;'''+@dataOutP1+'''&lt;/A&gt;) &lt;BR&gt;&amp;nbsp;&amp;nbsp;or (Cycle.startTime&amp;gt;= &lt;A href="mailto:'''+@dataInP2+'''"&gt;'''+@dataInP2+'''&lt;/A&gt; and Cycle.startTime&amp;lt;= &lt;A href="mailto:'''+@dataOutP2+'''"&gt;'''+@dataOutP2+'''&lt;/A&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;or (Cycle.startTime&amp;gt;= &lt;A href="mailto:'''+@dataInP3+'''"&gt;'''+@dataInP3+'''&lt;/A&gt; and Cycle.startTime&amp;lt;= &lt;A href="mailto:'''+@dataOutP3+'''"&gt;'''+@dataOutP3+'''&lt;/A&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;or (Cycle.startTime&amp;gt;= &lt;A href="mailto:'''+@dataInP4+'''"&gt;'''+@dataInP4+'''&lt;/A&gt; and Cycle.startTime&amp;lt;= &lt;A href="mailto:'''+@dataOutP4+'''"&gt;'''+@dataOutP4+'''&lt;/A&gt;)&lt;BR&gt;) THEN ''PAUSE''&lt;/P&gt;
&lt;P&gt;sunt sigur ca exista si o varianta mai simpla dar nu am stiut cum altfel (ma refer la toata partea cu dataINP1,P2 etc...la cum sunt declarate ele etc)&lt;/P&gt;</description></item><item><title>Re: script gresit....dar unde?</title><link>http://sqlserver.ro/forums/thread/1741.aspx</link><pubDate>Wed, 07 Feb 2007 14:24:49 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1741</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1741.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=1741</wfw:commentRss><description>e vorba cred de "Syntax error converting datetime from character string."....acolo al BETWEEN.....&amp;nbsp;cum as putea rezolva problema...aveti idee?</description></item><item><title>script gresit....dar unde?</title><link>http://sqlserver.ro/forums/thread/1739.aspx</link><pubDate>Wed, 07 Feb 2007 13:18:11 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:1739</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/1739.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=15&amp;PostID=1739</wfw:commentRss><description>&lt;P&gt;am aceasta procedura......de cand am introdus ORE DE PAUZA (declare si set) si WHEN.......THEN 'PAUSE'&lt;/P&gt;
&lt;P&gt;nu vrea sa mai functioneze.....syntax e corect dar nu mai intoarce nimic...aveti idee de ce?&lt;/P&gt;
&lt;P&gt;CREATE proc Raport_AngajatCalcTime&lt;BR&gt;&amp;nbsp;@gTemp_table &amp;nbsp;nvarchar(500),&lt;BR&gt;&amp;nbsp;@QASUserName&amp;nbsp;nvarchar(50),&lt;BR&gt;&amp;nbsp;@dataIn &amp;nbsp;nvarchar(50),&lt;BR&gt;&amp;nbsp;@dataOut &amp;nbsp;nvarchar(50)&lt;BR&gt;as&lt;BR&gt;declare&lt;BR&gt;&amp;nbsp;@QASStation &amp;nbsp;nvarchar(10),&lt;BR&gt;&amp;nbsp;@rsCursor&amp;nbsp;cursor,&lt;BR&gt;&amp;nbsp;@str&amp;nbsp;&amp;nbsp;nvarchar(4000),&lt;BR&gt;&amp;nbsp;@strSQL &amp;nbsp;nvarchar(4000)&lt;/P&gt;
&lt;P&gt;declare&lt;BR&gt;&amp;nbsp;@dataInV &amp;nbsp;nvarchar(50),&lt;BR&gt;&amp;nbsp;@dataOutV &amp;nbsp;nvarchar(50)&lt;/P&gt;
&lt;P&gt;set @dataInV=@dataIn+' 00:00:00'&lt;BR&gt;set @dataOutV=@dataOut+' 23:59:59'&lt;/P&gt;
&lt;P&gt;---------ORE DE PAUZA&lt;BR&gt;declare&lt;BR&gt;&amp;nbsp;@dataInP1 &amp;nbsp;nvarchar(50),&lt;BR&gt;&amp;nbsp;@dataOutP1&amp;nbsp;nvarchar(50)&lt;BR&gt;set @dataInP1=@dataIn+' 09:00:00'&lt;BR&gt;set @dataOutP1=@dataOut+' 09:10:00'&lt;BR&gt;-------------&lt;BR&gt;declare&lt;BR&gt;&amp;nbsp;@dataInP2 &amp;nbsp;nvarchar(50),&lt;BR&gt;&amp;nbsp;@dataOutP2&amp;nbsp;nvarchar(50)&lt;BR&gt;set @dataInP2=@dataIn+' 11:00:00'&lt;BR&gt;set @dataOutP2=@dataOut+' 11:30:00'&lt;BR&gt;-------------&lt;BR&gt;declare&lt;BR&gt;&amp;nbsp;@dataInP3 &amp;nbsp;nvarchar(50),&lt;BR&gt;&amp;nbsp;@dataOutP3&amp;nbsp;nvarchar(50)&lt;BR&gt;set @dataInP3=@dataIn+' 13:30:00'&lt;BR&gt;set @dataOutP3=@dataOut+' 13:40:00'&lt;BR&gt;--------------&lt;BR&gt;declare&lt;BR&gt;&amp;nbsp;@dataInP4 &amp;nbsp;nvarchar(50),&lt;BR&gt;&amp;nbsp;@dataOutP4&amp;nbsp;nvarchar(50)&lt;BR&gt;set @dataInP4=@dataIn+' 15:30:00'&lt;BR&gt;set @dataOutP4=@dataOut+' 15:40:00'&lt;/P&gt;
&lt;P&gt;---------------&lt;/P&gt;
&lt;P&gt;set @str='SELECT DISTINCT QASStation FROM dbo.QASLogInfo WHERE QASUserName ='''+ @QASUserName+''''&lt;BR&gt;exec dbo.OpenCursor @str,@rsCursor out&lt;BR&gt;while (1=1) begin&lt;BR&gt;&amp;nbsp;fetch next from @rsCursor into @QASStation&lt;BR&gt;&amp;nbsp;if @@fetch_status=-1 break&lt;/P&gt;
&lt;P&gt;&amp;nbsp;set @strSQL='insert into &lt;A href="mailto:'+@gTemp_table+'(QASUserName,QASStation,NumeCalc,SerialNumber"&gt;'+@gTemp_table+'(QASUserName,QASStation,NumeCalc,SerialNumber&lt;/A&gt;,&lt;BR&gt;startTime,endTime,timeInWsSeconds,TimeStation,TN_Proc)&lt;BR&gt;SELECT TbUser.QASUserName, Cycle.QASStation, ISNULL(dbo.N_CompName.Nume, ''Alte modele'') AS NumeCalc, Cycle.SerialNumber, &lt;BR&gt;&amp;nbsp;Cycle.startTime,Cycle.endTime,Cycle.timeInWsSeconds, dbo.N_QASStation.TimeStation,&lt;BR&gt;&amp;nbsp;CASE &lt;BR&gt;WHEN dbo.N_QASStation.TimeStation=0 THEN ''SERVICE'' &lt;BR&gt;WHEN dbo.N_QASStation.TimeStation&amp;lt;&amp;gt;0 and Cycle.timeInWsSeconds&amp;lt;=dbo.N_QASStation.TimeStation THEN ''OK'' &lt;BR&gt;WHEN dbo.N_QASStation.TimeStation&amp;lt;&amp;gt;0 and Cycle.timeInWsSeconds&amp;gt;dbo.N_QASStation.TimeStation&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;and (Cycle.startTime BETWEEN @dataInP1 AND @dataOutP1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;or Cycle.startTime BETWEEN @dataInP2 AND @dataOutP2&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;or Cycle.startTime BETWEEN @dataInP3 AND @dataOutP3&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;or Cycle.startTime BETWEEN @dataInP4 AND @dataOutP4&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;) THEN ''PAUSE''&lt;BR&gt;ELSE ''WRONG'' &lt;BR&gt;END AS TN_Proc &lt;BR&gt;&amp;nbsp;FROM &lt;A href="mailto:dbo.CycleTimes_'+@QASStation+'"&gt;dbo.CycleTimes_'+@QASStation+'&lt;/A&gt; Cycle INNER JOIN&lt;BR&gt;&amp;nbsp;dbo.QASLogInfo TbUser ON Cycle.QASLICounter = TbUser.QASLICounter LEFT OUTER JOIN&lt;BR&gt;&amp;nbsp;dbo.N_QASStation ON Cycle.QASStation = dbo.N_QASStation.QASStation LEFT OUTER JOIN&lt;BR&gt;&amp;nbsp;dbo.N_CompName ON STUFF(Cycle.SerialNumber, 1, 13, '''') LIKE dbo.N_CompName.Seria + ''%''&lt;BR&gt;&amp;nbsp;WHERE TbUser.QASUserName = &lt;A href="mailto:'''+@QASUserName+'''"&gt;'''+@QASUserName+'''&lt;/A&gt; and Cycle.startTime&amp;gt;= &lt;A href="mailto:'''+@dataInV+'''"&gt;'''+@dataInV+'''&lt;/A&gt; and Cycle.endTime&amp;lt;= &lt;A href="mailto:'''+@dataOutV+'''"&gt;'''+@dataOutV+'''&lt;/A&gt;&lt;BR&gt;&amp;nbsp;'&lt;BR&gt;&amp;nbsp;print @strSQL&lt;BR&gt;&amp;nbsp;exec sp_executesql @strSQL&lt;BR&gt;end&lt;BR&gt;close @rsCursor&lt;BR&gt;deallocate @rsCursor&lt;BR&gt;/*&lt;BR&gt;set @strSQL='select * from &lt;A href="mailto:'+@gTemp_table+'"&gt;'+@gTemp_table+'&lt;/A&gt; order by startTime'&lt;BR&gt;exec sp_executesql @strSQL&lt;BR&gt;*/&lt;BR&gt;return 1&lt;BR&gt;GO&lt;BR&gt;&lt;/P&gt;</description></item></channel></rss>