编写SQL语句 [英] Writing SQL statements

查看:74
本文介绍了编写SQL语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编写SQL语句的首选方法是什么?或者基本上换句话说,是否有编写SQL语句的首选方法?

What is the preferred method for writing SQL Statements? Or basically in other words Is there a preferred method for writing SQL statements?

推荐答案

好吧,根据您的问题和您的评论,我想我可以回答您的问题.

首先,我将回答谁应该编写SQL的问题.这取决于您的环境.在我的环境中,软件开发人员还编写了T-SQL语句(主要是存储过程).但是,我也曾在数据库管理员编写所有脚本的环境中工作.我想我的观点是让最有经验的人编写脚本.

第二,我将回答在哪里开发脚本的问题.通常,开发脚本的最佳位置(我认为)是在SSMS编辑器中.这样可以实现智能(在较新的版本中),查询计划(以确保进行了优化)以及现场测试.
OK, based upon your question and your comments, I think I can answer your question.

First, I''ll answer the question of who should write the SQL. That depends on your environment. In my environment, the software developers also write the T-SQL statements (stored procedures mostly). However, I''ve also worked in environments where the database administrators wrote all of the scripts. I guess my opinion would be to have the person/people with the most experience write the scripts.

Second, I''ll answer the question of where the scripts should be developed. Normally, the best place to develop scripts (in my opinion) is in the SSMS editor. This allows for intellisence (in newer versions), query planning (to be sure it is optimized), and on the spot testing.


这篇关于编写SQL语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆