1

Topic: I launch files *.sql through the console, the part fulfills, honor is not present (do not work INSERT)

I have files with sql extension. The size of files from 4 to 6 megabytes.
Files approximately here such structure:

USE [BBB];
...
GO
CREATE TABLE [XXX]...;
...
GO
INSERT INTO [XXX]...;
INSERT INTO [XXX]...;
INSERT INTO [XXX]...;
GO

That is creation of the table and a heap INSERT (from 5 thousand pieces and above) in it.
I send scripts on handling approximately such :

CALL sql-S %SERVER %-U %USER %-P %PASSWORD %-i "%FILE_NAME %. sql">> "%LOG_NAME%.log" 2>&1

The problem - by one machine all perfectly works, and here by other machine of the table form, but they for some reason empty, in a broad gull are not present any errors.
Someone can prompt something?

2

Re: I launch files *.sql through the console, the part fulfills, honor is not present (do not work INSERT)

3

Re: I launch files *.sql through the console, the part fulfills, honor is not present (do not work INSERT)

wrote:

and here by other machine of the table form, but they for some reason empty, in a broad gull are not present any errors.

that hinders hands to fulfill t-sql the code in ssms from this yours %USER % and to look that happens?

4

Re: I launch files *.sql through the console, the part fulfills, honor is not present (do not work INSERT)

The Grandfather , SSMS . Though yes, did not think, it is very logical so to make, thanks big, I will try to find and deliver.
flexgen , It it also is, means I add somehow so:

CALL sql-S %SERVER %-U %USER %-P %PASSWORD %-i "%FILE_NAME %. sql"-o "%FILE_NAME%.log">> "%LOG_NAME%.log" 2>&1

- also I look there, thanks huge! Now we try...

5

Re: I launch files *.sql through the console, the part fulfills, honor is not present (do not work INSERT)

How it is possible to create the table without check of its existence?
For certain the table already is-> an error-> interruption of performance of a script.

6

Re: I launch files *.sql through the console, the part fulfills, honor is not present (do not work INSERT)

In one of files it appeared - a syntax error - in adjustments any line used the single quote character, and at the script assembly forgot to screen it. Thus to a broad gull it is written only:

wrote:

the database Context is changed on "BBB".

Single line. And all. Errors are not present.
Others write an error:

wrote:

the database Context is changed on "BBB".
The supplier of the general storage: From both ends of the channel there are processes.
Communication error

By practical consideration it is revealed that it is provoked too by a considerable quantity going successively "INSERT", not separated from each other "GO"...
If  "GO" at least through each quarter "INSERT" - already the error disappears, the script fulfills a message and it is correct...
[sub] Probably it is necessary to demand in  that through everyone 100 "INSERT" interposed "GO". [/sub]

7

Re: I launch files *.sql through the console, the part fulfills, honor is not present (do not work INSERT)

wrote:

By practical consideration it is revealed that it is provoked too by a considerable quantity going successively "INSERT", not separated from each other "GO".

judging by the example resulted by you at you  in one table why do not make one ?

8

Re: I launch files *.sql through the console, the part fulfills, honor is not present (do not work INSERT)

wrote:

it is passed...
Judging by the example resulted by you at you  in one table why do not make one ?

One  like as has restriction on 1000 values, but it really is better

9

Re: I launch files *.sql through the console, the part fulfills, honor is not present (do not work INSERT)

Alexander Titkin wrote:

it is passed...
One  like as has restriction on 1000 values, but it really is better

One thousand is if INSERT VALUES (). And that it not absolutely truth.
It is possible, however, INSERT SELECT UNION ALL SELECT UNION ALL...
But separate INSERT it is more reliable,

10

Re: I launch files *.sql through the console, the part fulfills, honor is not present (do not work INSERT)

iap;
Through union all too has restriction) Somehow time at us to the person was impatient one million hashes thus to flood, in a day I beat request. I whine a lot of time and storages for creation of the plan of request was required.

11

Re: I launch files *.sql through the console, the part fulfills, honor is not present (do not work INSERT)

All is already stolen to us Generation of scripts becomes without my involvement, I cannot independently influence a format. At me simply portion of ready files.
To me that, whether type  that what to set on files before performance? Too  the decision. And if something change and  on the contrary breaks all ?
I already demanded that at generation through each one hundred INSERT went GO so works by all machines and all available (for clients) versions MSSQLS.
Truth they here answered a pier to them " easier after everyone INSERT to push GO, give so? "... And I cannot think and as to the server it will be better upon...

12

Re: I launch files *.sql through the console, the part fulfills, honor is not present (do not work INSERT)

wrote:

All is already stolen to us Generation of scripts becomes without my involvement, I cannot independently influence a format. At me simply portion of ready files.
To me that, whether type  that what to set on files before performance? Too  the decision. And if something change and  on the contrary breaks all ?
I already demanded that at generation through each one hundred INSERT went GO so works by all machines and all available (for clients) versions MSSQLS.
Truth they here answered a pier to them " easier after everyone INSERT to push GO, give so? "... And I cannot think and as to the server it will be better upon...

And to group records on 1000, and to do insert... values (), ()... () go they cannot?
The most optimal variant, .