Viewing 15 posts - 23,611 through 23,625 (of 26,486 total)
Two things, unfortunately I don't have time to actually write it myself as I am trying to leave for work.
You need to convert the From datetime to a character string...
November 21, 2008 at 6:57 am
Problem I see is if you are basing this off the last payment. Do you ever look back at the initial payment date?
November 21, 2008 at 6:51 am
For the most part, Jeff, I agree. However, the new TIME and DATE data types in SQL Server 2008 will make it easier to build date and time dimensions...
November 21, 2008 at 6:49 am
Nevermind, Gail beat me to it.....
November 20, 2008 at 9:44 pm
DECLARE @sql nvarchar(max);
DECLARE @FromDate char(8);
DECLARE @ToDate char(20);
DECLARE @PathFileName varchar(2000)
SET @FromDate = 20080101;
SET @ToDate = CONVERT(CHAR(20),GETDATE(),112);
SET @PathFileName = 'D:\SalesHis\SALES.'+@FromDate+'%''.txt'
IF @ToDate > @FromDate
BEGIN
...
November 20, 2008 at 9:41 pm
First, by adding the DISTINCT to your select statement in your cursor definition, you eliminated all duplicates.
Second, this will not scale to very large tables, and there is most likely...
November 20, 2008 at 9:39 pm
That makes sense. I guess I'll start following that lead as well.
November 20, 2008 at 9:19 pm
First of all, put the criteria for the delete in the delete statement and do it in a set-based manner, not a RBAR (Row By Agonizing Row) method.
Here is a...
November 20, 2008 at 9:15 pm
First, WHY?
Second, set based solutions in SQL Server will work faster and scale a lot better than a cursor based solution.
Please read the article below about how to post questions...
November 20, 2008 at 9:05 pm
So, after all of this, you are actually trying to get the end of each month?
November 20, 2008 at 9:01 pm
Sergiy (11/20/2008)
Christopher Stobbs (11/20/2008)
You can't use ROW_NUMBER() in SQL 2000 or SQL 7VARCHAR(MAX) either.
But it's used in the table definition.
Nice catch Sergiy! :w00t:
November 20, 2008 at 8:31 pm
Based on what you provided, however, this is where I would start:
insert into dbo.table (
...
November 20, 2008 at 8:23 pm
First, again, all the code is better than part of the code. In this case, however, I have a question, is this particular question based on a trigger fired...
November 20, 2008 at 8:16 pm
I have to agree with Jeff. Keep the temporary tables and figure out how to get rid of the RBAR in your code. It's all the looping that...
November 20, 2008 at 8:09 pm
Viewing 15 posts - 23,611 through 23,625 (of 26,486 total)