Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

Create View in SQL Server from within Delphi


How can I create a View in SQL Server from within Delphi?
The connections is done via TADOConnection.

Thanks, Stef
Stef Merlijn
Stef Merlijn
1 Solution
so long as you can issue statements against the database and you have permissions to do so, you can create a view

--this is VB..dont' know delphi

dim sql as string
sql = "create view myfiew as select * from mytable"

connection.execute sql
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you can run a CREATE VIEW statement like any other DELETE, UPDATE, etc statement using the TADOCOnnection object.
of course, given the login you use to connect has the right permissions.
Geert GruwezOracle dbaCommented:
TAdoConnection has a Execute method

var AdoConnection1: TAdoConnection;

AdoConnection1Execute('CREATE VIEW AS SELECT * FROM TABLE', cmdText, [eoExecuteNoRecords]);
Stef MerlijnDeveloperAuthor Commented:
Thank you!

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now