Forum Replies Created

Viewing 15 posts - 3,361 through 3,375 (of 5,504 total)

  • RE: Update statement with multiple tables

    Would you please clarify your requirement?

    Are all those elements in your list columns, tables or something else?

    Do you really have two columns [updateflat] and [updateflag] or is it a typo...

  • RE: Collapsing a Table

    Jeff, are you saying a c.u.r.s.o.r. should be preferred instead of the "double-row-number" approach??

  • RE: Duplicate Record

    Would you please clarify what you're trying to do?

    Will you either end up without duplicates or do you want to insert duplicate values?

    If the former, follow Pablos advice. If the...

  • RE: Collapsing a Table

    Did you compare the performance of your solution vs. the other three methods posted so far?

  • RE: Primary Keys and FKeys

    To add an "it depends" opinion:

    I've read that there are cases when a PK-FK relation will help the query analyzer to come up with a more efficient plan. No sample...

  • RE: need help with doing a sum and selecting records

    Please provide table def and sample data in a ready to use format so we can focus on providing a tested solution instead of formatting the sample data.

    Furthermore, please include...

  • RE: how to show Output in single row.

    Please provide table def, sample data and expected result in a ready to use format as described in the first link in my signature. Also. please provide what you've tried...

  • RE: Randomizing some data

    Disclaimer: I never had to do it, so my attempt might not really be a good solution...

    Here's how I'd do it:

    Assuming sample data like you provided I would generate two...

  • RE: Get the result of TOP N from a Flat file

    You could use bcp with -L option(last row).

    Set the field terminator to a non-existing character in that file (e.g. ~ or °) and import it into a table with only...

  • RE: nvarchar(max) truncated

    You should rethink the general structure of your query.

    Instead of using repeating queries with all but one parameter being equal you should look into CASE WHEN instead.

    Example:

    --instead of

    SELECT

    CAST(''Novembre''...

  • RE: Reading .TXT File

    To get the data into SQL server, look into bcp or OPENROWSET, maybe even linked server (depends on the -unknown- scenario).

    You could use CHARINDEX() and LEFT/RIGHT/STUFF to separate the two...

  • RE: TSQL Help: Display Row for 1 week on certain conditions, then roll off?

    I don't think you would violate any rules if you would provide a table structure with fake table and column names and fake data and fake results based on those...

  • RE: TSQL Help: Display Row for 1 week on certain conditions, then roll off?

    If you would provide table def for the tables involved, some sample data to work with and your expected result we might be able to provide you with a tested...

  • RE: Data type for a column with a decimal

    I still would use NUMERIC(?,1).

    Assume two version numbers: 10.1 and 4.1.

    Try to select the max. version number...

    DECLARE @tbl TABLE

    (

    num NUMERIC(4,1),

    stri VARCHAR(4)

    )

    INSERT INTO @tbl

    SELECT 4.1,...

  • RE: How to group consecutive months

    I don't understand the question...

    The UNION ALL is used to populate the sample table @tbl with the (unformatted) data you provided.

    Basically, you could use the query after the semicolon. Just...

Viewing 15 posts - 3,361 through 3,375 (of 5,504 total)