Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to get system date automatically in the column
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

40 Posts

Posted - 11/08/2012 :  01:57:54  Show Profile  Reply with Quote

Hi experts,

I have a table called branch with columns

Here i have data for the 1st three columns and the rest 2 fields 'modified_by' and 'modified_date' has to get values automatically from the system...
I did a bulk insert to get the data into those 3 columns but it is expecting 'modified_by' and 'modified_date' fields.
How do i give it separately? the values in those last 2 fields should be given as 'system' and GETDATE()

Please help me with ur scripts

Flowing Fount of Yak Knowledge

2242 Posts

Posted - 11/08/2012 :  02:21:29  Show Profile  Reply with Quote
Have you designed your table with DEFAULT constraint?

Check this link (Keep Nulls or UseDefault Values During Bulk Import)

Go to Top of Page

Aged Yak Warrior

737 Posts

Posted - 11/08/2012 :  06:57:33  Show Profile  Send ahmeds08 a Yahoo! Message  Reply with Quote
as bandi mentioned you need apply default values to the two columns.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000