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

  • SEARCH
  • Home
  • 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 8410859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:17:20+00:00 2026-06-10T00:17:20+00:00

I get the error Incorrect syntax near the keyword ‘truncate’. and not sure what’s

  • 0

I get the error “Incorrect syntax near the keyword ‘truncate’.” and not sure what’s wrong with the syntax here, it’s not obvious to me…probably something stupid but I need another set of eyes:

ALTER VIEW [dbo].[vw_All_Events]
AS

truncate table Event

Select [event_id]
      ,[site_id]
      ,[autogenerated]
      ,[creation_date]
      ,[last_update_date]
from Event

GO
  • 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-06-10T00:17:22+00:00Added an answer on June 10, 2026 at 12:17 am

    A view only allows a single statement after the AS and it must be data retrieval (return a rowset). It can’t be a different type including data definition, data modification, procedural, declarative, or any other.

    You can do these things with a stored procedure, or a user-defined function (but can’t do DDL & DML in a function).

    In detail, a stored procedure allows flow-of-control statements like IF THEN ELSE BEGIN END WHILE RETURN. You can use DML to UPDATE, DELETE and INSERT. You can use DDL to CREATE and DROP tables and indexes, add columns and constraints, and so on. You can return multiple rowsets. You can execute dynamic SQL.

    What are you trying to accomplish?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

when i execute this query, i get error of 'Incorrect syntax near the keyword
This is my statement Why I get those errors Incorrect syntax near the keyword
I get this error when I run the application Incorrect syntax near 12 ,
i coppied some code from HERE but i'm getting an error: incorrect syntax near
I have the following query that's returning the error: Incorrect syntax near the keyword
When I try to execute the query below, I get error Incorrect syntax near
I get the following error: Unhandled Exception: System.IO.IOException: The parameter is incorrect. at System.IO.__Error.WinIOError(Int32
Why do I get error in this code?Even if i do not link but
Why I get error with this query on my live server but not on
Can't figure out why I get the error substring(cast(CASE WHEN l.assigned IS NOT NULL

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.