什么是SQL语句的所有可能的第一个字? [英] What are all the possible first-words of SQL statements?

查看:193
本文介绍了什么是SQL语句的所有可能的第一个字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个用户界面,以便能够在SQL Server数据库上执行SQL语句,并在SQL Server 2008 R2上兼容。我需要能够确定每个语句是否可能返回数据集,或者只需要执行它们。在Delphi中, TADOQuery 打开 / 关闭对于数据集,或 ExecSQL 只是为了执行。我需要根据SQL语句的第一个字自动确定要使用哪一个。

I'm building a user interface to be able to execute SQL statements on a SQL Server database, compatibility at SQL Server 2008 R2. I need to be able to determine whether each statement could possibly return a dataset, or if it just needs to be executed. In Delp the TADOQuery consists of either Open / Close for a dataset, or ExecSQL just to execute. I need to automatically determine which one to use based on the first word(s) of the SQL statement.

如何根据第一个字段确定应该调用哪个方法声明中的单词?我需要知道每个可能的单词,以及基于每个单词的方法。

How can I determine which method I should call based on the first word(s) in the statement? I would need to know each possible word, and which method based on each word.

推荐答案

。例如,EXEC存储过程名称可以根据proc的写入方式返回一个结果集。没有办法知道是否是来自呼叫语法的一个或另一个。

That is not possible in the general sense. EXEC stored-procedure-name for example can eithers return a result set or not, depending on how the proc is written. There is no way to know if it's one or the other just from the syntax of the call.

这篇关于什么是SQL语句的所有可能的第一个字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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