>>>>Is SQL Running on the same computer you are trying to BULK Insert from?
Not the server, the user simply has a client install where they're using Analyzer to talk to a remote server to insert records into a table they created
Ex. Here at the office, I have a workstation (let's call it...
for some reason, SQL cannot open the file below. I checked the path and in the run prompt it opens fine. It's a synax error I think but the error doesn't say, it's just a generic error:
BULK INSERT tablename FROM 'c:\Documents and Settings\sss\Desktop\myfile.txt'
How can I tell the scheduler to run at certain times for specific time zones in SQL Server 2000? I don't see a time zone option, just daily, weekly, etc. then times
In my query below, is HAVING cb.CurrentBalance <> SUM(rf10.rmstranamt10) - SUM(rf.rmstranamt)
the same as the value that my CASE statements come up with for [balance] ?
Isn't putting straight SUM(rf10.rmstranamt10) - SUM(rf.rmstranamt) overriding what I want to be there which is:
HAVING...
I sorry, I made a mistake explaining, LET'S start over.
If I have incoming values of
rmstranamt rmstrancde
50.00 51
50.00 51
50.00 51
50.00 51
50.00 51
50.00...
crap, I should have this instead
SELECT RMSFILENUM,
RMSTRANCDE,
SUM(
CASE WHEN rmstrancde IN ('50','51','52','53') AND rmstranamt < 0 THEN
rmstranamt
WHEN rmstrancde IN ('50','51','52','53') AND rmstranamt >= 0 THEN
-ABS(rmstranamt)...
Here's the SUM portion of my code:
INNER JOIN
(
SELECT RMSFILENUM,
RMSTRANCDE,
SUM(
CASE WHEN rmstrancde IN ('50','51','52','53') AND rmstrancde < 0 THEN
rmstranamt
WHEN rmstrancde IN ('50','51','52','53') AND rmstrancde >= 0...
SUM(
CASE WHEN rmstrancde IN ('50','51','52','53')
THEN (0 - ABS(DISTINCT rmstranamt))
WHEN rmstrancde IN ('55','56','57','58')
THEN ABS(DISTINCT rmstranamt)
ELSE
DISTINCT rmstranamt
END
) As rmstranamt
ERROR...
What I want to do is because I cannot perform cursor transactions inside an INNER JOIN, I need to take the following portion out below and throw that filter into a temp table first at the very top of my entire stored procedure.
Then I need to reverence that temp table instead of teh RFINAL...
Ok, then how can I take that query in my first inner join, just the first select and the CASE statement and put the results into a temp table at the very beginning of my stored proc. Then the rest of my main query can use the temp table results instead of RFINANL
I have to set the value in rmstranamt based on rmstrancde before I sum up rmstranamt
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
alter PROCEDURE [dbo].[Balance_Query]
AS
SELECT rm.rmsacctnum,
rf.rmstrancde,
SUM(rf.rmstranamt) AS [Sum rmstranamt]...
I am trying to do a cursor and such in one of my INNER JOINS which is part of a bigger SQL statement. I am getting the following errors:
Msg 156, Level 15, State 1, Procedure Balance_Query, Line 61
Incorrect syntax near the keyword 'DECLARE'.
Msg 137, Level 15, State 1, Procedure...
got it resolved FINALLY, this one was a pain in the tush:
INNER JOIN
(
SELECT RMSFILENUM,
SUM(distinct rmstranamt) AS rmstranamt10
FROM RFINANL
WHERE RMSTRANCDE = '10'
GROUP BY RMSFILENUM
) AS rf10 ON rf10.RMSFILENUM = rm.RMSFILENUM
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.