Forum Replies Created

Viewing 15 posts - 31 through 45 (of 54 total)

  • RE: Formatting in BCP

    It sounds like you need to generate a fixed length format text file for upload to the mainframe. If so, you need to concatenate all the fields into one, giving...

  • RE: Query

    Though SQL is probably not the ideal environment to code this query as you are trying to format data, here is some code that might be want you are after.

    /*...

  • RE: Conditional Counts

    Here is a way without temp table or union.

    SELECT CONVERT(varchar(10), TD.CreatedDateTime, 101) AS BusinessDate

    , sum ( case when TT.ShortDescription IN ('TN','TB','RN') then 1 else 0 end...

  • RE: Insert Record based on Insert Trigger

    Using  derived table [AddTaskList] gives all the additional tasks to be also inserted, and then only inserted

    when the Problem_Category is of the given value.

    /* code */

    create trigger tr_HlpDsk_AdditionalTask on...

  • RE: sp3 vs sp3a

    One of the things I read when SP3a first come out was that is was released due to the installation process failing when applying normal SP3 on Windows 2003 Server....

  • RE: local variable - any limitations of max characters?

    use

    print @test-2

    rather than

    select @test-2

    so that you do not have to concern yourself with the maximum column limit set within the Query Analyzer Results option.

     

  • RE: Transferring 7 GB Database

    Another alternative would be to compress the database dump  or detached mdf/ldf using something like WINRAR or WINACE. This may get the archive file down to less than 700mb -...

  • RE: How to monitor SQL Server instance up or down

    SRVINFO.EXE is on the Windows Resource Kit CD.

    Summary of the utilities on this CD (part of Technet) is available at:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;158388

  • RE: leading zeroes

    A technique I have used regardless of programming language when wanting to display a numeric with leading zeroes, goes a bit like this:

    right( str ( 10 ^ 7 + fld...

  • RE: Missing numbers

    A cursor is one way of locating the first unused number. Another way is to use the powers of MSSQL and sets.

    Try this code.

    -- sample table

    create table sample ( range...

  • RE: Dynamic SQL problem

    The values being passed as parameters are literals, yet as you construct your where clause their value will be assumed to be another field name for character strings when the...

  • RE: Select Progressive Number, Re-visited

    Here is a technique to get the next sequence number to assigned to new records. Hopefully the three parts to the code become self-explanatory.

    The updating the next sequence number to...

  • RE: looping through table and extract data to a file

    Yes, there are possible workarounds.

    #1. You are already passing in the table name. Given the table name you will know which field contains the date. Use the If-Else clause...

  • RE: looping through table and extract data to a file

    Only two changes are necessary to the above code to allow it to be converted a stored procedure that accepts the table name to process. assumes the parameter name is...

  • RE: looping through table and extract data to a file

    Yes, you can check for the successful operation of bcp.

    There are multiple ways. However I will show you one contained purely in t-sql.

    This requires you to capture the results...

Viewing 15 posts - 31 through 45 (of 54 total)