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

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

Create View in SQL Server from within Delphi

Hi,

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

Thanks, Stef
0
Stef Merlijn
Asked:
Stef Merlijn
1 Solution
 
chapmandewCommented:
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
0
 
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.
0
 
Geert GruwezOracle dbaCommented:
TAdoConnection has a Execute method

var AdoConnection1: TAdoConnection;

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

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