Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3501164
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:49:30+00:00 2026-05-18T12:49:30+00:00

I have the following T-SQL query to delete a record from a series of

  • 0

I have the following T-SQL query to delete a record from a series of tables:

DELETE FROM config INNER JOIN config_profile ON config.config_id = config_profile.config_id
INNER JOIN config_page ON config_profile.config_profile_id = config_page.config_profile_id
INNER JOIN config_field ON config_page.config_page_id = config_field.config_page_id
INNER JOIN config_constraint ON config_field.config_field_id = config_constraint.config_field_id
INNER JOIN config_constraint_type ON config_constraint.config_constraint_type_id = config_constraint_type.config_constraint_type_id
WHERE config.config_name = 'ConfigName' AND config_profile.profile_name = 'ProfileName'

But it keeps throwing the error:

Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'INNER'.

Looking at it, I’m not sure what I’m missing. Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T12:49:30+00:00Added an answer on May 18, 2026 at 12:49 pm

    You need two FROMs I know its wierd

    DELETE 
    FROM CONfig 
    FROM 
    config 
    INNER JOIN config_profile ON config.config_id = config_profile.config_id
    INNER JOIN config_page ON config_profile.config_profile_id = config_page.config_profile_id
    INNER JOIN config_field ON config_page.config_page_id = config_field.config_page_id
    INNER JOIN config_constraint ON config_field.config_field_id = config_constraint.config_field_id
    INNER JOIN config_constraint_type ON config_constraint.config_constraint_type_id = config_constraint_type.config_constraint_type_id
    WHERE config.config_name = 'ConfigName' AND config_profile.profile_name = 'ProfileName'
    

    If you look at the online help here’s the syntax

    [ WITH <common_table_expression> [ ,...n ] ]
    DELETE 
        [ TOP (expression ) [ PERCENT ] ] 
        [ FROM ] 
        { <object> | rowset_function_limited 
          [ WITH ( <table_hint_limited> [ ...n ] ) ]
        }
        [ <OUTPUT Clause> ]
        [ FROM <table_source> [ ,...n ] ] 
        [ WHERE { <search_condition> 
                | { [ CURRENT OF 
                       { { [ GLOBAL ] cursor_name } 
                           | cursor_variable_name 
                       } 
                    ]
                  }
                } 
        ] 
        [ OPTION ( <Query Hint> [ ,...n ] ) ] 
    [; ]
    
    <object> ::=
    { 
    
        [ server_name.database_name.schema_name. 
          | database_name. [ schema_name ] . 
          | schema_name.
        ]
        table_or_view_name 
    }
    

    The first from is

    FROM Is an optional keyword that can
    be used between the DELETE keyword and
    the target table_or_view_name, or
    rowset_function_limited.

    The second From is

    FROM Specifies an
    additional FROM clause. This
    Transact-SQL extension to DELETE
    allows specifying data from
    and deleting the
    corresponding rows from the table in
    the first FROM clause.

    This extension, specifying a join, can
    be used instead of a subquery in the
    WHERE clause to identify rows to be
    removed.

    For more information, see FROM
    (Transact-SQL).

    As Tony points out you can optionally Drop the first FROM so its a bit more readable

    DELETE 
       Config 
    FROM 
       config ....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.