What is the best practice when distributing a desktop application which uses SMO

I have a WPF application which installs a web site. One of the installation steps is to execute a number of SQL scripts which will install website's database. The database server is not necessarily the same machine as the product is installed - in most cases
it's a different server on the same network. All the scripts are generated by a build of database project (visual studio 2012 db project) - hence all of those are in sqlcmd mode.
I can workaround sql variables (:variable - type of creature) by making some simple text replacements. The big problem is with the "GO" statements. At first I thought that I can split the script into many subscripts using a regex split operation
defining "GO" to be the separator - this did not work; having a world Polygon in the script will cause the whole operation to fail. Unfortunately I have no control  over the content of the script hence if someone will decide
to put a comment like /* If you do not know how to use this script then GO TO HELL */ would break the installation process.
I have then tried executing the whole script (with "GO" statements) using SMO. This works well on my development machine but once I try to do this on a server, application falls over missing dlls. Now for Microsoft.SqlServer.ConnectionInfo, Microsoft.SqlServer.Smo, Microsoft.SqlServer.SqlClrProvider
and Microsoft.SqlServer.SqlEnum the solution is simple - I can just set "Copy local" to true and those dlls will be distributed with the application. 
Big problem is with Microsoft.SqlServer.SqlClrProvider.dll. OK, I can get this library from my local machine - but I am not sure which SQL version this will be used with. I can't include more than one of those dlls as all of those have the same name. 
I know that the official MS line is to install SQL feature pack (http://msdn.microsoft.com/en-us/library/ff713979.aspx). But again - I do not know which version of SQL my application will be working with, and I need to make the installation process as simple
as possible. 
My question is - is there a way I can distribute a desktop application (which makes a use of SMO) without any prerequisites and for all versions of SQL server? If there is no such a thing then using SMO is pretty much pointless as it cannot be distribute
- even if then it's not version agnostic... Thanks for any help! 

I agree with Olaf, when you want to ensure that you can interact with any version of SQL Server.
The problem you will run into if you are not controlling the version of SQL Server is in the version of SMO. If you use SMO version 10.5 and need to deploy using SMO to SQL 2012, it will not work. SMO will always be backward compatible but not forward compatible.
So you would have to have a max version of SQL Server your setup would deploy to in order to control errors and failures. So if you distribute SQL 2012 SMO then the max version would be SQL 2012 for the deploy.
So using a tool that is version agnostic is the way to go, and you can also use in .NET the System.Data.SqlClient to execute statements against the SQL Server as well. This will be version agnostic too.
Ben Miller - SQL Server MVP, SQL MCM 2008 - @DBADuck http://www.dbaduck.com

Similar Messages

  • What is the best practice to get thumbnail of photo which I get from cameraUI

    Hi,
    I building a photo sharing application in android and I want to upload a smaller size of photo just after I receive the photo from the cameraUI.
    What is the best practice to resize the photo and to upload it, At the moment I doesn't resize it And the file size is big (1MB) for HTC DESIRE HD ?
    Is it possible to resize the image and keep the EXIF data ?
    Thanks,
    Nimrod.

    Yep,
    Media Manager is the way to go.
    Read the manual aout it.
    It is all explained in there.
    Rienk

  • What is the best practice when any of Src/Tgt DB is re-started in streams

    We have a live production dual direction streams environment (A --> B and B --> A) and due to a DBFcorrupt file at source A, it was brought down and all traffic was switched to B. All streams captures,prop and apply were enabled and messages were captured at B and propagated to A (but cannot reach A and apply there as it was down) .When A is re-started, some of the captured messages in B never got applied to A. What could be the possible reason. What is a best practice in a streams environment when any of the source/target instance is shutdown and re-started.

    Hi Serge,
    A specific data file got corrupted and they restored it. Can you please send me the URL for the metalink document about that bug in 9.2. I'd really appreciate your help on this.
    Thx,
    Amal

  • What is the best way to distribute your swing application:

    I have developed a application that connects to data base and it containes the functionality to manage the invoices and receipts system, but i am scare to distribute it by building it to jar using the netbeans build option , it runs fine but when i extract the jar file back i m scare that any one can easily decompile it using JAD and get the database credentials , please tell me the best way to distribute the application so that reverse engineering the application will not be possible please tell me that :(

    Decompiling is unnecessary. All somebody would have to do would be to sniff the transmissions between your application and your database; the credentials are sent unencrypted.
    So the problem is not that somebody could find out the database credentials, the problem is that your database exposes itself to the internet. And if anybody does find the credentials through any method at all, then you've got a problem.
    And by the way if you distribute your application with the credentials hard-coded, then that makes it difficult for you to change the password if it does get compromised, because then nobody can use your application any more. This is a bad thing because one of the first things you should do when your system is compromised is to change the access password.
    So really the best way to distribute this application would be to write it so that it connects to an application which runs on your server. This server application would communicate with the database, which would make it unnecessary for the database to be visible from the internet. Your Swing application would communicate with the server application via some kind of web service protocol.

  • PHP 5.6.8 to 5.5.x. What is the best practice when trying to do so?

    Hi everyone,
    I've been using Arch for a while and I really try hard to really keep it simple.
    Most of the time I'm able to do so, but right now I'm not sure what should I do.
    I have LAMP stack installed using PHP 5.6.8.
    What I don't like about it is that most of rolling release linux distributions just don't care about the fact that most of PHP software (unless it is very simple) will break due poor backward compatibility of PHP itself.
    Ideally, distribution should pack all currently developed versions of such software as PHP (5.6/5.5/5.4) is, but this is not the case....
    So, basicaly I can't run Magento on it.
    I have been investigating my options and I ended up here:
    https://wiki.archlinux.org/index.php/Ar … ck_Machine
    It seems that it expects me to have old version in pacman cache which i don't have (I have been using vagrant with virtualbox before).
    Also, it seems that I could install it from AUR, but I can't find 5.5.x package.
    So, what can i do?
    It seems that there is no Arch setup capable of running Magento at this point?
    Is it really my only option to do everything from scratch?
    Sorry, if I'm missing something obvious.

    Hi everyone,
    I've been using Arch for a while and I really try hard to really keep it simple.
    Most of the time I'm able to do so, but right now I'm not sure what should I do.
    I have LAMP stack installed using PHP 5.6.8.
    What I don't like about it is that most of rolling release linux distributions just don't care about the fact that most of PHP software (unless it is very simple) will break due poor backward compatibility of PHP itself.
    Ideally, distribution should pack all currently developed versions of such software as PHP (5.6/5.5/5.4) is, but this is not the case....
    So, basicaly I can't run Magento on it.
    I have been investigating my options and I ended up here:
    https://wiki.archlinux.org/index.php/Ar … ck_Machine
    It seems that it expects me to have old version in pacman cache which i don't have (I have been using vagrant with virtualbox before).
    Also, it seems that I could install it from AUR, but I can't find 5.5.x package.
    So, what can i do?
    It seems that there is no Arch setup capable of running Magento at this point?
    Is it really my only option to do everything from scratch?
    Sorry, if I'm missing something obvious.

  • What is the best practice for formatting ext drives to be used by both Mac and PC users?

    I have scanned what is available in the community about this issue and wondering if anyone has anything new to add.  I need to create backup drives of department files (large photo and video) that both we Mac and the other PC users can access.  The only consistent rec I see is FAT32, but that seems to have size limitations.  Any other suggestions?  Thanks.

    The problem with FAT32 is that 4 GB or bigger files can't be stored. In this case, and as you have a Mac OS X version that supports it (10.6.5), you can use exFAT, compatible with Windows XP, Vista, 7, 8 and Mac OS X (10.6.5 and later).
    To format a drive with exFAT, do this on a PC. If you do it on a Mac, a PC won't be able to read it. Apart from this, you will be able to store the files you need onto external drives, as exFAT hasn't got the limitations that FAT32 has.
    Another option is to use NTFS, but you will need a third-party application on your Mac to be able to write on your external drives

  • What is the best practice to roll out ApEx to production?

    Hi,
    My first ApEx application :) What is the best practice to deploy an ApEx application to production?
    Also, I created end users account and use the end user's accountsto log in to ApEx via URL (http://xxx.xxx.xxx:8080/apex/f?p=111:1). However, how come sometimes it's still in development mode (ie: with the Home|Application#|Edit Page#|Create|Session|... ) tool bar showing up at the bottom, but sometimes not?
    Thanks much :)
    Helen

    When you setup your users, make sure the radio button for both workspace admin and developer are set to No. This should make them an "end user" and they should not see the links. Only developers and workspace admins can see it.

  • What is the best practice for BADI?

    Hi all, this is my first post.
    I've seen many BADI examples here at SDN and elsewhere where after defining the badi at SE18, and the implementation at SE19, you just create a Z program and call the badi and its method. No brainer. I know how to use the new badi of 'get badi' and 'call badi' instead of the classic exit handler. So I do know how to call a badi properly, in a Z program.
    However, SAP's intention of BADI is to replace the traditional user exit. My question is how do you guys use badi in replacement of user exit?
    User exits have 'call customer-functions' where you put your code in the Z includes, without touching standard SAP programs. Where/how do i link standard programs to call my badi? Even if I implement a standard bapi, my implementation is a Z. And a standard bapi and its methods are, well, standard. How do I call the Z stuff.
    1. If using cmod, call customer-function and the z include to call my badi and method, how does that replace user exit if I'm still using cmod???
    2. I've seen people add includes in a standard function-pool. The Z include calls the badi. But doing so is a modification, which I thought is to be avoided.
    So my question is what is the best practice out there, how do you guys use badi for enhancement in replacement of user exit? In combination of cmod, adding includes in standard programs, other methods?

    Hi Shawn,
    Welcome to SDN
    First thing, you got the whole concept of BADI partially wrong.
    BADI are like user-exits only and the difference is it uses ABAP OO an some more functionalities.
    As you find in the code CALL CUSTOMER FUNCTION, the same way there are exit handlers for BADI.
    User Exits are not completely removed. They are still there and will be there. Its just the extra flexibility with BADI.
    Regards,
    Atish

  • When displaying just One WDiView in the Portal what is the best practice?

    Hi,
    I´m configuring some Roles to display WebDynpro iViews and I´m concerned because when a page has to display just one iView I don´t create the Page but instead I call the iView directly into the Role and the Displayed iView is viewed correctly, my concern began cause I´m checking SAP standard roles, WDiviews and WDPages and eventhough there is just one WDiView to be displayed a WDPage is been created to display it and the WD page id assigned to the Role.
    Does anyone knows what is the best practice in this case?
    Thanx in Advanced and Kind Regards,
    Gerardo J

    there is no harm in assigning iview directly to a role but usually assigning to a page ,page to a workset and workset to a role is followed universally

  • What is the best practice in securing deployed source files

    hi guys,
    Just yesterday, I developed a simple image cropper using ajax
    and flash. After compiling the package, I notice the
    package/installer delivers the same exact source files as in
    developed to the installed folder.
    This doesnt concern me much at first, but coming to think of
    it. This question keeps coming out of my head.
    "What is the best practice in securing deployed source
    files?"
    How do we secure application installed source files from
    being tampered. Especially, when it comes to tampering of the
    source files after it's been installed. E.g. modifying spraydata.js
    files for example can be done easily with an editor.

    Hi,
    You could compute a SHA or MD5 hash of your source files on
    first run and save these hashes to EncryptedLocalStore.
    On startup, recompute and verify. (This, of course, fails to
    address when the main app's swf / swc / html itself is
    decompiled)

  • What is the best practice to display info of completed task in process flow

    Hi all,
    I'm starting to study BPM modeling with CE7.1 EHP1. Thanks to the tutorial and example on SDN site and I can easily build my own process in NWDS and deploy to server, start it, finish it.
    I like the new runtime which can show a BPMN diagram to the processors. However, I can't find a way to let the follow up processor to review the task result completed in previous step. I'm more familiar with Guided Procedure, and know there is "Display Callable Object" which can used to show some info of a completed task when the processor/owner/admin/overseer click on a completed task.  Where is the feature in BPM ? What is the best practice to show such task information in BPM environment.
    For example, A multiple level approval process, the higher level approver need to know the comment written by the previous approver. Can he read this information from process flow ?
    I think it is very important feature for a BPM platform. In Guided Procedure, such requirement can be done with Display Callable Object + View Permission, and you just need some coding for the UI. If BPM is superior to GP, I think there must be a way to achieve this, I just do not know how ?
    Can anyone shed me some light on it ?

    Oliver,
    Thanks for your quick reply.
    Yes, Notes and Attachment CAN BE USED for the purpose. But I'm still looking for a more elegant solution.
    With the solution of using Notes/Attachment, the processor need to give input at two places : the task UI and Note/Attach , with similar or same data. It is really annoying.
    Is there any SAP BPM real-world deployment ? None of customer has the requirement ?

  • Database Log File becomes very big, What's the best practice to handle it?

    The log of my production Database is getting very big, and the harddisk is almost full, I am pretty new to SAP, but familiar with SQL Server, if anybody can give me advice on what's the best practice to handle this issue.
    Should I Shrink the Database?
    I know increase hard disk is need for long term .
    Thanks in advance.

    Hi Finke,
    Usually the log file fills up and grow huge, due to not having regular transaction log backups. If you database is in FULL recovery mode, every transaction is logged in Transaction file, and it gets cleared when you take a log backup. If it is a production system and if you don't have regular transaction log backups, the problem is just sitting there to explode, when you need a point in time restore. Please check you backup/restore strategy.
    Follow these steps to get transactional file back in normal shape:
    1.) Take a transactional backup.
    2.) shrink log file. ( DBCC shrinkfile('logfilename',10240)
          The above command will shrink the file to 10 GB.(recommended size for high transactional systems)
    >
    Finke Xie wrote:
    > Should I Shrink the Database? .
    "NEVER SHRINK DATA FILES", shrink only log file
    3.) Schedule log backups every 15 minutes.
    Thanks
    Mush

  • What are the best practices for generating an EPS logo from InDesign?

    Our costomer is running into technical issues with the logo we sent them, which was exported from Indesign. Images were not embedded and fonts missing. I was able to embed the images and fonts. However, we DO NOT want them to be able to make any text changes. So after exporting an eps, I opened the file in Adobe Illustrator and made all the text outlines. I hope this works. But I just wanted to post the question on what are the best practices for doing this?
    The client needs the logo with transparent background, images emebdded and type in outlines. Also, they need some space around the text. When I exported the eps, the file is right up on the edge of the type.

    It sounds like you are pretty far from "best practice" with regard to logo design and delivery.
    These days, the very use of the EPS format should be considered bad practice, and some other terms in your post, (i.e., 'images,' 'missing fonts'), make it sound like there is not a seasoned logo designer involved.
    That said, you probably already got the advice you need to get out of the immediate jam. However, without proper logo design, you and the client will soon be facing other problems. You should be delivering a 100% vector graphic in single-color (black) and corporate-color(s) versions, with no live font data, that has been test-scaled to very small and very large sizes; ensuring it will work at postage-stamp size and on the side of a truck or building, with specific spot color(s) and proportions that will enable it to be offset printed, embroidered and screen-printed on apparel, and cut into signage materials and decals.

  • What is the best practice to perform DB Backup on Sun Cluster using OSB

    I have a query on OSB 10.4.
    I want to configure OSB 10.4 on 2 Node Sun Cluster where the oracle database is running.
    When im performing DB backup, my DB backup job should not get failed if my node1 fails. What is the best practice to achieve this?

    Hi,
    Each Host that participates in an OSB administrative domain must also have some pre-configured way to resolve a host name to an IP address.Use DNS, NIS etc to do this.
    Specify cluster IP in OSB, so that OSB always looks for Cluster IP only instead of physical IPs of each node.
    Explanation :
    If it is 2-Node OR 4-Node, when Cluster software installed in these nodes we have to configure Cluster IP so that when one node fails Cluster IP will automatically move to the another node.
    This cluster IP we have to specify whether it is RMAN backup or Application JDBC connection. Failing to second node/another Node is the job of Cluster IP. So wherever we install cluster configuration we have to specify in all the failover places specify CLUSTER IP.
    Hope it helps..
    Thanks
    LaserSoft

  • What are the best practice for CQ5.5 configuration?

    Hello,
    What are the best practice for CQ5.5 configuration which handle for High availability.
    Last time I had a issues on server when I was uploaded 2 GB of DAM and then after that the server is not able to start and always getting error regarding Tar Persistance.
    So kindly request you to please let me know what are the best apache felix configuration.
    Thanks in advance...
    Regards,
    Satish

    Hi,
    A DAM upload, regardless of the size of the assets, never should result in TarPM problems, unless you run into an OOM, which left the repository in an unclean state. So if you regularly do DAM uploads of that size, you should check the Garbage Collection logs and probably adjust the heapsize if necessary. You might want to limit the number of concurrent running workflows to keep the memory consumption a bit lower.
    To your question: HA in a traditional sense you cannot achieve with a single box, even with optimized settings. In an author usecase you would need clustering.
    Jörg

Maybe you are looking for

  • My Iomega external HDD can no longer be read by my Macbook Pro *Please Help*

    The day before my problem began my external was working fine then the next day I plugged it into my mac and now it can't be read. I get a message that says it can't be read with the options to eject, ignore, and initialize. When I click initialize it

  • Copy of Material Master charac. values to the batch classif. in GR for PO

    Dear gurus, Could you please help me with the following issue. I have a material managed in batches, and it has a classification type 023 in material master. I fill one chaacteristic of this classification with some value. Now I want this value to be

  • Scheduling

    Hi experts, see, we use to manually open and close the posting periods but now my client wants it to be automised one .And i went through sm36 and while feeding data there is one field asking the programe name for it to schedule .. as per transaction

  • Change Color of Dates in Calendar

    This is a follow-up question to the following thread: http://discussions.apple.com/thread.jspa?threadID=1175451&tstart=208 The original question from that thread was never answered and I was having the same problem. Some of the big number dates in my

  • Payment method not found

    Hello, I am trying to post a payment to a Vendor and payee is set up different then the supplier.  I checked the data  - seems to be allright but am not able to post the payment  with error 'Payment method not found'.  Payment method has been defined