Solved

Default value won't insert on new row

Posted on 2008-06-17
2
229 Views
Last Modified: 2010-03-20
I have two default values on two columns. One is GetDate() the other is an integer (6). I am developing a visual basic form based on my database table. When I enter a new row, be it from the form or direct into the db table, the default values will not populate the table unless I re-run the ! SQL. Do I need to create a trigger and if so what is the code? The columns are currently set to NOT NULL.
0
Comment
Question by:teustace
2 Comments
 
LVL 11

Expert Comment

by:CMYScott
ID: 21808581
can you show the code you are using to insert the rows?
0
 

Accepted Solution

by:
teustace earned 0 total points
ID: 21808720
Well, from the front end, using Visual Studio it is just the basic CRUD event when I hit the Save button but nothing happens, (because it is expecting the two values that I have purposely omitted because I am wanting the db to fill them in for me.). When I try entering the data directly into my database it gives a red dot to tell me that "the row was successfully committed to the db however, a problem occurred when attempting to retrieve the data back. So it tells me to re-run the query again. Must be a bug, I guess....
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Modal Popup Extender control 1 22
Simple SQL query from two tables 13 54
Mysql Left Join Case 10 56
Expression Evaluater 3 27
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question