I have table with 3 coloumns.
abc table columns a , b, c
for b,c i have .csv file and since it is bulk m using bulk insert qry.
but for colomn a i need getdate() or( any default value)..
in a single statement...
help me pls.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SreekanthPosted Oct 23, 2009, 12:51 AM
my .csv file daily contain morethan 50thousnd rows..
my client daily upload these files .
what i nedd is include a date ,let it be selcted date from my clalnder comtrol to one of additional column of where i inserted my bulk file..
i have two of thes file and m using two tables for these seperate usage...but i m facing the above prblm, and thkning of bulk insert into ONE table and AGAIn select from THAT TABLE and inserted into another TABLE will...be complicted and i HAVE TO USE TOTAL 4 TABLES with2 duplicate datas... help me pls....
SreekanthPosted Aug 7, 2009, 8:20 AM
but m dealing with bulk insert..
instead of insert..can u help me to place bulk insert..then default..colmn..will be a prblm...???
Shouketh EKPosted Aug 7, 2009, 7:30 AM
good day.
u can set Defalt value for a perticuler field.
CREATE TABLE dbo.ABC
(
A DATETIME CONSTRAINT DF_ABC_A DEFAULT (getdate()) NULL,
B VARCHAR (50) NULL,
C VARCHAR (50) NULL
)
Make table like this and try this..
INSERT INTO ABC(A,B,C) VALUES('','Test Server','Test Server2')
thank you.