Are there any good .Net libraries for creating arbitrary SQL commands? Non-relational data

I'm looking for some library that uses the TextWriter approach for writing SQL commands (just like HtmlTextWriter in .Net for writing html). I am NOT writing CRUD type commands for relational data, I am writing arbitrary SQL (bulk inserts, creating tables, creating backups, etc.). Any suggestions are greatly appreciated.

+2


a source to share


4 answers


I do not know anything. I've thought about this myself in the past and thought about writing one, but decided against it because I don't think it really offers much value beyond that, just writing a simple SQL string. The downside is obviously that it is harder to read the code and figure out what the SQL is being built.



XML and HTML are nested at much deeper levels than (typical) SQL queries. They also have a much more regular structure. So it makes sense to have a class to keep track of this structure. Doing the same in SQL will likely complicate the code more than simplify it.

+2


a source


Check it out: CodeSmith. I wouldn't say it's best, but those who have used it (not me personally) have been very positive:



http://www.codesmithtools.com/

+1


a source


If you are using SQL Server take a look at RedGate as they have a number of tools to help you manage SQL Server databases. I use SSMS Addins to help you write SQL statements and then format them in a consistent way. It provides intellisense to speed up SQL writing. They also have a host of other great productivity tools for Microsoft SQL Server.

Alternative Linq can be an alternative and also create a nice transition between SQL and .net programming.

+1


a source


I am afraid that writing arbitrary SQL (bulk inserts, creating tables, making backups, etc.) is highly dependent on Db and the tools it provides.

For example, creating backups uses the syntax entirely and has nothing to do with the syntax for creating a table.

I'm not sure what you are trying to find, but I think T-SQL (if you are using MS SQL server) is what you need.

0


a source







All Articles