开发者

Is posting SQL code in forums a bad idea?

Is there any risk in posting SQL code from my company in these forums, or in any forums for that matter?

Specifically I am referring to examples of SQL queries. These queries obviously show joins to tables and different fields in my datab开发者_JAVA技巧ase tables.


The risk is pretty low, if:

  • you do not publish company's name or web address
  • there are no SQL injection waiting to be exploited in that SQL of yours
  • server itself is secure and pached
  • you do not publish connection credentials with your snippet


As long as it doesn't show proprietary information, SQL is SQL. I would always recommend sharing "fake" information for example data.


It should be easy to obscure relevant names, etc. Think of a good analogy and replace names with that. I don't think people care too much to try and "find you out". We're much more interested in solving your problem.


Only the connection information (username, password, IP, etc) is sensitive - without that information:

SELECT e.*
  FROM EMPLOYEES e

...is quite safe. Neither I nor anyone else can delete anything in your tables.

I don't recommend abstracting things too much when posting questions - some details can make all the difference to determine the issue you're encountering.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜