Technology computers-hardware

How to Convert String to Float in SQL

    • 1). Click the Windows "Start" button and select "All Programs." Click "SQL Server," then click "SQL Server Management Studio" to open the database editor.

    • 2). Click "New Query" in the Management Studio toolbar to open the editor for the SQL coding. Type the following command to create a SQL variable for the converted string:

      declare @mystring varchar(30)

      declare @converted decimal

      The first variable holds the string, and the second variable contains the converted floating point decimal.

    • 3). Copy and paste the following code to convert the string to a floating point decimal:

      set @mystring = '1.20'

      set @converted = cast(@mystring as decmial)

      The code uses the cast function to convert the number contained in the string variable to a decimal. The converted number is saved to the "@converted" variable.

    • 4). Press the "F5" key to execute the code. You can review the results in the results panel at the bottom of the window.

Related posts "Technology : computers-hardware"

Innovative And Economical Vxa Tape Technology

Hardware

How to Save a Document to a Flash Drive From Open Office

Hardware

NAS vs DAS, Which Is Better And Why?

Hardware

How to Flash BIOS on a Acer Aspire 5517 Laptop

Hardware

Jet Tec Canon Pg510 And Cl511 Ink Cartridges From Uk Ink Supplies

Hardware

How do I Hook Up My 3M X55i Projector to My Computer?

Hardware

How to Conduct Remote Management of an HP Laserjet 4050

Hardware

How to Copy Games to a Hard Drive

Hardware

How to Hide Windows System Tray Icons

Hardware

Leave a Comment