We can easily do this with a SQL query as shown below: PgSQL SELECT * FROM Employees 1 SELECT * FROM Employees Click the execute button and you should see a table with three employees and their information. Take note of the code below: PgSQL SELECT 'Jim', 'Johnson', '20110101 12:00:00:000', 21, 123456789, 32000 UNION ALL SELECT 'Kim', 'Tyra', '20110101 12:00:00:000', 21, 112345678, 25000 UNION ALL SELECT 'Ryu', 'Drake', '20110101 12:00:00:000', 21, 112234567, 24000 12345 SELECT 'Jim', 'Johnson', '20110101 12:00:00:000', 21, 123456789, 32000UNION ALLSELECT 'Kim', 'Tyra', '20110101 12:00:00:000', 21, 112345678, 25000UNION ALLSELECT 'Ryu', 'Drake', '20110101 12:00:00:000', 21, 112234567, 24000 It is a rinse and repeat process with the SELECT and UNION ALL statements
How to set default value for a datetime column in mssql - Microsoft SQL Server
How to set default value for a datetime column in mssql P: 10 pks83 Hi I want to set the default value for a datetime datatype column not null as 2000-01-01 00:00:00.000 but the sql is not executing correctly
How to pass null value to a column in sql server table through classic asp - CodeProject
I spent about half an hour searching for this going through pages of Google results, and finally found it! I wanted to post it here for future reference because I think it's pretty relevant. For example if you have a check box before a date field indicating if there is a value or not, that check box could be used as a criteria in your code whether to use DBNull.Value or the value in the field
Than, you can just not set the parameter on the application side, and it would work correctly: create procedure InsertIntoTable -- ....other parameters here... That said, since you are using stored procedures to insert data, I would recommend using default values for the parameters on the procedure level, instead of burdening the aplication code
No comments:
Post a Comment