How to use sqlcmd to run my create database/tables/sp's script

  • the are .NET references, and have nothing to do with having SQL installed or not.

    you should be able to go to the project references and add them.

    ==edit whoops my bad...you do need it from SQL .==

    redownload the project. I changed the project to copy that reference locally, and it now is included in the ..bin\Debug folder.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I dont have those references available to me for some reason:crying: will do some more research and get back to you

  • Great. Thanks again. is the project attached to your previous post the updated one? Will let you know how I get along. You are a genius

  • not to worry;-) I downloaded the SMO objects from here after quite a bit of searching:

    http://www.microsoft.com/downloads/details.aspx?FamilyId=50b97994-8453-4998-8226-fa42ec403d17&displaylang=en

    Will test the code today. Had a quick look and it looks great. This is the perfect solution to my problem. You have saved me alot of time and stress Lowell. Thank you very much. god bless:-D

  • nite re-download the project one more time;

    i tested it found some bugs and missing code, this versions much better.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • awesome:Wow:. thank you. will do.

  • Hey Lowell,

    sorry to be a pain. I have a quick question. How do you deploy your application that uses this project?

    Do you only display the connection form on the very first time the app is run or do you always display it everytime the user starts the app?

    I'm thinking I should have a setting that specifies that the form to apply connection settings should be run only once. What do you think?

  • well it really depends on your application.

    if your application is a client-server kind of app, then changing the connection string would be once-at-startup, and then an on-demand situation, where the end user might switch from a test db to the live db.

    You'd want to open the connection dialog if the saved connection info was invalid, but otherwise you'd build and use a connection that you had saved, right? that was one reason i have that "MySettings" feature in it.

    if your application does nothing more than run a setup script, then you;d run the connection for every time it was executed, right? and maybe add logic to make sure they don't run in master or tempdb for example.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • thanks again for the great advise. You program is a gem. it has saved me hours of research and development and it works so well;-)

Viewing 9 posts - 16 through 23 (of 23 total)

You must be logged in to reply to this topic. Login to reply