Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why table scan?
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01293823
Message ID:
01293871
Views:
22
>>He-he <g> I also like to use long nice words especially if I don't know their meaning. :)
>ROFL

That's funny :)

But can you please help me with the problem I posted, sorry for turning your thread into different direction?

It looks to me that
declare @counter int
set @counter = 1
while @counter < 100000 
  begin
	  insert into Test1 values (@counter, 'Counter' + cast(@counter as char(10))

	  insert into Test2 values (@counter, @counter, @counter,'Counter' + cast(@counter as varchar(10))

	  set @counter = @counter +1
end
after the first cast operation the type of the Counter variable actually changes from int to char and thus the second insert fails.

Am I right? If yes, how this code should be re-written?

Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform