Results 1 to 4 of 4

Thread: Unable to create table in a new database

  1. #1
    Join Date
    Dec 2008
    Posts
    2

    Unable to create table in a new database

    Hey guys,

    Hopefully there is an easy and painfully obvious answer that I've missed somewhere. I'm unable to create a table in my new database. Whenever I create a table, it seems to auto redirect to the master database not the database I created.

    Any ideas?

  2. #2
    Join Date
    Dec 2008
    Posts
    2
    Never mind,

    I dunno why it was being fussy, but after a 3rd restart and trying the same steps (right click on my database-->new query) it let me add tables.

    Stupid thing

  3. #3
    Join Date
    Sep 2002
    Posts
    5,938
    Ensure you choose right db to run the script.

  4. #4
    Join Date
    Feb 2009
    Posts
    7
    Check Sample script to create table :

    USE [DatabaseName]
    GO
    CREATE TABLE [dbo].[TableName](
    Column1 [int] ,
    Column2 [nchar](5) NULL,
    Column3 [int] NULL,
    Column4 [Varchar](50) NULL,
    Column5 [datetime] NULL,
    Column6 [datetime] NULL,
    Column7 [money] NULL,
    Column8 [nvarchar](40) NULL
    )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •