Forum Replies Created

Viewing 15 posts - 31 through 45 (of 2,894 total)

  • RE: how to return max from a varchar column

    What about some change makes it to be 7-parts? Then, few months later, 8-parts?

    If you want to be dynamic and a bit more simpler, do this:

    SELECT TOP 1...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: how to return max from a varchar column

    Tex-166085 (1/21/2015)


    Hi,

    wow, thanks for all the replies, I will work through them in my lunch hour. Yes, I cannot say how high each of the digits will go. It...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: how to return max from a varchar column

    ...

    Elementary;-)

    😎

    Not quite so, try ('1.0.100')

    😉

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: how to return max from a varchar column

    If your data always three-parts you can do:

    SELECT TOP 1 THREE_PART_NUM

    FROM @SAMPLE_DATA SD

    ORDER BY CAST(PARSENAME(THREE_PART_NUM,3) AS INT) DESC

    ,CAST(PARSENAME(THREE_PART_NUM,2) AS INT) DESC

    ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: how to return max from a varchar column

    Eirikur Eiriksson (1/21/2015)


    Tex-166085 (1/21/2015)


    Hi,

    I need to return the max value from a fieldwhich contains a three part numeric, stored as a varchar. For example

    1.0.0

    1.0.1

    1.1.0

    1.2.1

    2.0.0

    2.1.1

    etc

    These represent processes, and sub...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Help Needed in Avoiding RBAR

    ...

    Why not just skip the process altogether and simply calculate the current user account balance directly when needed( thus normalizing your data model in the process)?

    Edit: Unless of course...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: ID or Id

    Both are good to me, plus:

    product_id

    ... as per column name convention in system tables ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Constraint error message handling

    John Mitchell-245523 (1/20/2015)


    The allow updates option doesn't have any effect any more (from SQL Server 2005). You could use a trigger instead of a constraint in order to return...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Constraint error message handling

    I would not advice doing that, but I think it is possible by altering the error message template in sys.messages

    eg:

    select * from bucs.sys.messages where text like '%constraint%'

    Just remember, it...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: @HR

    @hr is just the name of the variable to store result of the sp_OACreate proc.

    As per BoL (http://msdn.microsoft.com/en-us/library/ms189763.aspx), this proc returns HRESULT, so @hr is just choosen as it...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Design vehicle and its parts database in SQL server

    looks like home work to me...

    Please try your best, post what you manage to come up with and we will be able to give you guidance to make it better.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: How the datediff determinines the difference between two dates?

    sonchoix (1/19/2015)


    select datediff(wk, '2015-01-11', '2015-01-19') returns 1 (shouldn't it return 2?)

    select datediff(wk, '2015-01-10', '2015-01-19') returns 2

    Thanks

    As per BoL: "DATEDIFF ... Returns the count (signed integer) of the specified datepart boundaries...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Looking for an elegant way to tranpose my query result

    You can use PIVOT if you wish:

    ;WITH YourQuery

    AS

    ( -- Put your query here:

    SELECT *

    FROM (VALUES (1,'Low',8137),

    ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Alter table performance

    BrainDonor (1/19/2015)


    Mauricio_ (1/19/2015)


    Hi all,

    I have a question regarding performance. I need to alter several tables, changing columns from decimal(18,4) to decimal(19,8). Some of the tables...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: How does teh inserted and deleted created of triggers?

    Just to make it clear:

    Q: If there is an update occurred on Employees, does it create an inserted table with 10 columns as well, having an exact column structure as...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 15 posts - 31 through 45 (of 2,894 total)