Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can Openrowsource() be used in a stored procedure?
Message
 
À
31/07/2006 07:26:32
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01141748
Message ID:
01141762
Vues:
20
This message has been marked as a message which has helped to the initial question of the thread.
>>>Hi,
>>> When I save a SP which includes a Openrowsource() statement like -
>>>
>>> SELECT a.* FROM
>>> OPENROWSET('MICROSOFT.JET.OLEDB.4.0',
>>> 'Text;Database=D:\textfile\;',
>>> 'SELECT * FROM [20060710000#txt]' ) a
>>>
>>>it always show me error 7405.Any advice? Tks.
>>
>>>>What happens if you execute this statement in QA/SQL Man.Stud.?
>>It's no problem executing it in QA,so i suspect if it be appliable to
>>a SP.
>
>>>What is the error 7405?
>
>Msg caption-Macrosoft SQL-DMO(ODBC SQLState-42000)
>Error:7405.Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection.This ensures consistent query semantics.
>Enable these options and then reissue your query.
>
>-I already have enabled these options in server properties,but seems no effect.Have you gotten the testing passed?


What happens if you put:
SET ANSI_NULLS    ON
SET ANSI_WARNINGS ON

SELECT a.* FROM
      OPENROWSET('MICROSOFT.JET.OLEDB.4.0',
                 'Text;Database=D:\textfile\;',
                 'SELECT * FROM [20060710000#txt]' ) a
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform