Showing posts with label How. Show all posts
Showing posts with label How. Show all posts

Thursday, 28 May 2015

How to create table in SQL Server Management Studio using SQL query

In SQL Server Management Studio, Althogh there are many ways to create a table using GUI and using query written in SQL.
So simple SQL Query to create a table

SQL CREATE TABLE Syntax

CREATE TABLE table_name
(
column_name1 data_type(size),
column_name2 data_type(size),
column_name3 data_type(size),
....
);

for example: 
Create table Student(
StudentID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);

Wednesday, 27 May 2015

How to make parse float function in javascript return two decimal places

What happens when you use parseFloat() in javascript.
If you pass 10 to this parseFloat() then the output comes is just 10 not 10.00
So if you want to have output to two decimal places that is 10.00
use following

parseFloat(number).toFixed(2);

What it return is actually a string of format(##.##) when we use .toFixed(2)