Forum Replies Created

Viewing 15 posts - 1 through 15 (of 77 total)

  • RE: excluding nulls from a table

    I agree with Jerry, it is better to change the function to handle the nulls. Changing the function to handle the nulls makes it so that if you pass in...

  • RE: Substring function for name

    This is actually a tough question as you never know how the names are formatted or if there are two names for the last name such as "Van Allen".

    Here...

  • RE: Need help on performance and integrity

    Thanks for posting the sample data and DML.

    I'm not clear on what you want the output to be. If you can post that maybe we can come up with...

  • RE: conditional date check on inserting / updating and having unique rows only

    Try this...

    IF NOT EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS

    WHERE TABLE_NAME = 'YourTableName'

    ...

  • RE: Maintenace Plans using T-SQL

    Now, I get to slide out from under the egg... I was thinking that you would use a regular SQL Job with steps created manually rather than the Maintenance Plan...

  • RE: Maintenace Plans using T-SQL

    Create the first plan, script it out with Enterprise manager and then change the database name to $(DBName). Save the script to a file. Now create a batch file that...

  • RE: What does 2 periods after DB name mean?

    While SQL Server allows this I feel it is a bad practice to have production code to run it. Here is why.

    When SQL sees this syntax it will first...

  • RE: Move indexes back to primary file

    Wait a minute. That script doesn't work correctly if there is more than one field in the index.

    Try this.

    SELECT CREATE_INDEX_SQL

    FROM (

    SELECT TBL_NAME = o.name,

    INDEX_NAME =...

  • RE: Using Column Values from Table to Query Another Table

    Very sneaky way to case the union in there Barry. I like it!

  • RE: Midnight Date Function

    You can also use this...

    SELECT convert(datetime,convert(varchar,GetDate(),10))

    Just replace the GetDate() function with your passed in value.

    It would be interesting to see what performed better. 😉

  • RE: Help needed with a CASE

    I would try this. Note that I'm only checking for existence in the case statement based on the left joins. I also removed your UDF in favor of the builtin...

  • RE: BULK Import

    Noel,

    That certainly works, but in our ETL system, the format file would be just one more thing for the Operations team to lose. Also, this way we can simply do...

  • RE: Return all rows where one is a match

    I would probably write this as follows. No subquery needed... 🙂

    SELECT

    oh.order_no

    , od.order_line_no

    , od.product

    , od.quantity

    FROM...

  • RE: BULK Import

    What I do in this situation is to create a view without the ID column and BCP/BulkInsert into that. Make sure to set permissions correctly on both the base table...

  • RE: Using LIKE with variables in a SP

    Why not just do this inline?

    WHERE

    srl.QuantityReceipted > 0 AND

    ...

Viewing 15 posts - 1 through 15 (of 77 total)