Click here to Skip to main content
15,900,254 members
Home / Discussions / Database
   

Database

 
GeneralRe: Copying records between two tables in same database? Pin
kbalias27-Mar-07 21:14
kbalias27-Mar-07 21:14 
GeneralRe: Copying records between two tables in same database? Pin
Krish - KP27-Mar-07 22:35
Krish - KP27-Mar-07 22:35 
GeneralRe: Copying records between two tables in same database? Pin
kbalias27-Mar-07 23:30
kbalias27-Mar-07 23:30 
GeneralRe: Copying records between two tables in same database? Pin
Krish - KP28-Mar-07 0:23
Krish - KP28-Mar-07 0:23 
AnswerRe: Copying records between two tables in same database? Pin
Krish - KP27-Mar-07 22:22
Krish - KP27-Mar-07 22:22 
QuestionSmall square in text file Pin
brianjperry27-Mar-07 13:59
brianjperry27-Mar-07 13:59 
AnswerRe: Small square in text file Pin
andyharman28-Mar-07 0:14
professionalandyharman28-Mar-07 0:14 
GeneralRe: Small square in text file Pin
crisp196728-Mar-07 3:56
crisp196728-Mar-07 3:56 
Thanks for the help but Im not sure how I use the replace statement in this content this is the code that fails due to the control character. Can I put the replace in with the bulk insert and how would I do this?
Thanks

declare @File varchar(1000)
declare @cmd varchar(2000)
declare @dealermark money

create table ##Import (prodnum varchar(20), lblabr varchar(4), lbl varchar(20), vendorname varchar(20), catnum varchar(20),config varchar(2),artist varchar(50),title varchar(50),mcat1 int,mcat2 int,mcat3 int,vidrate varchar(5),sellprice money,listprice money,UPC varchar(20),oldupc varchar(12),oldprod varchar(20),rlsdate datetime,disdate datetime, lastret datetime,specord varchar(1), modflag varchar(1), bioinfo varchar(1000))

select @File = @pFileName
select @cmd = 'bulk insert'
select @cmd = @cmd + ' ##Import'
select @cmd = @cmd + ' from'
select @cmd = @cmd + ' ''' + replace(@File,'"','') + ''''
select @cmd = @cmd + ' with (MAXERRORS = 1000, FIELDTERMINATOR=''","'''
select @cmd = @cmd + ',ROWTERMINATOR = ''' + char(10) + ''')'
truncate table ##Import
-- import the data
exec (@cmd)
GeneralRe: Small square in text file Pin
andyharman28-Mar-07 4:52
professionalandyharman28-Mar-07 4:52 
QuestionSQL Server collation like Access Pin
eggsovereasy27-Mar-07 9:40
eggsovereasy27-Mar-07 9:40 
AnswerRe: SQL Server collation like Access Pin
DQNOK29-Mar-07 4:06
professionalDQNOK29-Mar-07 4:06 
QuestionPivot Table Generalization Pin
logicon27-Mar-07 8:35
logicon27-Mar-07 8:35 
AnswerRe: Pivot Table Generalization Pin
Pete O'Hanlon28-Mar-07 4:51
mvePete O'Hanlon28-Mar-07 4:51 
QuestionSQL Express performance on XP Pin
Joe Smith IX27-Mar-07 5:29
Joe Smith IX27-Mar-07 5:29 
AnswerRe: SQL Express performance on XP Pin
kubben27-Mar-07 6:29
kubben27-Mar-07 6:29 
GeneralRe: SQL Express performance on XP Pin
Joe Smith IX27-Mar-07 16:24
Joe Smith IX27-Mar-07 16:24 
GeneralRe: SQL Express performance on XP Pin
kubben28-Mar-07 1:08
kubben28-Mar-07 1:08 
QuestionMirroring connection strings in 1.1 Pin
BoneSoft27-Mar-07 5:10
BoneSoft27-Mar-07 5:10 
Questionnot exist Pin
hadad27-Mar-07 3:18
hadad27-Mar-07 3:18 
AnswerRe: not exist Pin
Marcus J. Smith27-Mar-07 3:26
professionalMarcus J. Smith27-Mar-07 3:26 
AnswerRe: not exist Pin
andyharman27-Mar-07 7:36
professionalandyharman27-Mar-07 7:36 
QuestionHash Table???????? Pin
Ankur.Bakliwal27-Mar-07 2:02
Ankur.Bakliwal27-Mar-07 2:02 
AnswerRe: Hash Table???????? Pin
Christian Graus27-Mar-07 2:13
protectorChristian Graus27-Mar-07 2:13 
AnswerRe: Hash Table???????? Pin
Aaron VanWieren27-Mar-07 2:55
Aaron VanWieren27-Mar-07 2:55 
Questionexporting a crystal report in to Excel format Pin
indian14327-Mar-07 1:21
indian14327-Mar-07 1:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.