Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Be Careful Creating Scripts
Message
De
26/04/2006 09:47:15
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01116531
Message ID:
01116639
Vues:
16
>FYI, in SQL Server 2005 SQL DMO has been replaced with SQL SMO - SQL Server Management Objects http://msdn2.microsoft.com/en-us/library/ms162169.aspx<

Hey, Sergey ... thanks for the info. Any idea how to instantiate these objects in a VFP program? The utility we currently use for maintaining our SQL Server database was a utility I wrote many years ago in VFP ... it was easy to store the script for schema changes in a VFP table, plus I knew how to use SQLDMO from VFP and, at that time, I hadn't quite learned .NET yet. It's the only VFP app we use as our main app is all .NET.

In VFP, I instantiate the DMO object like this:
LOCAL loSQLDMO AS SQLDMO.SQLServer
I've tried various combinations to try and instantiate SQLSMO, but with no luck. Any idea of the correct syntax?

~~Bonnie



>
>
>>I found what I consider to be a bug in SQL 2005's Management Studio for creating scripts.
>>
>>When you right-click on any object, say a Table, and choose "Script Table As" and choose to output the generated script to either a new Query window or a File, you will get hidden characters at the beginning. The hidden characters don't mess up the execution of the query when running it in the Management Studio, or even when running a saved file from SQL 2000's Query Analyzer.
>>
>>But, if you rely on using these scripted files in any application that makes use of SQLDMO, beware ... they won't work. The hidden characters cause your script to be unrecognizeable. I don't know if SQL 2005 has a new SQLDMO version or not (I can't find any reference to it), but this is a "gotcha" to look out for.
>>
>>The workaround is to script it to the clipboard and paste it into your Query window or file. The hidden characters don't appear then.
>>
>>Just a heads-up FYI ...
>>
>>~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform