Viewing 15 posts - 76 through 90 (of 124 total)
The data I receive is flat fixed width text file, the fastest way I could get this into my DB was to convert to CSV in my c# app...
September 2, 2012 at 10:07 am
Hi jeff I made them date time, columns trying to sort this mess out
Jay
September 2, 2012 at 9:35 am
Hi your correct, I want to import a cvs to nvarchar columns then export the mentioned above to another table converting to a date time in the process
Jay
September 2, 2012 at 7:58 am
Still failing
UPDATE ProdDataTB SET StartDate_Time = ''
--CREATE TABLE TestTable (Test NVARCHAR(100))
insert into dbo.TestTable (Test)
select StartDD+'-'+StartMM+'-'+StartYYYY+' '+StartHH+':'+StartMM+':'+StartSS from ProdDataTB T;
insert into dbo.ProdDataTB (StartDate_Time)
select convert(datetime,[Test],103) as [Date] from TestTable
so slow
September 1, 2012 at 4:27 pm
UPDATE ProdDataTB SET StartDate_Time = ''
--CREATE TABLE TestTable (Test NVARCHAR(100))
insert into dbo.TestTable (Test)
select StartDD+'-'+StartMM+'-'+StartYYYY+' '+StartHH+':'+StartMM+':'+StartSS from ProdDataTB T;
Select convert(datetime,[Test],103) as [Date] from TestTable
looking better but how do I...
September 1, 2012 at 3:45 pm
This is slow 🙁
UPDATE ProdDataTB SET StartDate_Time = ''
CREATE TABLE TestTable (Test DATETIME)
insert into TestTable (Test)
select CONVERT(datetime, StartDD+'-'+StartMM+'-'+StartYYYY+' '+StartHH+':'+StartMM+':'+StartSS) from ProdDataTB T;
September 1, 2012 at 3:23 pm
insert into dbo.ProdDataTB(StartDate_Time)
select StartDD+'-'+StartMM+'-'+StartYYYY+' '+StartHH+':'+StartMM+':'+StartSS from ProdDataTB AS T;
this tells me x amount of rows effected but doesnt really change the StartDate_Time column
September 1, 2012 at 3:08 pm
I can use this
select StartDD+'/'+StartMM+'/'+StartYYYY from ProdDataTB AS T;
how then do I overwrite the StartDate_Time column with the returned T and convert to datetime ?
September 1, 2012 at 3:02 pm
The table can look like anything really, the rest I can play with. Stagging table sounds good, I just want to remove everything I don't need after but for now...
September 1, 2012 at 1:25 pm
Sorry I mean at the no control over the the way I receive the data. I take the file convert to csv then bulk insert. lots of the columns I...
September 1, 2012 at 12:29 pm
I was think thinking of removing all the data in the StartDate_Time column and adding the StartYYYY,StartMM,StartDD, StartHH, StartMM and populating StartDate_Time. Does this make sense
like coalesce prehaps if that...
September 1, 2012 at 11:05 am
It gets better look at the create for the table
USE [SLADB]
GO
/****** Object: Table [dbo].[ProdDataTB] Script Date: 09/01/2012 12:27:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ProdDataTB](
[MachineName] [nvarchar](10)...
September 1, 2012 at 5:34 am
Hi Chris, well that works for bring that date I added my part to the top
SELECT * from SLADB.dbo.ProdDataTB
where MachineName = ('APS01')
Select
d.StartDate_Time,
date_string = p.[Year]+'-'+p.MonthNum+'-'+p.[Day]+' '+p.[Time],
date_datetime = CONVERT(DATETIME,p.[Year]+'-'+p.MonthNum+'-'+p.[Day]+' '+p.[Time],120)
FROM (SELECT...
August 31, 2012 at 7:56 am
Hi all, if my file has a format date like mm/dd/yyyy and the server wants yyyy/mm/dd will this create this error ?
Msg 4864, Level 16, State 1, Line 1
Bulk load...
August 23, 2012 at 8:04 am
Viewing 15 posts - 76 through 90 (of 124 total)