AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • In-Person Gatherings
    • Power BI Workshop
    • Podcast
    • Rolodex
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Acumatica Generic I...
Publishing SQL View...
 
Notifications
Clear all

#AcumaticaTnT Publishing SQL View Already Exists

 
Acumatica Generic Inquiries & Pivot Tables
Last Post by Wyatt.ERP 6 years ago
2 Posts
2 Users
1 Reactions
1,462 Views
RSS
Tim Rodman
Posts: 3204
 Tim Rodman
Admin
Topic starter
March 18, 2020 9:35 am
(@timrodman)
Famed Member
Joined: 10 years ago

For those who like using the technique to turn a SQL View into a Data Access Class (DAC) outlined in this article by Doug Johnson:
https://www.acumatica.com/blog/technical-tuesday-report-from-sql-view/

You'll want to add a statement before CREATE VIEW that drops the SQL View if it exists, otherwise you'll get an error that it already exists the next time you try to publish the Customization Project.

IF EXISTS

(

    SELECT * FROM sys.views

    WHERE name = 'MySQLView' AND schema_id = SCHEMA_ID('dbo')

)

DROP VIEW [dbo].[MySQLView]

GO

CREATE VIEW [dbo].[MySQLView] AS

1 Reply
Wyatt.ERP
Posts: 128
 Wyatt.ERP
March 31, 2020 10:03 am
(@wyatt-erp)
Estimable Member
Joined: 6 years ago

MS SQL 2016+ and MySQL have this is well:

DROP VIEW IF EXISTS [dbo].[MySQLView]

GO

CREATE VIEW [dbo].[MySQLView] AS

...

Reply
Tim Rodman reacted
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,529 Topics
  • 11 K Posts
  • 30 Online
  • 2,418 Members
Our newest member: Chad Treadwell
Latest Post: Production Orders with all material on hand
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

  • Debbie Reed Nathan Deardorff
Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2026 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×