Forum Replies Created

Viewing 15 posts - 106 through 120 (of 274 total)

  • RE: Incorrect Syntax Keyword 'With'

    SET @cmd = 'DECLARE TableCursor CURSOR FOR

    ...

  • RE: Incorrect Syntax Keyword 'With'

    ...

    SET @cmd = 'DECLARE TableCursor CURSOR FOR

    ...

  • RE: Find columns with no data

    Interesting. I wouldn't think even an EXISTS() column by column would be overall faster, but slower.

    Because, if at least one column has no data, you will have to scan...

  • RE: Find columns with no data

    Sorry, yes, I forgot to mention the table type.

    Scanning the table once for every column is huge extra overhead, of course. To do it that quickly, you have a...

  • RE: Find columns with no data

    Hmm, no reason it should arbitrarily stop, altho that method of concatening values can supposedly be flaky.

    Did you check the Query settings, to make sure it's not just a display...

  • RE: Find columns with no data

    I have a table with 207 columns, and very long column names, the average being approx 26 characters. The code you posted truncates the @sql at just...

  • RE: Find columns with no data

    You're welcome. Glad it helped!

  • RE: Find columns with no data

    Fill in your table name and uncomment the EXEC() when ready to go.

    DECLARE @tablename sysname

    SET @tablename = N'info' --<<-- put table name here 🙂

    DECLARE @sql varchar(max)

    SET

  • RE: Incremental pattern matching

    I suggest creating another table containing every possible 3-char value, clustered on that code (fillfactor 100). Then join to that table and find the first one that isn't in...

  • RE: Find columns with no data

    You could generate the needed code fairly easily from INFORMATION_SCHEMA.columns.

    You have to decide, though, what specifically you mean by "no data".

    Must the column be NULL?

    If it's a non-nullable...

  • RE: Select an ID that matches data from mutiple rows

    OOPS, right, I forgot to add a check against the count of the input values (I didn't test it, since I didn't have test data readily available):

    SELECT --add column name...

  • RE: Select an ID that matches data from mutiple rows

    I will assume that the input sequence of the DecisionIds does not matter -- as long as all match, it doesn't what order they were in.

    I think something like this...

  • RE: undo a sql statement

    Perhaps. I thought SQL would still back up all active parts of the log. I was trying to cover all possibilities, since otherwise OP is in for a...

  • RE: undo a sql statement

    Yes, you have to change the db recovery mode and do a full backup first (or tell SQL you have done one). Then you can do a log backup.

    And,...

  • RE: undo a sql statement

    Is the db is full recovery mode?

    If so, the old data is still on the transaction log.

    Software is available that can pull that data from the log. Unfortunately, I...

Viewing 15 posts - 106 through 120 (of 274 total)