Forum Replies Created

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

  • RE: Best way to insert records from a CSV file

    Glad to know you got it figured out. BTW, BCP format file issues are a pain to understand 🙂

    You can use the http://msdn.microsoft.com/en-us/library/ms191479.aspx MSDN article to understand the format better.

    mpdillon...

  • RE: Best way to insert records from a CSV file

    Can you show us the code you used to import into your staging table?

    mpdillon (7/15/2010)


    Steve,

    I have stumbled upon a half a##ed solution. If I first import the whole csv file...

  • RE: Best way to insert records from a CSV file

    I believe you need to give each column a name.

    mpdillon (7/15/2010)


    It seems to me that the formatfile should look more like

    9.0

    10

    1 SQLCHAR 0 0 "," 0 ""

    2 SQLCHAR 0 0 "," 2 TimePoint ""

    3 SQLCHAR 0 0 "," 3 rtPrice ""

    4 SQLCHAR 0 0 "," 0 ""

    5 SQLCHAR 0 0 "," 0 ""

    6 SQLCHAR 0 0 "," 6 daPrice ""

    7 SQLCHAR 0 0 "," 0 ""

    8 SQLCHAR 0 0 "," 0 ""

    9 SQLCHAR 0 0 "," 9 versifyId ""

    10 SQLCHAR 0 0 "\r" 10 extermalNodeID ""

    If I do not include all the columns from the...

  • RE: Best way to insert records from a CSV file

    Pat, you will still need to use the full file definition you posted. The format file still has to define each column but when you use OPENROWSET, you can only...

  • RE: First Record being skipped

    If you know of a record that is not being returned, change your INNER JOINs to LEFT JOINs and look for any NULL values when you query for the specific...

  • RE: SP and function dependencies

    If you are running SQL 2008, you can use sys.sql_expression_dependencies to determine the dependencies.

    We use the following code to build the objects in the correct order. Of course, this can...

  • RE: sp_MSforeachdb bombs BC boss named a DB 'CROSS'

    Since this has happened, you'll need to remember to encapsulate the DB name with [] every time it's used. If you use other 'dynamic scripts', make sure you check that...

  • RE: Pivoting based on bit column

    Are these user-defined or static values? It looks like each insert is going to produce 6 records for each QuestionID. Have you thought about expanding the table to handle each...

  • RE: Performance drop off with TOP X

    CirquedeSQLeil (3/15/2010)


    As an option, try the below changes.

    ;WITH Excpt

    as

    (

    SELECT

    A.DetailID,

    A.ClaimID,

    B.MCareNo

    ,Row_Number() over (Order by a.detailid) as RowNum

    FROM dbo.udf_GetDetailsAsOfTaskListID(17, 0) AS A

    LEFT JOIN dbo.udf_GetClaimsAsOfTaskListID(17, 0) AS B

    ON A.ClaimID = B.ClaimID...

  • RE: 2008 Restoring backup of original database on original server error

    Gatekeeper (1/13/2010)


    The FULL I was trying was most likely a COPY_ONLY (during our initial testing three months ago)

    Figured it out. The message we correct the first time of it being...

  • RE: 2008 Restoring backup of original database on original server error

    Lynn Pettis (1/13/2010)


    Not if there was an earlier, valid, full backup.

    Example:

    Full Backup -- Base for Log and Differential backups

    Diff --...

  • RE: 2008 Restoring backup of original database on original server error

    Whoops, wrong window on the copy and paste but makes me wonder if the initial FULL was done with the improper arguments. But had that been the case, wouldn't the...

  • RE: Convert String to a Table using CTE

    We use the following function and it works quite well. It will return 'empty' items in the string array as well as handle single item strings without the delimiter. However,...

  • RE: T-SQL Parsing Crazy Eights

    The only reason I got it right was because it was multiple choice and eliminated the others. I had no idea the parser was nice about putting non-numerical values after...

  • RE: SQL LEN Function

    Manie Verster (9/11/2009)


    When I pasted the result in here directly from ssms I saw that there was actually a space at the end but what stumps me is the fact...

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