<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.dotnetzone.gr:443/cs/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>SQL Server (και άλλες databases)</title><link>https://www.dotnetzone.gr:443/cs/forums/28/ShowForum.aspx</link><description>Θέματα που αφορούν τον SQL Server (7.0, 2000, 2005) αλλά και Oracle, Access, DB2, MySQL, κλπ.</description><dc:language>el</dc:language><generator>CommunityServer 2.1 SP3 (Build: 20423.1)</generator><item><title>Απ:COM object call με TSQL</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/3948.aspx</link><pubDate>Tue, 02 Aug 2005 21:33:02 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:3948</guid><dc:creator>axaros</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/3948.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=3948</wfw:commentRss><description>&lt;P&gt;Παναγιώτη ευχαριστώ θερμά !!!&lt;/P&gt;</description></item><item><title>Απ:COM object call με TSQL</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/3947.aspx</link><pubDate>Tue, 02 Aug 2005 21:14:12 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:3947</guid><dc:creator>Παναγιώτης Καναβός</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/3947.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=3947</wfw:commentRss><description>&lt;P&gt;Γίνεται αλλά είναι φασαρία. Υπάρχει μια σειρά από stored procedures, οι sp_OACreate, sp_OADestroy, sp_OAMethod κλπ οι οποίες δημιουργούν ένα COM αντικείμενο,&amp;nbsp;επιστρέφουν ένα handle και σου επιτρέπουν να καλέσεις μεθόδους και properties δίνοντας το όνομά τους σαν string. Δες αυτό το άρθρο &lt;A href="http://www.mssqlcity.com/Articles/General/OleAutSP.htm"&gt;http://www.mssqlcity.com/Articles/General/OleAutSP.htm&lt;/A&gt;&amp;nbsp;και το κεφάλαιο &lt;FONT color=#000000&gt;"&lt;FONT size=3&gt;OLE Automation Objects &lt;/FONT&gt;&lt;FONT size=3&gt;in&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=3&gt;&lt;FONT color=#000000&gt; Transact-SQL"&amp;nbsp; στο Books Online&lt;/FONT&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Το αποτέλεσμα είναι λίγο άσχημο:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DECLARE @object int
DECLARE @hr int
DECLARE @property varchar(255)
DECLARE @return varchar(255)
DECLARE @src varchar(255), @desc varchar(255)

-- Create a SQLServer object.
SET NOCOUNT ON

-- First, create the object.
EXEC @hr = sp_OACreate 'SQLDMO.SQLServer', @object OUT
IF @hr &amp;lt;&amp;gt; 0
   -- Report the error.
   EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT 
   SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
   GOTO END_ROUTINE
ELSE
   -- An object is successfully created.
   BEGIN
      -- Set a property.
      EXEC @hr = sp_OASetProperty @object, 'HostName', 'Gizmo'
      IF @hr &amp;lt;&amp;gt; 0 GOTO CLEANUP
      
      -- Get a property using an output parameter.
      EXEC @hr = sp_OAGetProperty @object, 'HostName', @property OUT
      IF @hr &amp;lt;&amp;gt; 0 
         GOTO CLEANUP
      ELSE
         PRINT @property
      
      -- Get a property using a result set.
      EXEC @hr = sp_OAGetProperty @object, 'HostName'
      IF @hr &amp;lt;&amp;gt; 0 GOTO CLEANUP

      -- Get a property by calling the method.
      EXEC @hr = sp_OAMethod @object, 'HostName', @property OUT
      IF @hr &amp;lt;&amp;gt; 0 
         GOTO CLEANUP
      ELSE
         PRINT @property

      -- Call a method.
      -- SECURITY NOTE - When possible, use Windows Authentication.
      EXEC @hr = sp_OAMethod @object, 'Connect', NULL, 'my_server', 'my_login', 'my_password'
      IF @hr &amp;lt;&amp;gt; 0 GOTO CLEANUP
      
      -- Call a method that returns a value.
      EXEC @hr = sp_OAMethod @object, 'VerifyConnection', @return OUT
      IF @hr &amp;lt;&amp;gt; 0
         GOTO CLEANUP
      ELSE
         PRINT @return
   END

CLEANUP:
   -- Check whether an error occurred.
   IF @hr &amp;lt;&amp;gt; 0
   BEGIN
      -- Report the error.
      EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT 
      SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
   END

   -- Destroy the object.
   BEGIN
      EXEC @hr = sp_OADestroy @object
      -- Check if an error occurred.
      IF @hr &amp;lt;&amp;gt; 0 
      BEGIN
         -- Report the error.
         EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT 
         SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
      END
   END

END_ROUTINE:
RETURN
&lt;/CODE&gt;&lt;/PRE&gt;</description></item><item><title>COM object call με TSQL</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/3946.aspx</link><pubDate>Tue, 02 Aug 2005 20:59:21 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:3946</guid><dc:creator>axaros</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/3946.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=3946</wfw:commentRss><description>&lt;P&gt;Γίνεται παιδιά ;&lt;BR&gt;Και αν ναι έχετε κάποιο παράδειγμα ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item></channel></rss>