Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: driver facility to break up query batches #186

Closed
kardianos opened this issue Dec 4, 2016 · 4 comments
Closed

proposal: driver facility to break up query batches #186

kardianos opened this issue Dec 4, 2016 · 4 comments

Comments

@kardianos
Copy link
Collaborator

SQL Server often breaks up queries with a keyword, often "GO".

Offer a parser package that parses a query and returns multiple query texts to run. This would not normally be done on a query, the user would need to separate them out by calling a separate API. I have an implementation I could donate here:

https://bitbucket.org/kardianos/rdb/src/9016e187c250331d1c1c35444a69f27b87bdb5e8/ms/batch/?at=default

@dimdin
Copy link
Collaborator

dimdin commented Apr 20, 2017

@kardianos note that the syntax of the go statement is

GO [count]

Please see https://docs.microsoft.com/en-us/sql/t-sql/language-elements/sql-server-utilities-statements-go

@kardianos
Copy link
Collaborator Author

It is indeed. In that package I took a shortcut because I never personally use the [count]. I will do a more correct parsing before submitting to this repo.

@dimdin
Copy link
Collaborator

dimdin commented Apr 20, 2017

I cannot find the syntax for the isql/osql/sqlcmd scripts. I know the go and \ syntax. Backslash is documented here https://docs.microsoft.com/en-us/sql/t-sql/language-elements/sql-server-utilities-statements-backslash

kardianos added a commit that referenced this issue Apr 23, 2017
@kardianos
Copy link
Collaborator Author

@dimdin I've fuzzed the associated PR, it should be good to go. Let me know/merge if you think it is good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants