RE: SQL Server not inserting all rows from single long statement
From: AnthonyThomas (AnthonyThomas_at_discussions.microsoft.com)
Date: 01/06/05
- Next message: AnthonyThomas: "RE: Changed sa password - can't connect via Enterprise Manager now"
- Previous message: jrpm: "RE: Changed sa password - can't connect via Enterprise Manager now"
- In reply to: Abbas Mukadam: "SQL Server not inserting all rows from single long statement"
- Next in thread: Abbas Mukadam: "RE: SQL Server not inserting all rows from single long statement"
- Reply: Abbas Mukadam: "RE: SQL Server not inserting all rows from single long statement"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 6 Jan 2005 13:45:06 -0800
>From Books Online explaination of EXECUTE:
@string_variable
Is the name of a local variable. @string_variable can be of char, varchar,
nchar, or nvarchar data type with a maximum value of the server's available
memory. You can use up to 4,000 characters for nchar or nvarchar and 8,000
characters for char or varchar data type strings. If the string is greater
than 4,000 characters, concatenate multiple local variables to use for the
EXECUTE string. For optimum performance, do not use more than 4,000
characters. For more information about system-supplied SQL Server data types,
see Data Types.
[N]'tsql_string'
Is a constant string. tsql_string can be of nvarchar or varchar data type.
If the N is included, the string is interpreted as nvarchar data type with a
maximum value of the server's available memory. If the string is greater than
4,000 characters, concatenate multiple local variables to use for the EXECUTE
string.
Hope this helps. It looks like you are running into a possible memory issue
and/or try the recommendation of concatenating less than 4000 chunks together.
Sincerely,
Anthony Thomas
"Abbas Mukadam" wrote:
>
> Hello folks
> I am using ADO to execute a SQL statement. The variabble StrSQL that
> holds multiple INSERT statements all concatentated.. To be precise there
> are 812 INSERT statements; all concatenated to form one long string
> When i call cnn.Execute (StrSQL) I should get 812 rows in the table.
> However, I get sometimes 467 sometimes 468 rows.
> I get no error when executing. When i breakdown the string to hold 200
> INSERT statements at a time it works fine.Is there a limit on the size
> of string SQL statment?
> Any help would be greatly appreciate..
>
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
>
- Next message: AnthonyThomas: "RE: Changed sa password - can't connect via Enterprise Manager now"
- Previous message: jrpm: "RE: Changed sa password - can't connect via Enterprise Manager now"
- In reply to: Abbas Mukadam: "SQL Server not inserting all rows from single long statement"
- Next in thread: Abbas Mukadam: "RE: SQL Server not inserting all rows from single long statement"
- Reply: Abbas Mukadam: "RE: SQL Server not inserting all rows from single long statement"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|