Forum Replies Created

Viewing 15 posts - 2,431 through 2,445 (of 3,543 total)

  • RE: cummulative sum

    Following on from Frank's post

    select t1.c2, sum(t2.c2) as [RunningSum]

    from #rt t1

    inner join #rt t2

    on t2.c1 <= t1.c1

    group by t1.c1, t1.c2

    order by t1.c1

    Has the table...

  • RE: Stored Procedure to Copy from 1 table to another

    CREATE PROCEDURE usp_copy_session

        @SessionID int,

        @UniqueID int

    AS

    INSERT INTO

    (UniqueID, QuestionID, ColumnID, Answer)

    SELECT @UniqueID, QuestionID, AnswerID, Answer

    FROM

    WHERE SessionID = @SessionID...

  • RE: ORDER BY varchar data type

    Probably too late but I posted this solution in another thread with the same question

    order by cast(

    (case when patindex('%[a-z]%',[col]) = 0

    then [col]

    else left([col],patindex('%[a-z]%',[col])-1)

    end) as int),[col]

  • RE: Question of the Day for 05 Jan 2005

    I picked the right answer which was recorded as wrong, now that the wrong answer has been changed to the right answer, I now have the correct answer and 1 point...

  • RE: Question of the Day for 06 Jan 2005

    It has a .PNG (Portable Network Graphics) extension

    Displays OK in IE 6

  • RE: Importing a ''''multiple'''' space delimited text file into SQL

    Is the file 'Fixed Field Length', that is each column is the same width which would describe your problem as the number of spaces would vary depending on how many...

  • RE: counts in SQL

    What do you mean by 'empty' (null, zero?)

    This will check for NULL

    SELECT

     h.client,

     count(*)  as Count_Total_Slots,

     SUM(CASE WHEN h.Value IS NULL THEN 1 ELSE 0 END) as Count_Free_Slots

    FROM database1.dbo.Hardware...

  • RE: Decorum in the Forums

    I agree Andy, I have seen some threads go 'cold' (I think this a minority though) which means you do not know if the solution(s) worked or not or whether the...

  • RE: OSQL batch files

    All output, errors as well are put in the output, whether redirected or if using the -o parameter.

  • RE: OSQL batch files

    Add

    -m-1

    to your osql parameters

    Create your batch file like this

    CALL batchfile.bat servername databasename scriptname1.sql

    IF ERRORLEVEL 1 GOTO ER

    CALL batchfile.bat servername databasename scriptname2.sql

    IF ERRORLEVEL 1 GOTO ER

    CALL...

  • RE: How to find NOT TOP 3? (Next rows after row 3)

    quoteI did see the solution in this Forum

    If there is a solution then I'd be interested.

  • RE: need to execute bcp command through C#.net - URGENT

    Yes, for that to work the end user will have to have bcp.exe. What you could do is create a random filename file on the server, put the data into...

  • RE: SQL code to combine 2 queries

    Just tried again with my Access 2000 db and can save the query and run it OK. Wonder if it is something to do with your database that I have...

  • RE: need to execute bcp command through C#.net - URGENT

    By 'Local Drive' I am assuming to mean the client and not the server

    If so, then you have to run bcp via scripting in the html not in the code...

  • RE: How to find NOT TOP 3? (Next rows after row 3)

    One way is put the results into a temp table first with an IDENTITY column and then select based on the value of the IDENTITY column.

Viewing 15 posts - 2,431 through 2,445 (of 3,543 total)