<?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: sqlcmd - optiuni</title><link>http://sqlserver.ro/forums/thread/7007.aspx</link><pubDate>Thu, 02 Apr 2009 06:22:53 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:7007</guid><dc:creator>hyghnet</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/7007.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=7007</wfw:commentRss><description>&lt;P&gt;Revin, doram sa fac un singur fisier fara optiunea sqlcmd -i, cu fisier de intrare&amp;nbsp;functioneaza.&lt;/P&gt;
&lt;P&gt;Insa am incercat asa:&lt;/P&gt;
&lt;P&gt;sqlcmd -Q "use test select b.id_document from dosar a&amp;nbsp; inner join v_Document b on a.id_dosar=b.id_dosar where b.tipdocument like &lt;STRONG&gt;&lt;FONT color=#ff0000&gt;'%%hot%%'&lt;/FONT&gt;&lt;/STRONG&gt;"&lt;/P&gt;
&lt;P&gt;si a functionat, nu stiu cum dar asa merge.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Re: sqlcmd - optiuni</title><link>http://sqlserver.ro/forums/thread/7006.aspx</link><pubDate>Thu, 02 Apr 2009 05:49:18 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:7006</guid><dc:creator>ignatandrei</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/7006.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=7006</wfw:commentRss><description>incearca sa folosesti -i fisier si in fisier sa pui comanda.&lt;br&gt;</description></item><item><title>Re: sqlcmd - optiuni</title><link>http://sqlserver.ro/forums/thread/7005.aspx</link><pubDate>Thu, 02 Apr 2009 05:46:39 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:7005</guid><dc:creator>B_gd_n[ ]Sahlean</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/7005.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=7005</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;hyghnet:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;Cred ca am descoperit problema, insa nu stiu cum sa o rezolv.&lt;/p&gt;
&lt;p&gt;Problema este ca '%' este interpretat altfel in comand prompt ca pentru variabile locale. &lt;/p&gt;
&lt;p&gt;Ar trebui sa evit folosirea LIKE si a %.&lt;/p&gt;
&lt;p&gt;Sau daca are cineva idee ar fi super.&lt;/p&gt;
&lt;p&gt;Multumesc inca o data.&lt;/p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;br&gt;Încearcă atunci să foloseşti codul ASCII 37 (%) şi funcţia CHAR:&lt;br&gt;SELECT ... FROM ... WHERE camp LIKE 'a' + CHAR(37) + 'b' ...&lt;br&gt;</description></item><item><title>Re: sqlcmd - optiuni</title><link>http://sqlserver.ro/forums/thread/7004.aspx</link><pubDate>Thu, 02 Apr 2009 05:38:59 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:7004</guid><dc:creator>hyghnet</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/7004.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=7004</wfw:commentRss><description>&lt;P&gt;Cred ca am descoperit problema, insa nu stiu cum sa o rezolv.&lt;/P&gt;
&lt;P&gt;Problema este ca '%' este interpretat altfel in comand prompt ca pentru variabile locale. &lt;/P&gt;
&lt;P&gt;Ar trebui sa evit folosirea LIKE si a %.&lt;/P&gt;
&lt;P&gt;Sau daca are cineva idee ar fi super.&lt;/P&gt;
&lt;P&gt;Multumesc inca o data.&lt;/P&gt;</description></item><item><title>Re: sqlcmd - optiuni</title><link>http://sqlserver.ro/forums/thread/7000.aspx</link><pubDate>Wed, 01 Apr 2009 06:14:11 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:7000</guid><dc:creator>rsocol</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/7000.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=7000</wfw:commentRss><description>Cumva tipdocument este null ? &amp;#206;ncearcă:&lt;br /&gt;&lt;br /&gt;sqlcmd -Q "use test select b.id_document, b.tipdocument from dosar a  inner join v_Document b on a.id_dosar=b.id_dosar"&lt;br /&gt;&lt;br /&gt;Răzvan</description></item><item><title>Re: sqlcmd - optiuni</title><link>http://sqlserver.ro/forums/thread/6997.aspx</link><pubDate>Tue, 31 Mar 2009 06:42:45 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:6997</guid><dc:creator>ignatandrei</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/6997.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=6997</wfw:commentRss><description>nu reusesc sa inteleg de ce ... mai incearca &lt;br&gt;&lt;br&gt;where cast(b.tipdocument as varchar) like '%' &lt;br&gt;&lt;br&gt;</description></item><item><title>Re: sqlcmd - optiuni</title><link>http://sqlserver.ro/forums/thread/6994.aspx</link><pubDate>Tue, 31 Mar 2009 04:32:31 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:6994</guid><dc:creator>hyghnet</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/6994.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=6994</wfw:commentRss><description>&lt;P&gt;Am utilizat comanda astfel, fara echo off&lt;/P&gt;
&lt;P&gt;sqlcmd -Q "use test select b.id_document from dosar a&amp;nbsp; inner join v_Document b on a.id_dosar=b.id_dosar where b.tipdocument like '%' "&lt;/P&gt;
&lt;P&gt;si rezultatul a fost:&lt;/P&gt;
&lt;P&gt;C:\Documents and Settings\..&amp;gt;sqlcmd -Q "use test select b.id_document from dosar a&amp;nbsp; inner join v_Document b on a.id_dosar=b.id_dosar where b.tipdocument like '%' "&lt;/P&gt;
&lt;P&gt;Changed database context to 'test_tril'.&lt;BR&gt;id_document&lt;BR&gt;--------------------&lt;/P&gt;
&lt;P&gt;(0 rows affected)&lt;/P&gt;
&lt;P&gt;Lansata: sqlcmd -Q "use test select b.id_document from dosar a&amp;nbsp; inner join v_Document b on a.id_dosar=b.id_dosar"&lt;/P&gt;
&lt;P&gt;afiseaza&lt;/P&gt;
&lt;P&gt;Changed database context to 'test_tril'.&lt;BR&gt;id_document&lt;BR&gt;--------------------&lt;/P&gt;
&lt;P&gt;180&lt;/P&gt;
&lt;P&gt;190&lt;/P&gt;
&lt;P&gt;210&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;(160 rows affected)&lt;/P&gt;
&lt;P&gt;Multumesc.&lt;/P&gt;</description></item><item><title>Re: sqlcmd - optiuni</title><link>http://sqlserver.ro/forums/thread/6984.aspx</link><pubDate>Mon, 30 Mar 2009 10:48:07 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:6984</guid><dc:creator>ignatandrei</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/6984.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=6984</wfw:commentRss><description>incearca si&lt;br&gt;sqlcmd -Q "use test select b.id_document from dosar a&amp;nbsp; inner join
v_Document b on a.id_dosar=b.id_dosar where b.tipdocument like '%' "&lt;br&gt;&lt;br&gt;sqlcmd stie clause...&lt;br&gt;&lt;br&gt;&lt;br&gt;obs 1. vezi si cum ai quoted identifiers &lt;br&gt;&lt;pre class="libCScode" style="white-space:pre-wrap;" id="ctl00_rs1_mainContentContainer_ctl06other"&gt;SET QUOTED_IDENTIFIER { ON | OFF }&lt;br&gt;http://msdn.microsoft.com/en-us/library/ms174393.aspx&lt;br&gt;&lt;br&gt;obs 2.&lt;br&gt;scoate echo off ... sa vedem daca si ce mesaje mai da...&lt;br&gt;&lt;/pre&gt;</description></item><item><title>sqlcmd - optiuni</title><link>http://sqlserver.ro/forums/thread/6982.aspx</link><pubDate>Mon, 30 Mar 2009 09:54:44 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:6982</guid><dc:creator>hyghnet</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/6982.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=6982</wfw:commentRss><description>&lt;P&gt;Salut tuturor&lt;/P&gt;
&lt;P&gt;vreau sa folosesc sqlcmd intr-un script, pentru a popula un fisier txt. &lt;/P&gt;
&lt;P&gt;Serverul este SQL -2005 local, iar autentificarea se face de windows.&lt;/P&gt;
&lt;P&gt;Am ceva de genul : &lt;/P&gt;
&lt;P&gt;@echo off&lt;/P&gt;
&lt;P&gt;sqlcmd -Q "use test select b.id_document from dosar a&amp;nbsp; inner join v_Document b on a.id_dosar=b.id_dosar where b.tipdocument like '%hot%'"&lt;/P&gt;
&lt;P&gt;pause&lt;/P&gt;
&lt;P&gt;Daca lansez sub aceasat forma nu imi afiseza nimic, 0(rows) afected - ca si cum nu ar exista nicio inregistrare care sa se incadreze, insa exista ca daca fac interogarea din Query imi apar informatiile.&lt;/P&gt;
&lt;P&gt;Daca lansez sub forma&lt;/P&gt;
&lt;P&gt;@echo off&lt;/P&gt;
&lt;P&gt;sqlcmd -Q "use test select b.id_document from dosar a&amp;nbsp; inner join v_Document b on a.id_dosar=b.id_dosar "&lt;/P&gt;
&lt;P&gt;pause&lt;/P&gt;
&lt;P&gt;Deci fara clauza WHERE informatiile apar.&lt;/P&gt;
&lt;P&gt;Acum nu stiu acesta comanda sqlcmd -Q nu poate include si clauze sau fac eu vreo greseala.&lt;/P&gt;
&lt;P&gt;Multumesc mult.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item></channel></rss>