Forum Replies Created

Viewing 15 posts - 1,201 through 1,215 (of 3,543 total)

  • RE: Need a Help in Importing CSV file into DB

    Ooops!

    Thanks Wayne, forgot about that in my haste. :blush:

  • RE: Need a Help in Importing CSV file into DB

    CREATE TABLE #header (Data varchar(max))

    CREATE TABLE #result (dummycolumn int)

    BULK INSERT #header FROM 'C:\TEMP\CSV1.csv' WITH (DATAFILETYPE = 'char',ROWTERMINATOR = '',LASTROW = 1)

    DECLARE @sql varchar(max)

    SELECT @sql = COALESCE(@sql+',['+SUBSTRING(Data, N, CHARINDEX(',', Data +...

  • RE: Table Value Function

    GSquared (10/29/2010)


    To answer the original question, yes, wrapping a script into a UDF does usually cause a performance hit all by itself. But, it's usually in terms of about...

  • RE: Ordering by month, show name

    Grant Fritchey (10/28/2010)


    Jeff Moden (10/28/2010)


    Task complete. Submitted article via "Write For Us".

    Over-achiever.

    Meh! Jeff probably hasn't heard the saying 'Nobody likes a smart a$$' 😛

  • RE: Using a query to return the next Sunday

    doug 40899 (10/27/2010)


    David,

    Then can you give me an example of max being used? This query is being included in an application that's being built and if I can improve it...

  • RE: Using a query to return the next Sunday

    doug 40899 (10/26/2010)


    G,

    It might but since I already have this in place and I'm going to be using the variable anyway, why not use it for this as well.

    Doug

    Notwithstanding...

  • RE: BCP in

    jez.lisle (10/26/2010)


    David Burrows (10/26/2010)


    Do you have a proxy set up for xp_cmdshell?

    If so does it have access to the file?

    Sorry I dont know what you mean, how would this be...

  • RE: BCP in

    Do you have a proxy set up for xp_cmdshell?

    If so does it have access to the file?

  • RE: Are the posted questions getting worse?

    Wow! All these negative vibes :pinch:

    I come in this morning and the thread has gone serious :angry:

    Now I have to find a dark room to lay down and contemplate a...

  • RE: Split unique record into multiple records.

    Try using DelimitedSplit8K function described here and the following query

    SELECT test.CuS_id, split.ItemNumber, split.Item

    FROM test

    CROSS APPLY

    (

    ...

  • RE: Compare 2 fields in the same table Using LIKE '%[fieldname]%'

    askquestions (10/8/2010)


    This is why I was thinking of something to check each “fullname” against the corresponding “surname” - if the surname does not exist as a string in the fullname,...

  • RE: Parameter in select statement

    Another alternative (although will cause a scan)

    SELECT VendorId

    FROM Vendors

    WHERE CountryId = @CountryId

    AND CHARINDEX(','+CAST(CityId as nvarchar(10))+',',','+@CityId+',') > 0

    ORDER BY CreatedDate

  • RE: ORDER BY based on condition

    UMG Developer (9/30/2010)


    scott.pletcher (9/30/2010)


    Technically you don't have to manipulate the date in the table. For a million+ row table, you save a million+ calcs 🙂 :

    Duh. I was so...

  • RE: ORDER BY based on condition

    Or...

    ORDER BY SIGN(DATEDIFF(day,GETDATE(),EventDate)) & 0x80000000 DESC,EventDate ASC

  • RE: T-SQL help to convert rows to columns

    sangeethu (9/9/2010)


    Hi Lutz,

    Thanks for the reply. I have gone through Cross Tab and Dynamic Cross tab and found that it involves aggregation of a column. But in my case every...

Viewing 15 posts - 1,201 through 1,215 (of 3,543 total)