About 546,000 results
Open links in new tab
  1. sql server - Create SQL script that create database and tables

    In SQL Server Management Studio you can right click on the database you want to replicate, and select "Script Database as" to have the tool create the appropriate SQL file to replicate that database on another server. You can repeat this process for each table you want to create, and then merge the files into a single SQL file.

  2. use SQL script to create SQL server DB - Stack Overflow

    Feb 4, 2013 · I have a very basic question about SQL server and Visual Studio 2010. I'm currently reading the book "C# 3.0 Unleashed with the .NET framework 3.5". I'm at the chapter where LINQ to SQL is explained. The writer asks to create a new database and use his script (given in the book) to create the tables and fill these with some data.

  3. Script entire database SQL-Server - Stack Overflow

    Jul 22, 2009 · If you need to do it programmatically, you can use the SQL DMO library (OLE) against SQL Server 2000, but more likely you may wish to use the SQL SMO library (native .NET libraries) against SQL Server 2005 and later. Both these libraries are integral to the SQL Server administrative tools install.

  4. database - Generate script in SQL Server Management Studio

    Feb 24, 2012 · Here You can see step by step process of Generate script in SQL Server Management Studio : Step 1: Right Click on Your Database --> Select Task-->Generate Script.. Step 2: Select Next in Script Wizard. Step 3: Select Script Entire Database. Step 4:Choose Your File Name. and Finish. Now you can use your script file.

  5. sql server - How to use sqlcmd to create a database - Stack Overflow

    Jan 1, 2012 · Use @Jeremiah Peschka's answer to supply the sqlcmd utility with the script to execute.. As for the location for the newly created database, it can be specified as part of the CREATE DATABASE command:

  6. sql server - How can I generate a script of my database as it is ...

    Mar 29, 2011 · In SQL Server Management Studio I am able to generate a create script which creates the database but it doesn't contain any test data. Ideally when the script is run it should DROP the existing database (assuming it already exists) and then recreating it using this new script containing schema changes and test data from my development machine.

  7. SQL Server Script to create a new user - Stack Overflow

    May 28, 2017 · Stop the MSSQL service. Open a Command Prompt using Run As Administrator. Change to the folder that holds the SQL Server EXE file; the default for SQL Server 2014 is “C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Binn”. Run the following command: “sqlservr.exe –m”. This will start SQL Server in single-user mode.

  8. sql server - Create database using script at the default path?

    I've generated a script of a database in SQL Server 2008. The generated script has the hardcoded path of where the database would be created. I don't want this path to be hardcoded, I want this path to use the default of the database engine the script is running on. Here is the small portion of the script:

  9. sql server - Create a database using T SQL on a specified location ...

    Jan 9, 2017 · Using variables in Studio Manager expanding on the previous examples. Create folders and subfolders. Example: root folder E:\MSSQL\DATA subfolders E:\MSSQL\DATA\DB and E:\MSSQL\DATA\Logs.

  10. sql - Create database if db does not exist - Stack Overflow

    Jan 8, 2020 · I want to make SQL Server script for creating database if it does not exist. ... BEGIN CREATE DATABASE ...

Refresh