Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why table scan?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01293823
Message ID:
01293871
Vues:
24
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform