Error and Warning Groups

One of the things we did at the end of the product cycle, when we decided that we need to allow you to filter out warnings, is to clean up all error and warning messages and concisely group them in to specific buckets. Understanding these buckets will go a long way helping you interpret the cause of the warnings and errors.

Error & Warning Message Grouping

  • TSD1xxx – Phase 1 parsing / interpretation
  • TSD2xxx – Phase 2 parsing
  • TSD3xxx – Phase 2 interpretation
  • TSD4xxx – SQL Execution / Compile Validation
  • TSD5xxx – Reserved for future release
  • TSD6xxx – Reserved for future release
  • TSD7xxx – Project system
  • TSD8xxx – Build
  • TSD9xxx – Document based (non-persistent)

Lets look at some of the categories and some examples:

TSD1xxx – Warning Messages

  • TSD1002 – File contains more than one DDL definition
    • The .sql file contains more than one data definition language (DDL) statement. Remove any additional statements, and retry the operation.
  • TSD1026 – Batch Parser Error
  • TSD1030 - Phase1 Parsing Failed
    • Unable to identify the schema type contained in the .sql file. A schema type of ‘{0}’ was expected, based on the name of the .sql file.

TSD2xxx – Warning Messages

Phase 2 parsing errors, are always syntax related!

  • TSD2001 – TSD2038
    • Wrong syntax in the file
    • TSD20xx where xx = the parser error code

TSD3xxx – Warning Messages

  • TSD3006 – Ambiguous Relationship
    • The relationship from {referencing object} cannot be resolved between the following possible identifiers: {list of options}

    • Example:

      CREATE TABLE t1 (int c1, int c2)
      CREATE TABLE t2 (int c1, int c2)
      CREATE VIEW v1 AS SELECT c1 FROM t1,t2

  • TSD3007 – Invalid Supporting Statement
    • Invalid supporting statement for {identifier}: {text}

    • Example:

      CREATE TABLE t1(c1 int);
      go
      kkkk

  • TSD3008 – Main Batch Has Top Level DML Statement
    • The main batch can not have a top level data manipulation language (DML) statement. Please remove that statement and retry the operation

    • Example:

      CREATE TABLE T1(c1 int);
      INSERT INTO t1 VALUES(10);

  • TSD3009 – Create Assembly From Non Binary
    • CREATE ASSEMBLY statement can only have binary elements in its FROM clause.

    • Example:

      CREATE ASSEMBLY [Assembly1] FROM N'C:\MyAssemblies\SQLCLR.DLL' WITH PERMISSION_SET = SAFE;

  • TSD3010 – No Valid DDL Found
    • Unable to find a valid schema object identifier in the file. Check the syntax of the DDL statement or make sure the file is not empty

    • Example:

      CREATE ASSEMBLY

  • TSD3011 – Dangling Compile Time Dependency Missing
    • The following dependencies of {referencing object id} are missing from your database project: {list}. You will not be able to deploy the project
  • TSD3012 – Dangling Runtime Dependency Missing
    • The following dependencies are missing from your database project: {list}. Your database application might fail at runtime when {referencing object id} is executed

    • Example:

      CREATE PROCEDURE proc1
      AS
      SELECT * FROM RandomTable;
      RETURN 0;

  • TSD3014 – Constraints In Alter Table Must Have Name
    • Constraints defined in an 'ALTER TABLE' or 'CREATE TABLE' -statement must have a name.

    • Example:

      ALTER TABLE [dbo].[Table1] ADD CONSTRAINT PRIMARY KEY (c1)

  • TSD3018 – Incomplete Drop Statistics Statement
    • The DROP STATISTICS statement requires [schema_name.]table_name.statistics_name

    • Example:

      DROP STATISTICS s1

  • TSD3020 – Database Name Is Invalid
    • The database name is invalid. You must use the substitute value [$(databasename)].
  • TSD3021 – External Server Dangling Compile Time Dependency Missing
    • The following cross-server dependencies of {referencing object} could not be verified: {list}. You might not be able to deploy the project

    • Example:

      CREATE VIEW v1 AS
      SELECT * FROM aaa.zzz.yyy.xxx;

  • TSD3022 – External Server Dangling Runtime Dependency Missing
    • The following cross-server dependencies could not be verified: {list}. Your database application might fail at runtime when {referencing object} is executed.

    • Example:

      CREATE PROC proc1 AS
      SELECT * FROM tsdhost.zzz.db1.t1;
      RETURN 0;

  • TSD3023 – At Most Two Part Name
    • When you create an object of this type in a database project, the object’s name must contain no more than two parts.

    • Example:

      CREATE VIEW bbb.aaa.v1 AS
      SELECT * FROM t1;

  • TSD3024 – External Database Dangling Compile Time Dependency Missing
    • The following cross-database dependencies of {referencing object} could not be verified: {list}. You might not be able to deploy the project.

    • Example:

      CREATE VIEW View1 AS
      SELECT * FROM zzz.yyy.xxx;

  • TSD3025 – External Database Dangling Runtime Dependency Missing
    • The following cross-database dependencies could not be verified: {list}. Your database application might fail at runtime when {referencing object} is executed.

    • Example:

      CREATE PROC proc1 AS
      SELECT * FROM zzz.db1.RandomTbl;
      RETURN 0;

  • TSD3032 – Invalid Fulltext Statement
    • You cannot use this statement when you create a full-text index in a database project.

    • Example:

      CREATE FULLTEXT INDEX ON [SomeTableOrView] (column_1)
      KEY INDEX [unique_index_name]
      ON [fulltext_catalog_name]
      WITH CHANGE_TRACKING AUTO;
      ALTER FULLTEXT INDEX ON [SomeTableOrView] ENABLE;

TSD4xxx – Warning Messages

  • TSD4001 – SQL Execution error
    • TSD4001: {SQL server message} + “(SQL error = {sql error number}, {line, column})
  • TSD4004
    • Unable to find the specified schema identifier {0} in the symbol table.
  • TSD4005
    • {SQL server message} + “(SQL error = {sql error number}, {line, column})”
    • Failed to drop object, but not because object does not exists in Design DB
  • TSD4027 – SQL Parser Syntax Error

TSD7xxx – Warning Messages

  • TSD7025 – Object Type File Extension Mismatch
    • The schema type ‘{0}’ that the .sql file contains does not match the expected schema type ‘{1}’, based on the name of the .sql file
  • TSD7031 – Duplicate Schema Identifier
    • An object with name '{0}' already exists in the database project.

 

Filtering out warning messages:

As you can see the biggest bucket is the 30xx section, raised during the interpretation of the T-SQL code. Some of the warnings are there to inform you, for example when you are referencing an object that is outside the scope of the project. If you want to filter out a specific category you can do so in the Build project property page.

NOTE: Filtering out warnings will only suppress the warning message(s) and does not resolve the the cause

 

In a next blog post I will create continue the subject by using a demo project I created that shows the various forms of ambiguity, stay tuned.

-GertD