473,388 Members | 1,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

how to insert system time in the table using sql query

i'm using sql 2008 and .net 2008.... i need to insert system time in the table by using sql query... pls help me
Feb 16 '15 #1
2 2124
Lets say the name of your table is "students" and it has a timestamp,
like this

Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE students (
  2.   ts TIMESTAMP,
  3.   description VARCHAR(80));
Then this will do for date and time
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO students VALUES (CURRENT_TIMESTAMP);
This will do for just time
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO students VALUES (CURRENT_TIME);

or use NOW

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO students VALUES ('text holder', NOW());

Let me know if they work. They should all work. :-)
Feb 16 '15 #2
That should definitely work man!
Mar 5 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Valiz | last post by:
Hi, I am updating system time with IRIG time source which sends irregular pulses as shown below 11000011111100111111111111111111....(1-IRIG present and 0-IRIG not present) I need to update...
1
by: Lars Erik Hansen | last post by:
I want to write/insert the value of foundFiles into a table. How can i paste a value into a table using VB?? Can someone help? I want to get "FoundFiles(i)" and paste it into a table Set...
2
by: Max | last post by:
Hi, I have the following problem. I want to insert records into one table using the combination of two other tables. Here is a simplified example: Let's say the first table has a column with...
1
by: rdeanstew | last post by:
I have created a query and saved it. The Access 2003 allowed me to create a table using the query. To the life of me I can't find out where to do this in A2007. Can someone either answer this or...
3
manoj9849967222
by: manoj9849967222 | last post by:
HI All I have two tables One is "master" & the other one is "child". The master Table have filds Productcode -----Number Productname-------Text Child Table
5
by: cherryst152 | last post by:
while($i=01:00; $i<=01:10; $i++){ $query= "INSERT INSERT INTO $January_Ad1 (Day, Time) VALUES ('1','$i')"; $result= mysql_query($query); } I want to insert 11 rows that say the Day is 1 and...
13
nabh4u
by: nabh4u | last post by:
hi, I am trying to insert multiple rows in a table using PL/SQL. I have two procedures and two tables. the first procedure gets the data from the source table, manipulates it and then sends the...
1
by: chennaibala | last post by:
hi frds... in my hiden textbox.i have following values... robert|true|true|false|arun|true|false|true|anu|true|true|false| i want to splits in to token and insert in mysql table in following...
9
by: AndyWal6 | last post by:
I have an Events table that records events with the fields: , , (Text), and it is used as a note pad to record calls made to and from contacts and other occurrences. I also have a MailShot...
0
by: sari saji | last post by:
Can somebody show me the right direction to the solution of this problem: I have one datagridview. In my database i have 2 tables with no relationships between them but both tables have the same...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.