Forum Replies Created

Viewing 15 posts - 10,306 through 10,320 (of 13,461 total)

  • RE: sql query question

    this is an excellent question that trips up a lot of people.

    try both of these queries and see the results should be different:

    select * from table a

    left outer join table...

  • RE: Rounding - Is there a better way

    MrT I'm not sure what the final objective is, but this is the first thing i thought of;

    DECLARE @VariableA DECIMAL(7,4)

    SELECT @VariableA = 7.0449

    SELECT CEILING(@VariableA * 100.0)/100.0

    SELECT @VariableA = 7.0001

    SELECT CEILING(@VariableA...

  • RE: Date and Time Issue in script - removing time and leaving date only

    the way i usually do it is like this, which keeps everything in the same datetime datatype with no conversions, and effectively strips/zeros the time portion:

    --Midnight for the Current Day

    select...

  • RE: Compare two tables ("AND")

    looks an awful lot like homework, so lets see what you've done so far;

    we need to help you learn the concepts, and not do the work for you.

    did you actually...

  • RE: String Parsing Hell

    i thought maybe using the PARSENAME function might get you to where you wanted...tis is still sorting as text, we could change that a bit, but i thought this was...

  • RE: Four-Part Name

    assuming your linked server was aliased as "MyOracle" this command should help:

    --list all the tables and their names

    EXEC sp_tables_ex MyOracle

    GO

    we have a "model" kind of schema withthe user "CHANGE_ME" as...

  • RE: T-SQL code to group data into comma delimited column

    ugg...i was pasting an example that uses the FOR XML to resolve this, and realized you posted in a SQL 2000 forum.

    the best way is to use the trick that...

  • RE: Can anyone define a value of 65536 in master.dbo.sysdatabases.status?

    shew (11/18/2009)


    Sorry, I'm looking for a "65536" hit on the status column, rather than the status2 column.

    look at the post again...the code for reading the status column is a...

  • RE: Linked Server Excel Sheet (tab) names

    yes...

    exec sp_tables_ex LinkedServerName

    that will show all the sheets(tables) that exist in the Excel spreadsheet...or any other linked server for that matter. that retrieves the metadata from whatever linked server...

  • RE: what swrong with this

    Lynn Pettis (11/12/2009)


    Geez, Lowell, you take all the fun out making the OP tell us what the problem is... 😉

    mea culpa; it was low hanging fruit and i'm try...

  • RE: what swrong with this

    syntax.

    a case statement has only a single CASE keyword between the CASE and END,

    ie

    CASE

    WHEN [condition1] THEN [value]

    WHEN [condition2] THEN [value]

    ELSE [value3]

    END

    you can look...

  • RE: How to hold Database Name in a variable and use it with USE keyword

    to get the table counts, i see you'll have to loop thru everything one way or the other;

    here's one way to do what you asked...i'm using sp_msforeachdb, which uses a...

  • RE: Help with optimizing stored procedure

    oops sorry i misread your code...i thought @KeyWhat was which field,@keywhere was the value...i updated my code, but it's not what you wanted...except if they only use one of the...

  • RE: Help with optimizing stored procedure

    at the very least, you can get rid of the OR statements, correct?

    it looks like your application picks two search terms, but your current WHERE statement you build searches 8...

  • RE: Help with optimizing stored procedure

    the problem is you have a "do all find all" procedure. it has tha couple of problems:

    multiple OR statements.

    LIKE statements that start with a percent sign.

    with multiple OR...

Viewing 15 posts - 10,306 through 10,320 (of 13,461 total)