Link to home
Start Free TrialLog in
Avatar of Stef Merlijn
Stef MerlijnFlag for Netherlands

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
TAdoConnection has a Execute method

var AdoConnection1: TAdoConnection;

AdoConnection1Execute('CREATE VIEW AS SELECT * FROM TABLE', cmdText, [eoExecuteNoRecords]);
Avatar of Stef Merlijn

ASKER

Thank you!