Forum Replies Created

Viewing 4 posts - 1 through 5 (of 5 total)

  • RE: SQL Server Distinct Join

    I Found It:

    Select min(PK), fld2,fld3,fld4

    from table1

    group by fld2,fld3,fld4

    it would work since I did not care which Pk is being returned.

  • RE: Joining one table with two others

    create a stored procedure with three parameters: @InvoiceNum, @InvoiceTotal, and @InvoicePayments

    in your sproc you need to write two sql queries, one to get the Total Invoice:

    SELECT @InvoiceTotal=SUM(b.strCost)

    FROM ...

  • RE: spooling a local variable

    Preview

    Try using echo:

    
    
    declare @lvar varchar(500)
    select @lvar='"@ECHO '+ @yourlocalvariable +' >> C:\YourOutputFile.txt"'
    exec master..xp_cmdshell @lvar

    Another way is to store your local var in a temp table and...

  • RE: ISQL

    Thanks

Viewing 4 posts - 1 through 5 (of 5 total)