Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. No new tables in database after executed query

No new tables in database after executed query

Scheduled Pinned Locked Moved Database
databasesql-serversharepointsysadmintools
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 9875787
    wrote on last edited by
    #1

    Hi all. I am using Microsoft SQL Server 2008 Management Studio. I have been trying to create a database (containing tables etc) from a query file (Delivery.sql). In the Object explorer I right-clicked Database folder and created the "Delivery database". I then clicked New Query and pasted the contents of Delivery.sql (from notepad) into the new query. Now when I execute this code, it says it has completed successfully, but in the Object Explorer the "Delivery database" does not contain any tables :sigh: . I am confused and am in need of help . Thanks. Here is the image of the object explorer: http://imageshack.us/a/img694/7558/sqlobjectexplorerp.png[^] Here is the code of the query file (Delivery.sql):

    USE [Delivery database]
    GO

    /****** Object: Database [Delivery] Script Date: 05/09/2013 19:23:43 ******/
    CREATE DATABASE [Delivery] ON PRIMARY
    ( NAME = N'Delivery', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\Delivery.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
    LOG ON
    ( NAME = N'Delivery_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\Delivery_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
    GO

    ALTER DATABASE [Delivery] SET COMPATIBILITY_LEVEL = 100
    GO

    IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
    begin
    EXEC [Delivery database].[dbo].[sp_fulltext_database] @action = 'enable'
    end
    GO

    ALTER DATABASE [Delivery] SET ANSI_NULL_DEFAULT OFF
    GO

    ALTER DATABASE [Delivery] SET ANSI_NULLS OFF
    GO

    ALTER DATABASE [Delivery] SET ANSI_PADDING OFF
    GO

    ALTER DATABASE [Delivery] SET ANSI_WARNINGS OFF
    GO

    ALTER DATABASE [Delivery] SET ARITHABORT OFF
    GO

    ALTER DATABASE [Delivery] SET AUTO_CLOSE OFF
    GO

    ALTER DATABASE [Delivery] SET AUTO_CREATE_STATISTICS ON
    GO

    ALTER DATABASE [Delivery] SET AUTO_SHRINK OFF
    GO

    ALTER DATABASE [Delivery] SET AUTO_UPDATE_STATISTICS ON
    GO

    ALTER DATABASE [Delivery] SET CURSOR_CLOSE_ON_COMMIT OFF
    GO

    ALTER DATABASE [Delivery] SET CURSOR_DEFAULT GLOBAL
    GO

    ALTER DATABASE [Delivery] SET CONCAT_NULL_YIELDS_NULL OFF
    GO

    ALTER DATABASE [Delivery] SET NUMERIC_ROUNDABORT OFF
    GO

    ALTER DATABASE [Delivery] SET QUOTED_IDENTIFIER OFF
    GO

    ALTER DATABASE [Delivery] SET RECURSIVE_TRIGGERS OFF
    GO

    ALTER DA

    J 1 Reply Last reply
    0
    • U User 9875787

      Hi all. I am using Microsoft SQL Server 2008 Management Studio. I have been trying to create a database (containing tables etc) from a query file (Delivery.sql). In the Object explorer I right-clicked Database folder and created the "Delivery database". I then clicked New Query and pasted the contents of Delivery.sql (from notepad) into the new query. Now when I execute this code, it says it has completed successfully, but in the Object Explorer the "Delivery database" does not contain any tables :sigh: . I am confused and am in need of help . Thanks. Here is the image of the object explorer: http://imageshack.us/a/img694/7558/sqlobjectexplorerp.png[^] Here is the code of the query file (Delivery.sql):

      USE [Delivery database]
      GO

      /****** Object: Database [Delivery] Script Date: 05/09/2013 19:23:43 ******/
      CREATE DATABASE [Delivery] ON PRIMARY
      ( NAME = N'Delivery', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\Delivery.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
      LOG ON
      ( NAME = N'Delivery_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\Delivery_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
      GO

      ALTER DATABASE [Delivery] SET COMPATIBILITY_LEVEL = 100
      GO

      IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
      begin
      EXEC [Delivery database].[dbo].[sp_fulltext_database] @action = 'enable'
      end
      GO

      ALTER DATABASE [Delivery] SET ANSI_NULL_DEFAULT OFF
      GO

      ALTER DATABASE [Delivery] SET ANSI_NULLS OFF
      GO

      ALTER DATABASE [Delivery] SET ANSI_PADDING OFF
      GO

      ALTER DATABASE [Delivery] SET ANSI_WARNINGS OFF
      GO

      ALTER DATABASE [Delivery] SET ARITHABORT OFF
      GO

      ALTER DATABASE [Delivery] SET AUTO_CLOSE OFF
      GO

      ALTER DATABASE [Delivery] SET AUTO_CREATE_STATISTICS ON
      GO

      ALTER DATABASE [Delivery] SET AUTO_SHRINK OFF
      GO

      ALTER DATABASE [Delivery] SET AUTO_UPDATE_STATISTICS ON
      GO

      ALTER DATABASE [Delivery] SET CURSOR_CLOSE_ON_COMMIT OFF
      GO

      ALTER DATABASE [Delivery] SET CURSOR_DEFAULT GLOBAL
      GO

      ALTER DATABASE [Delivery] SET CONCAT_NULL_YIELDS_NULL OFF
      GO

      ALTER DATABASE [Delivery] SET NUMERIC_ROUNDABORT OFF
      GO

      ALTER DATABASE [Delivery] SET QUOTED_IDENTIFIER OFF
      GO

      ALTER DATABASE [Delivery] SET RECURSIVE_TRIGGERS OFF
      GO

      ALTER DA

      J Offline
      J Offline
      JammoD87
      wrote on last edited by
      #2

      Did you refresh the Object Explorer after creation?

      Personal Blog: A Software Programmer Twitter: JammoD

      U 1 Reply Last reply
      0
      • J JammoD87

        Did you refresh the Object Explorer after creation?

        Personal Blog: A Software Programmer Twitter: JammoD

        U Offline
        U Offline
        User 9875787
        wrote on last edited by
        #3

        Yeah it didnt work. However I realised that this script didnt have any code to create tables so I used a different script with "CREATE TABLE" code in the query and it worked! thanks

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups