Viewing 15 posts - 61 through 75 (of 321 total)
Can you post a sample of what you are trieng to do ? DDL/Data/Result required
July 25, 2006 at 2:28 pm
EXEC('BULK INSERT Emp FROM ''E:\Development\Emp\'+@FileName+'.txt''
WITH (formatfile =''E:\Development\Emp\InputFormat.fmt'')')
=
DECLARE @MySQL NVARCHAR(4000)
SET @MySQL ='BULK INSERT Emp FROM '''+@FileName+''' WITH (formatfile =''E:\Development\Emp\InputFormat.fmt'')'
PRINT @MySQL
EXEC (@MySQL)
July 25, 2006 at 2:19 pm
can you post again what you did ?
this one works
SET NOCOUNT ON
DECLARE @File_Exists INT
----------------------------------------------------------
DECLARE @FileName NVARCHAR(50)
SET @FileName='IO'
----------------------------------------------------------
SET @FileName='C:\'+@FileName+'.sys'
EXEC Master..xp_fileexist @FileName, @File_Exists OUTPUT
SELECT @File_Exists as Existss,@FileName as FileNames
SET @FileName=@FileName+'sys'
EXEC Master..xp_fileexist @FileName,...
July 25, 2006 at 2:14 pm
Payment Types: (reference No , PaymentId)
Cash Payment: (paymentId, cashPaymentDate, cashReceiptsNo)
CreditCardPayment: (paymentId, expiration Date, card Name, authorization Date)
ChequePayment: (paymentId, locOut, bank Name, branch...
July 25, 2006 at 1:58 pm
yep you can t do that
you have to prepare file name before in a variable
SET @FileName='E:\Development\Emp\'+@FileName+'.txt'
EXEC Master..xp_fileexist @FileName, @File_Exists OUTPUT
July 25, 2006 at 1:50 pm
declare @periodo_inicio as datetime
declare @periodo_fim as datetime
declare @periodo_temp as int
declare @periodo_temp2 as decimal(12,2)
declare @periodo_temp3 as int
declare @periodo_colA as varchar(20)
declare @periodo_colB as varchar(20)
set @periodo_temp = 1
DECLARE periodo CURSOR FOR
SELECT DISTINCT *...
July 25, 2006 at 1:30 pm
EXEC Master..xp_fileexist 'E:\Development\Emp\@FileName.txt', @File_Exists OUTPUT
ya after a closer look .... this file DOESN T EXISTS
this one might
EXEC Master..xp_fileexist 'E:\Development\Emp\'+@FileName+'.txt', @File_Exists OUTPUT
July 25, 2006 at 12:17 pm
both files? the format and source file ?
I tried the statement and it works fine ... the problem is somewhere else...
Did you HARDCODED the file name for testing purposes?
July 25, 2006 at 12:07 pm
is weired that someone mixed data like that...
Take a look at SET DATEFORMAT and run that query again the problem might be that you preferences are in different format than...
July 25, 2006 at 11:59 am
can t jump to else if return value is 1
the problem is that when you test you use a USER that has access...
July 25, 2006 at 11:51 am
SELECT * FROM B
WHERE
NOT((B.type = 'IN' AND (ISNULL(B.IN_Opening_Stock,0) = 0 AND (ISNULL(B.sp_Int_Cum_Actual,0) = 0 AND (ISNULL(B.sp_Int_Projected_Tonnes,0) = 0) OR
(B.type = 'OP' AND (ISNULL(B.OP_Month_Tar_Prod_Ton,0) = 0) AND (ISNULL(B.OP_Actual_Production,0) = 0...
July 25, 2006 at 11:47 am
-did you check if the file really exists?
-the executing user has required security rights to access the file?
July 25, 2006 at 11:37 am
If @File_Exists=1
BEGIN
TRUNCATE TABLE SIRSInput
EXEC('BULK INSERT Emp FROM ''E:\Development\Emp\'+@FileName+'.txt''
WITH (formatfile =''E:\Development\Emp\InputFormat.fmt'')')
END
ELSE
BEGIN
RAISERROR ('File does not exist!', 16, 1)
END
July 25, 2006 at 10:18 am
DECLARE @t TABLE(fee_earner_id INT, fees MONEY)
INSERT INTO @t
SELECT 123, 23.54 UNION ALL
SELECT 245, 0.03 UNION ALL
SELECT 345, -0.46
SELECT fee_earner_id,CASE WHEN ABS(SUM(fees))<0.5 THEN 0 ELSE SUM(fees) END AS fees
FROM @t
GROUP BY...
July 25, 2006 at 10:05 am
you can t write this (as you saw allready)
IF #lmreport.terrid='T' <------- error here
if you want to test if there is any terrid equal...
July 25, 2006 at 9:38 am
Viewing 15 posts - 61 through 75 (of 321 total)