Forum Replies Created

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

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: BCP Utility Main Purpose

    JC-3113 (11/10/2009)


    Hi GSquared

    if i restore a table, are the index(s) also restored with it, or do I have to do additional steps ?

    Thanks

    Jim

    If a table was dropped, it's indexes went...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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