Forum Replies Created

Viewing 15 posts - 466 through 480 (of 851 total)

  • RE: Bulk Insert ignores {CR}{LF} at the end of Row1

    [font="Verdana"]Well, I haven't been able to make it work. If you can, let me know! :D[/font]

  • RE: Calculating next due date.

    [font="Verdana"]Reiterate: expecially where holidays are concerned, use a Calendar table.

    Although having said that, holidays can differ depending on location. They get a little tricky.

    [/font]

  • RE: Group by date, avg(Value) not working

    [font="Verdana"]No, I think that's eliminated it as being a date format issue. Have you had a look at the query plans both for the query and for running the...

  • RE: Group by date, avg(Value) not working

    [font="Verdana"]Rather than convert to varchar and back again, can you try the following?

    dateadd(dd, 0, datediff(dd, 0 [DateTime]))

    I'm not sure whether that will resolve the problem, but it's a better way...

  • RE: Importing EBCDIC

    [font="Verdana"]I've been playing around with this for days, and I'm about to give up. I think what I will do is get the packed decimal fields written out as...

  • RE: Bulk Insert ignores {CR}{LF} at the end of Row1

    [font="Verdana"]So far as I can tell, bulk insert (and bcp) expect all of the records in the file to match the format, irrespective of whether they are actually loaded. ...

  • RE: Building a dynamic SQL statement

    [font="Verdana"]Yeah, I forgot... SQL Server just needs white space to separate statements, not actually a semi-colon or carriage return. I'm trying to use semi-colons consistently these days (mostly...

  • RE: Building a dynamic SQL statement

    [font="Verdana"]I considered doing something like that, but he said he didn't want to use temporary tables, so I excluded table variables as well.

    BTW, don't you need a semi-colon or carriage...

  • RE: Building a dynamic SQL statement

    [font="Verdana"]I would use something similar to the following (remembering that it is possible to have more than one log file per database.)

    Note code is untested!

    declare @databaseName sysname;

    declare @sql...

  • RE: dynamicT sql

    [font="Verdana"]Doh! I need to read questions better. No, that won't work because you are doing a subsequent exec(). You could get it to work by using sp_executesql...

  • RE: dynamicT sql

    [font="Verdana"]Actually, why do you need the quotes around the @object at all?

    set @sql = ''select substring(@object,3,1)''

    ... should work.

    [/font]

  • RE: BCP : Only write the file when there is at least 1 row?

    [font="Verdana"]I think the "if exists" needs to go in the procedure that calls BCP. So you would change your logic as follows.

    Your current procedure will be something like this:

    ...

    exec...

  • RE: CAST Statement - Month Conversion

    [font="Verdana"]Can I put my hand in the air and recommend a Calendar table? It's a specialised version of a Tally/Numbers table, and you can do all the necessary date...

  • RE: Why INSER INTO ... UNION ALL?

    florian.reischl (3/10/2009)


    Strange...! I tried on SQL Server 2005 in our company and on my SQL Server 2008. The single inserts are always faster than the union syntax..?

    [font="Verdana"]Probably dependant on the...

  • RE: Inner Like Join?

    [font="Verdana"]You could use substring and UNPIVOT to take the data from the form

    User1-AB

    to:

    User1 A

    User1 B

    That would then simplify the join. I'd do the UNPIVOT as a CTE.

    [/font]

Viewing 15 posts - 466 through 480 (of 851 total)