Forum Replies Created

Viewing 15 posts - 61 through 75 (of 151 total)

  • RE: select date

    Between can be dangerous for the reasons stated. Given the column value is a datetime (or smalldatetime for that matter), I believe using DateDiff() is going to offer the best...

  • RE: getting where clause for views

    While technically possible, I don't believe it would be easy... it would involve twisting through sysdepends, sysobjects, and syscomments at the very least. This leads me to ask a couple...

  • RE: getting where clause for views

    So, Amrita... it sounds like what you really want is to find a way to query the META definition of the view itself to discover what WHERE clause VALUES for...

  • RE: Summing up Specific Values

    If I understand the request correctly, Vasc, I think he wants it t'other way 'round:

    SELECT  ThisName,

      Sum(CASE WHEN nStatus = 3 THEN nSpeed ELSE 0 END),

      Sum(nTotal)

    ...

    --SJT

  • RE: limmit the decimal points

    If you're trying to round: Round(1.2345678,2). This returns 1.23. Note that Round(1.2356789,2) returns 1.24. Is that what you're after?

  • RE: Update Statement Not Working

    Actually, I think noeld has the right idea. The code is simply updating a variable in memory, not a column in the table itself!

    -SJT-

  • RE: Using the IN operator with a variable

    Another, perhaps cheesy bit of ad-hoc-ery works:

    DECLARE  @TheseValues varchar(100)

    SET @TheseValues = 'VAL1,VAL2,VAL3'

    SELECT  <ColumnNames>

    FROM  <TableName>

    WHERE  PatIndex('%' + <ColumnName> + '%',@TheseValues) > 0

    My $0.02. The commas aren't really required in this case, but serve to make it...

  • RE: Case in Where with Null

    What happens when you remove the IS from:

    IS NULL -- HERE is the problem

    ?

    SJT

  • RE: Using Fetch--Help

    Shelley,

    Frank is asking for a post of the table structures involved in the operation you're trying to perform... that way we might be able to find a non-cursor-based solution.

    SJT

  • RE: xp_sendmail - Formatting the query output

    You could use @attach_results = 'true' with your @width setting to pretty up the output. I'm not seeing a way to make the results in a simple, truly delimited format. If...

  • RE: xp_sendmail - Formatting the query output

    If you want a tab as your separator, would '\t' work? Also, can you RTrim() the whitespace out of your columns to shorten up the display?

    2 cents,

    SJT

  • RE: bcp not working properly

    A couple things to check:

    What is returned from Query Analyzer when you run select * from fms_out_cf order by out_seq_num against the target database?

    If it is, in fact, only 340...

  • RE: write multiple lines to DOS file with xp_cmdshell

    Maybe silly, but if your input strings are short enough you could use the | operator to separate several commands on one line:

    line 1 > C:\outfile.txt|line 2 >> C:\outfile.txt|line 3 >>...

  • RE: Who uses RIGHT JOIN?

    bp,

    I tend to avoid RIGHT OUTER JOIN when I can. I think if I find it's needed I'm usually trying to make a query do too much at once.

    I have...

  • RE: Bulk Insert from Excel to sql server

    Okay, I'll bite.

    In Enterprise Manager, click on Tools, Data Transformation Services, Import Data...

    Follow the wizard.

    For more information, search Books Online for DTS Import/Export Wizard.

    --SJT

Viewing 15 posts - 61 through 75 (of 151 total)