Solved

TSQL Before CTE ? Not working

Posted on 2014-04-27
3
246 Views
Last Modified: 2014-04-27
Hello,

I have a statement like this:

delete from tblA

with R_CTE (


)

etc


the issue is that the tsql is not working when i giving the delete statement before the CTE declaration...how can this work?

Thank you
0
Comment
Question by:Rayne
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:Rayne
ID: 40026573
if i comment out the Delete sql, the engine recognizes the CTE but if I un-comment the delete statement, it doesn't recognizes the CTE.
0
 
LVL 34

Accepted Solution

by:
Brian Crowe earned 500 total points
ID: 40026577
Place a semi-colon after the delete statement or before the "WITH"
0
 

Author Comment

by:Rayne
ID: 40026586
Perfect Brian, thank you :)
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question