Showing posts with label Sql server. Show all posts
Showing posts with label Sql server. Show all posts

Monday, 20 January 2020

How to Create table in sql

I discuss following step to step to create database table as:

1. First open SQL Server Management Studio .
2. Select Database name and click on New Query then select database name appear in dropdown that is shown in picture below.



3. If you not selected database then write command to use database that's syntax here is:
     use <Database name>

then press F5 to execute command or in tool bar have button execute to click for execute.



4. Then, write query to create database table . Syntax is below

 Create table <tablename> (<column name> <data type>   <datatype Value>,etc.... )

If you use data type int, bigint  then you not give data type value   because it is automatically set the range but you have use data type char, varchar then we must give this value like that varchar(50).



5. Then press F5 keyword to execute query then you have create your table successfully.

Saturday, 30 April 2016

Save date and time from dropdown in sql database table using javascripts

I will describe here to save hh and mm format dropdown value to database. Firstly , I have two dropdown first is Hours and second is Minutes .






When you will fill data then press F12 or inspect element . I will showing it value following as:


Here , you will show $scope._MinuteDataTypeModal contains value 30 and next image show Hours data as:



And I am concatenate both modal using ":" to time format.




In above picture, $scope.VisitTimeModal show actual time format that is "10:30:00".

And in c# or server side code automatically get data in class using get set property . And in below picture show highlighted section that is time is save in database.