Forum Replies Created

Viewing 15 posts - 3,751 through 3,765 (of 4,087 total)

  • RE: Error

    It's just what it says, "The package failed validation." Presumably there is some other error message that gives more information about how it failed. We would need that...

  • RE: Need to match a number in SQL

    I think what you are looking for is

    WHERE field NOT LIKE '%[^0-9]%'

    The square brackets specify a subset of characters determined by the contained expression.

    The caret (^) at the beginning of...

  • RE: Product level to low

    The first error is probably caused by using an old version of dtexec. This will happen if you have both the SQL 2000 and SQL 2005 client tools installed...

  • RE: NULL Dates

    Stephen_W_Dodd (4/22/2011)


    UPDATE table SET dtField = NULL WHERE dtField = 0

    or maybe

    UPDATE table SET dtField = NULL WHERE dtField = 0 Or dtField = '' ?

    Remember dtField represents a...

  • RE: Urgent-------Export all tables in a schema to multiple textfiles in a pipe delimited format

    You could also try the undocumented stored procedure sp_msforeachtable.

    Drew

  • RE: Returning multiple fields in a subquery based on each row of the master query.

    You have a couple of choices. In this case, a CROSS APPLY is probably going to perform best, but you may find that a CTE with ROW_NUMBER() will perform...

  • RE: Stored Procedure/Function Calculation Optimization

    First, you have to remember that SQL is optimized for set-based operations while the language that you are translating from is most likely primarily a procedural language. Translating directly...

  • RE: User Defined Functions returning variable length strings

    From books online

    User-defined functions cannot be used to perform actions that modify the database state.

    The datatype returned by a function is part of the database state, so you can't write...

  • RE: Trying to Omit Columns With Zero Sum

    You're probably better off doing this in the presentation layer rather than in T-SQL. For instance, this is easy to do in SSRS by specifying the visibility property of...

  • RE: Trailing spaces in WHERE-Clause

    opc.three (3/17/2011)


    Using a binary collation was my initial thought. I suspect that adding the check for datalength will be slower than using the collation method but have not tested out...

  • RE: Searching a column for a word

    David Burrows (3/17/2011)


    Try this

    LIKE '%rate[!"'',.:;? ]%'

    You can add additional chars between [] but check LIKE and PATINDEX on BOL (Books Online) for special chars and how to ESCAPE them.

    You are...

  • RE: XML Grandchild Nodes - How to query?

    The problem is that you are using absolute paths on the original column when you should be using relative paths on the derived columns.

    SELECT stores.detail.value('(StoreName)[1]', 'varchar(50)') AS store_name

    ...

  • RE: Columns to Row?

    jason-772533 (3/14/2011)


    Hi Drew, Therein lies a small problem. I'm using a 2000 server, so can't use ROW_NUMBER as it's 2005 syntax!

    There is a separate forum for SQL 7.0/2000...

  • RE: Columns to Row?

    You'll probably want to use the ROW_NUMBER() partitioned by the Category for determining the columns. Before pivoting you'll have

    A Aardvark 1

    A ...

  • RE: Creating nested xml tree

    I'm not sure about other tools, but I've found that for creating complex XML structures using T-SQL, you're better off using FOR XML EXPLICIT instead of any of the other...

Viewing 15 posts - 3,751 through 3,765 (of 4,087 total)