Yaron Naveh
Yaron Naveh

Reputation: 24406

ddl in code or script

I need to run ddl commands (e.g. CREATE, DROP) during application flow (not just one-time initialiation). Is it better to write one big .sql script to do it and run the script from code using a command line, or is it preferred to run each sql command separately from my java/c# code?

one big .sql pros:

one big .sql cons:

Upvotes: 1

Views: 219

Answers (1)

Aret
Aret

Reputation: 475

I would use prcedural language API (package or some set of functions and procedures) on DB side for creating and dropping these tables.

It allows you to execute these in creator privileges, and avoids potential security risk on the application side.

Upvotes: 1

Related Questions