Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Which one is better?
Message
De
21/03/2012 09:27:34
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Which one is better?
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01538889
Message ID:
01538889
Vues:
92
I have the following two SQL select and they achieve the same result. I am wondering which one is better to use.
UPDATE Client SET [Geography]=geography::STPointFromText('POINT(' + CAST([Longitude] AS VARCHAR(20)) + ' ' + 
 CAST([Latitude] AS VARCHAR(20)) + ')',4326) WHERE Numero=1

UPDATE Clien SET [Geography]=geography::STPointFromText('POINT('+CONVERT(VARCHAR(20),Longitude)+' '+ 
 CONVERT(VARCHAR(20),Latitude)+')',4326) WHERE Numero=1
As you can see, one is using the CAST() syntax while the other one is using the CONVERT() syntax. My concerns are about the performance and the long time support of one or the other of those two functions.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform