Forum Replies Created

Viewing 15 posts - 181 through 195 (of 683 total)

  • RE: Removing empty carriage returns

    Well, I'm confused with this thread. Why not just this?

    select replace(@var, char(10) + char(13), '')

    This works on my machine. The string you gave is '1yxyx2yx3yxyx4yx5' where y = char(13) and...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: object_name(id) returning Null

    Could it all be permissions related?

    BOL (http://technet.microsoft.com/en-us/library/ms186301.aspx)...

    "built-in functions such as OBJECT_NAME may return NULL if the user does not have any permission on the object"

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Update statement

    Oops - yep I missed the ID :pinch: - glad I could help though 🙂

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Finding Date & time from a string

    Chris Morris (4/21/2008)


    RyanRandall (4/21/2008)


    This uses explicit conversion, rather than implicit[/code]

    Chris

    I don't see any implicit conversion. Are you suggesting that what I posted is implicit?

    Hi Ryan

    Not at all - CAST() is...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Update statement

    This would be a guess in the absence of more information. To put this together, I first focused on getting the data we needed from the COSTS table and in...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Update statement

    The query you will need will be much less complicated than this. If you post your table structure, and some sample data, it will be much easier and quicker for...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Simplified WHERE clause???

    Roy Ernest (4/21/2008)


    I would suggest you to use a Case statement over an OR clause.

    SELECT blah

    FROM blah

    WHERE IsValid = 1

    ...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Simplified WHERE clause???

    Lil Ms Squirrel (4/21/2008)


    I'm not sure I explained myself properly...

    If @SiteNumber = -1 then I want to return all records but if @SiteNumber has a value of one or greater...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Date Format

    select replace(convert(varchar(8), getdate(), 3), '/', '')

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Removing the JUNK Characters

    karthikeyan (4/21/2008)


    But Andras i dont want to use any functions. Because i dont have the permission to create functions.

    Yes. Tricky. Maybe you can do something along these lines...?

    select 'start' --needed...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Simplified WHERE clause???

    1 or -1? Anyway, here's one way...

    SELECT blah FROM blah WHERE IsValid = 1 AND (@SiteNumber = -1 OR SiteNumber = @SiteNumber)

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Finding Date & time from a string

    This uses explicit conversion, rather than implicit[/code]

    Chris

    I don't see any implicit conversion. Are you suggesting that what I posted is implicit?

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Order by Numeric value of a Varchar column Need a better solution

    I feel that we haven't quite pinned your requirements down yet. Maybe the sample data and query here will help...?

    declare @t table (TradeRef varchar(32))

    insert @t

    ...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: How to check the table columns thru T-sql command

    Robert (4/21/2008)


    The OP wrote a vague question. If he/she doesn't take the effort to clear doubts, why do you keep guessing?

    Hi Robert

    There are a few reasons. Some people find it...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Query with a custom order

    Duplicate post

    http://www.sqlservercentral.com/Forums/Topic487765-169-1.aspx

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

Viewing 15 posts - 181 through 195 (of 683 total)