Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7402121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:39:54+00:00 2026-05-29T04:39:54+00:00

I am newbie to SQL Server Express. At the moment I am manually attaching

  • 0

I am newbie to SQL Server Express. At the moment I am manually attaching the DBs using SSMS but I need to do it through code.
I have searched a lot over internet but could not really start anything.

I know there is a sp_attach procedure but donot know how to use it and then how to call that through my application’s setup. How to use SQLDMO

Could any help be given to me please?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:39:56+00:00Added an answer on May 29, 2026 at 4:39 am

    Didiit ever occur to you to READ THE DOCUMENTATION?

    Sorry.

    I know there is a sp_attach procedure but donot know how to use it

    Lets see. Ever heard of that thing called “google”?

    http://www.google.de/search?q=sp_attachdb+sql+server&sourceid=ie7&rls=com.microsoft:en-us:IE-Address&ie=&oe=&redir_esc=&ei=0EUuT9_IMc7J8gOHpKXtDg

    “sp_attachdb sql server” has tons of links some to documentation, some to examples. You could invest more than half a second of one braincel before coming here and ask us to repro that.

    Actually the stored procedure is officially retired. Anyhow, as you dont seem to be willing to use google yourself, here is a link to the online documentation for this stored procedure:

    http://msdn.microsoft.com/en-us/library/ms179877.aspx

    See, SQL Server is a commercial product. Everything is documented. This stored procedure is on the way out, the link to the documentation has the “new alternative”.

    and then how to call that through my application’s setup.

    This is a hugh problem actually. First, you would call it like any other SQL statement. At the end, SQ LServer uses SQL which is text. The main problem is whether you should do that in the application set up or not, and how to do that within a setup. Different story – MSI files have limitations. if you are unexperienced enough to use Visual Studio setup proejcts instead of a real setup designer (read up on WIX) then you are way more limited on top.

    Database creation in the setup is complicated unless you go very basic – you do NOT create a large high performance dtabase just automatically somewhere, disc layout is planned. That said, for small stuff it is ok 😉

    At the end, you will at one point start a program setting up the database by connecting to the server and guess what – issuing SQL commands to set up the database. If you would use WIX (which is about the standard these days to make installers), then http://wix.mindcapers.com/wiki/WiX_and_SQLServer can help you getting started. The official WIX documentation also helps – I leave it to you as an exercise in using google to enter the proper terms into google.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a complete SQL Server newbie but I have experience with Oracle and
Dear All, please help me since I'm newbie in SQL Server. I have a
I'm brand new to SQL Server 2008, and have some newbie questions about the
This is sort of SQL newbie question, I think, but here goes. I have
I am a complete newbie to SSIS. I have a c#/sql server background. I
I’m a newbie in Stored Procedures in SQL Server 2005. Let’s say we have
I am using SQL SERVER 2005 and i am also newbie to SQL SERVER
Firstly I'm a complete newbie when it comes to SQL Server. I have five
I have an application which uses Sql Server Express Edition to store data. I
I am newbie in SQL Server 2008.There are three tables which I am using.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.