简体   繁体   English

SQL Server构建软件

[英]SQL Server Building Software

What are the option in terms of applications that help build SQL statements against a SQL Server database? 在帮助针对SQL Server数据库构建SQL语句的应用程序方面有哪些选择?

We have some users that need to build SQL statements, preferably through drag and dropping or linking up tables etc.., against a SQL Server databse who don't have any experience in this area. 我们有一些用户需要构建SQL语句,最好是通过拖放或链接表等来针对没有该领域经验的SQL Server数据库。

Any Ideas? 有任何想法吗?

Visual Studio 2008 / 2010 have this featue and works well. Visual Studio 2008/2010具有此功能并且运行良好。 I mean LINQ to SQL or Entity Framework, but in bigger projects I dont prefer Entity Framework. 我的意思是LINQ to SQL或Entity Framework,但是在较大的项目中,我不喜欢Entity Framework。

The Sql Query editor in sql server 2005 and above is very good for that sort of operation. sql server 2005及更高版本中的Sql Query编辑器非常适合这种操作。 I found that the combination of drag and drop columns with the sql instructions below helps non-sql developers learn a little about sql and tends to wean them off of the editor. 我发现拖放列与下面的sql指令结合使用可以帮助非sql开发人员了解一些有关sql的知识,并倾向于将其从编辑器中删除。

First, I hope they are not doing their queries against a production database! 首先,我希望他们不要针对生产数据库进行查询!

For regular non developers, try using excel, for these reasons: 对于常规的非开发人员,由于以下原因,请尝试使用excel:

1) most generic users might have it on their PC already. 1)大多数普通用户可能已经在其PC上安装了它。

2) drag and link tables. 2)拖动和链接表格。 There is a little GUI for simple drag and link tables in there. 那里有一个用于简单拖放表的GUI。

3) Support. 3)支持。 When they get into trouble, they can e-mail me the file and I can see what they have so far. 当他们遇到麻烦时,他们可以通过电子邮件将文件发送给我,我可以看到他们到目前为止所拥有的。 I'll end up writing views or procedures for them to use. 我将最终编写视图或过程以供他们使用。

4) They can use the results data using familiar excel interface and functions, which helps since their SQL ability is so limited. 4)他们可以使用熟悉的excel接口和函数来使用结果数据,这是有帮助的,因为它们的SQL能力非常有限。

For developers these GUI tools are extremely limited in what you can do with your queries. 对于开发人员而言,这些GUI工具在处理查询方面受到极大限制。 I've never found one that can do UNIONs, derived tables, or CTEs. 我从未找到可以执行UNION,派生表或CTE的工具。 I'm not sure if any can even do OUTER JOINs. 我不确定是否可以进行外部联接。 For simple tasks, they might be ok, but to switch back and forth all day would be a pain, so I just type them up. 对于简单的任务,它们可能没问题,但是整天来回切换会很痛苦,所以我只需要输入它们即可。

I actually just ran into this problem in my own project. 我实际上只是在自己的项目中遇到了这个问题。

One option is to purchase a tool that does precisely what you're looking for. 一种选择是购买一款能够准确满足您所需要的工具。 If you do something like that, you're more likely to get something that's full-featured, well-supported, and has a lot of nice bells and whistles to make your job easier. 如果您执行这样的操作,则更有可能获得功能齐全,得到良好支持且功能强大的功能,从而使您的工作更加轻松。

However, as both Svisstack and george9170 pointed out, there are already tools within the Visual Studio development environment. 但是,正如Svisstack和george9170所指出的那样,Visual Studio开发环境中已经有工具。 Here is how I'm proceeding: 这是我的前进方式:

  1. I use Microsoft SQL Server Management Studio's Diagram editor to perform the dragging and dropping of tables. 我使用Microsoft SQL Server Management Studio的图编辑器来执行表格的拖放。 This works fairly well, although it's a bit more cumbersome to work with than some of the tools I investigated. 尽管与我研究的某些工具相比,使用起来有点麻烦,但它的工作效果还不错。 (For the record, the reason I didn't use the tools I investigated was the cost.) (据记录,我不使用我研究的工具的原因是成本。)
  2. Once I develop the tables in the diagram, I tell MSSMS to generate the tables. 开发图表中的表后,我告诉MSSMS生成表。
  3. I then use the Database Publisher (it comes with VS2008 and VS2010) and I connect with the database. 然后,我使用Database Publisher(VS2008和VS2010随附),并与数据库连接。 Using LINQ to SQL, I let the magic work behind the scenes so that I can utilize the various objects which will interact with the database. 使用LINQ to SQL,我让魔术在幕后发挥作用,以便可以利用将与数据库交互的各种对象。

If I'm not explaining this well, check out the two links below. 如果我不能很好地解释这一点,请查看下面的两个链接。 It should make things more clear. 它应该使事情更清楚。

By using LINQ to SQL (as described in the second link), your users should be able to build queries against the database fairly easily. 通过使用LINQ to SQL(如第二个链接中所述),您的用户应该能够相当轻松地针对数据库构建查询。 It's not drag and drop, but it's very simple and straightforward. 它不是拖放,而是非常简单明了。

You can use Access databases as well. 您也可以使用Access数据库。 They let you form your own queries by dragging and dropping in Access 2010. However, if you are looking for easy to access data without the worries of SQL syntax, you might want to look at using Ruby ActionViews. 它们使您可以通过在Access 2010中拖放来形成自己的查询。但是,如果您正在寻找易于访问的数据而又不用担心SQL语法,那么您可能希望使用Ruby ActionView。 If you are talking about live editing of the entire database if the database is of any importance (you can easily delete or clear an entire database on accident), I would do it in pure SQL, or better yet, not do this at all. 如果您正在谈论整个数据库的实时编辑(如果数据库具有任何重要性)(您可以很容易地意外删除或清除整个数据库),那么我将使用纯SQL来做,或者更好的是,根本不这样做。 If you are using MySQL, you should look at the possibility of using phpmyadmin for maintaining your database. 如果使用MySQL,则应查看使用phpmyadmin维护数据库的可能性。 It is a web based tool that makes database administration easy and can help you form your queries. 它是一个基于Web的工具,可简化数据库管理并帮助您形成查询。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM