Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
DECLARE @myDecimalValue FLOAT
SET @myDecimalValue = 3.1415
SELECT CAST(@myDecimalValue AS INT);
GO
/** Output **/
-----------
3
DECLARE @myDecimalValue FLOAT
SET @myDecimalValue = 4521312.531
SELECT CONVERT(INT, @myDecimalValue);
GO
/** Output **/
-----------
4521312
SELECT TOP 5 *
FROM Customer;
GO
/** Output **/
Id FirstName LastName City Country Phone
----------- ---------------------------------------- ---------------------------------------- ---------------------------------------- ---------------------------------------- --------------------
1 Maria Anders Berlin Germany 030-0074321
2 Ana Trujillo México D.F. Mexico (5) 555-4729
3 Antonio Moreno México D.F. Mexico (5) 555-3932
4 Thomas Hardy London UK (171) 555-7788
5 Christina Berglund Luleå Sweden 0921-12 34 65
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.