Showing posts with label bigintset. Show all posts
Showing posts with label bigintset. Show all posts

Thursday, February 16, 2012

Amazing

Hi everyone,

I've got a dts 2000 which owns a Sql Task:

werweuroweuroiweruewr

DECLARE @.CONTADOR BIGINT

SET @.CONTADOR = 0

WHILE @.CONTADOR <= 100000

BEGIN

INSERT INTO TABLA1 (ID,NOMBRE) VALUES(@.CONTADOR,'PRUEBAS')

SET @.CONTADOR = @.CONTADOR + 1

END

'werweuroweuroiweruewr' obviously doesn't exists in my database, but it's ignored 110 times.

Then I see that TABLA1 own 100 rows. After that fails, of course.

Could you please so kind to give me any explanation for this behaviour. I'm totally stuck,

I haven't enought words (in english) in order to define this!

Why SQL executes 110 times that loop and then, oh my god, discover that 'weerrrr...' doesn't exists at all and stop!

If possible and there is explanation for that it could happen in SQL 2005?

Thanks in advance,

What is "werweuro..." supposed to represent? I'm confused.|||

Enric,

Where are you getting the error? This seems to be a DB/T-sql related issue.

I just ran that sample code in SSMS, I don't have Table1 of course, and the first error I received is:

Msg 2812, Level 16, State 62, Line 1

Could not find stored procedure 'werweuroweuroiweruewr'.

Msg 208, Level 16, State 1, Line 13

Invalid object name 'TABLA1'.

So, I am not sure...

|||

Hi both,

That's simply garbage. It doesn't exits at all. I don't know why it insert rows.

Ok, guys, run this code in your Query Analyzer:

werewr
DECLARE @.CONTADOR BIGINT
SET @.CONTADOR = 0

WHILE @.CONTADOR <= 100000
BEGIN
INSERT INTO TABLA1 (ID,NOMBRE) VALUES(@.CONTADOR,'PRUEBAS')
SET @.CONTADOR = @.CONTADOR + 1

END

I'll tested it and at the end TABLA1 have 100000 rows (despite the error)

|||At the end of the day it only demonstrate that Sql Task from DTS have a different behaviour than a Query Analyzer session. I knew that but anuway, how to configure?