none
DDL statement is not allowed. (Microsoft SQL Server. Error: 33003) RRS feed

  • 問題

  • Hi,

    My Server is MS SBS Prem 2008 and SQL 2008. When I create the table for new database and it show the error message: DDL statement is not allowed. (Microsoft SQL Server. Error: 33003).

    I think that the proble is on the pipe that I used:
    Server name: \\.\pipe\mssql$microsoft##ssee\sql\query to login to " SQL Server Management Studio"

    How can I fix the problem?

    Thanks for help !

    2009年6月1日 7:07

解答

  • Although you can create databases and drop objects, the super-secure mechanism to stop you using it for your own purposes is that you can't create objects (tables, stored procs, etc). What you get is:

        Msg 33003, Level 16, State 1, Line 1
        DDL statement is not allowed.

    The workaround for the above is to put the database in single user mode while you're doing the DDL:

    -- before
    alter database banana set single_user;
    go

    -- create whatever
    if object_id( 'bob' ) is not null
     drop table bob;

    create table bob (x int );
    go

    -- after
    alter database banana set multi_user;
    go

    2009年6月2日 6:41

所有回覆

  • How did you create table? In gui or with sql statement?
    2009年6月1日 19:22
  • In GUI
    2009年6月2日 3:52
  • Click save the table. Showing the error "DDL statement is not allowed. (Microsoft SQL Server. Error: 33003)."

    2009年6月2日 4:23
  • Although you can create databases and drop objects, the super-secure mechanism to stop you using it for your own purposes is that you can't create objects (tables, stored procs, etc). What you get is:

        Msg 33003, Level 16, State 1, Line 1
        DDL statement is not allowed.

    The workaround for the above is to put the database in single user mode while you're doing the DDL:

    -- before
    alter database banana set single_user;
    go

    -- create whatever
    if object_id( 'bob' ) is not null
     drop table bob;

    create table bob (x int );
    go

    -- after
    alter database banana set multi_user;
    go

    2009年6月2日 6:41
  • Are you trying to connect to your instance of SQL Server 2008?




    You cannot connect to your instance of SQL Server 2008 by using the connection string  \\.\pipe\mssql$microsoft##ssee\sql\query 

    May I know the reason of why you are trying to use the connection string  \\.\pipe\mssql$microsoft##ssee\sql\query  to connect to the Windows Internal Database?
    Martin Poon [MVP - SQL Server]
    2009年6月5日 5:41
  • Great KenLin, your solution worked perfectly. My case was a development environment installation of SharePoint 2010 as standalone, which uses an internal database, hence the restriction and the connection string  \\.\pipe\mssql$microsoft##ssee\sql\query

    2013年2月6日 13:12