Forum Replies Created

Viewing 15 posts - 5,926 through 5,940 (of 7,187 total)

  • RE: compare values in consecutive rows

    OK, hopefully this should get you started. Please post again if there's anything you don't understand.

    You can use ROW_NUMBER or RANK (read about both of them and decide which...

  • RE: Help on my query

    You're going to have to try harder than that if you want any of us to be able to help you. Please show us what you tried, and state...

  • RE: compare values in consecutive rows

    Romakanta

    I'm confused - you say VehicleID is unique, and then you say there are duplicates. Also, the word "consecutive" only has any meaning if you define how the rows...

  • RE: Help on my query

    You will need to use a LEFT JOIN so that you get all the logins, and not just the ones with server roles. The query you have written will...

  • RE: list of values in input parameter

    I assume @parameter is a comma-separated list, or something similar? If that's the case, see Jeff Moden's article on "Numbers" or "Tally" tables for a solution to this.

    http://www.sqlservercentral.com/articles/TSQL/62867/

    John

  • RE: Table Design

    bcronce (5/7/2008)


    Here's a question. Would overall performance be better when joining on a dept id vs name because of the comparing of int vs string? I would assuming other tables...

  • RE: Combine two rows of data into one

    There may be a better way, but my first instinct would be to use CTEs (or further temp tables) to show (a) distinct combination of salesman and week (b) property...

  • RE: How to secure the database from hackers

    And if, as you seem to suggest, the application only runs SELECT statements, deny INSERT, UPDATE and DELETE permissions to the login the application uses.

    John

  • RE: Table Design

    Integrity is more important than shaving a few milliseconds off your processing time. With your current design, what's to stop someone inserting a row such as this?

    Corporate ...

  • RE: help with update statement

    Sorry, you're still not clear. What do you want to update the prices to? Do you want to update the price in all 5000 rows, or just those...

  • RE: Disallowed constructs while creating Index on a view.

    Try turning the subquery into a derived table and joining to it.

    John

  • RE: Is XML the Answer?

    Someguy (5/2/2008)

    Wrong: The things for which XML is useful are make it VERY useful. It provides a standard for inter-system communication that allows developers to avoid re-inventing the wheel for...

  • RE: Unstable query performance

    If it's a complex query then it's possible that most of those 30 seconds are taken compiling a new execution plan. This would explain why it takes 30 seconds...

  • RE: Replace WHERE IN...WHERE NOT IN... by INNER JOIN / OUTER JOIN

    Rob

    I think your first query is actually equivalent to this:

    SELECT mpe.din, mpe.pkgsize, mp.client, mc.active

    FROM

    ...

  • RE: splitting out a column

    Or this one, which uses less string manipulation, but does contain dynamic SQL:

    --Data

    declare @table table(col1 varchar(5), col2 varchar(200), col3 varchar(10))

    declare @sql varchar(1000)

    INSERT INTO @table VALUES ('Mut1',

    'AZ5397UA9,AZ539CYK2,AZ54022Z3,AZ8040BQ1,AZ0442BB0,AZ2404AW1,AZ307TAD0,AZ442FAE8,AZ442FAQ1,AS490FAV1',

    'Credit1')

    INSERT INTO @table VALUES ('Mut2',

    'AZ5397UA9,AZ539CYK2,AZ54022Z3,AZ8040BQ1,AZ0442BB0,AZ2404AW1,AZ307TAD0,AZ442FAE8,AZ442FAQ1,AS490FAV1',

    'Credit2')

    SET...

Viewing 15 posts - 5,926 through 5,940 (of 7,187 total)