Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What is the preferred method for writing SQL Statements? Or basically in other words Is there a preferred method for writing SQL statements?
Posted
Updated 18-Jun-12 14:26pm
v2
Comments
[no name] 18-Jun-12 19:54pm    
Do you think you could be a tad more specific?
Member 9138159 18-Jun-12 20:28pm    
What I was wondering is, Does SQL have a preferred method for writing SQL Statements or is it left up to the administration to make up their own SQL statements?
[no name] 18-Jun-12 21:03pm    
Still not clear. I do not really understand what it is that you are asking but the answer, I think, is it depends. I would like nothing better then to let the DBAs write all the queries and SPs that they want. In my situation the DBAs do not do anything except make backups. I am the one that writes SPs for them. They do not give me access to the databases but expect me to troubleshoot data errors for them. Not to mention the network admins that do not know anything about folder permissions.

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900