currently i am trying to create a temporary table and then bulk insert the data from text file to the temporary table. and of course after that i would like select certain data from the temporary table to the actual table in SQL server. i am trying to using store procedure to do this. and the problem is i dont find any data in the actual table.the table is empty !
USE [CustOrderManage] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER procedure [dbo].[insertdata] AS BEGIN SET NOCOUNT ON; create table #temptbl ( productbatch varchar(50), batchno varchar(50), date varchar(50), time datetime, mixingtime varchar (50), FB10 numeric(8,2), FB11 numeric(8,2), FB12 numeric(8,2), FB13 numeric(8,2), FB14 numeric(8,2), FB15 numeric(8,2), FB16 numeric(8,2), FB17 numeric(8,2), FB18 numeric(8,2), FB19 numeric(8,2), N1 numeric(8,2), F817 numeric(8,2), F818 numeric(8,2), F819 numeric(8,2), FB23 numeric(8,2) ) BULK INSERT #temptbl from 'C:\test4.txt' with ( fieldterminator = '\t', rowterminator = '\t\n' ) insert into hehe (productbatch,date,batchno,time) select productbatch,date,batchno,time from #temptbl END
the above store procedure execute successfully but i dont see any data exist when i select * from hehe ..
the table is totally empty..can anyone tell me how can i solve this problem?
thank you so much ...

New Topic/Question
Reply




MultiQuote




|