Forum Replies Created

Viewing 15 posts - 1,141 through 1,155 (of 2,894 total)

  • RE: casting uniqueidentifier to number and back

    Actually, it is impossible to convert GUID into numeric in T-SQL.

    The largest exact numeric data type in SQL Server has maximum precision of 38.

    To convert GUID you need 39...

  • RE: casting uniqueidentifier to number and back

    Lynn Pettis (9/18/2012)


    Jeff Moden (9/18/2012)


    You could also just use an IDENTITY column starting with 1 million to start with nice, simple 6 digit numbers.

    If you start with a million it...

  • RE: Regular expression in T-sql

    There are two T-SQL features which support limited regular expression functionality:

    LIKE operator and PATINDEX function.

    Depends of what you really need it for.

    Note, the more complicated operation involved (eg. pattern...

  • RE: Retrieve Number based on Indexkey

    I'm glad to help, but make sure you understand how it's working. Otherwise you may have a trouble when someone ask you to explain it...

  • RE: OPTIMIZE FOR UNKNOWN (parameter sniffing problem)

    Roland Alexander STL (9/21/2012)


    GilaMonster (9/21/2012)


    Roland Alexander STL (9/21/2012)


    Which is the point of using local variables, since it will force a new plan each time the query is run.

    Errr... really?

    Oh,...

  • RE: Unable to select from table without adding schema name

    Sean Lange (9/21/2012)


    This is one of the reasons it is generally considered best practice to always include schema when referring to any object. And if the schema is not in...

  • RE: Unable to select from table without adding schema name

    Michael Valentine Jones (9/21/2012)


    kingdonshel (9/21/2012)


    I have server Admin password, however even when I choose the AdventureWorks Database from the dropdown and run the below query I get an errror...

  • RE: Retrieve Number based on Indexkey

    CREATE FUNCTION dbo.f_OhMyGod (@str varchar(100), @pattern varchar(100)) RETURNS VARCHAR(100)

    WITH SCHEMABINDING

    AS

    BEGIN

    SET @pattern = '%' + REPLACE(REVERSE(LEFT(@pattern, LEN(@pattern) - 2)),')n(',')[0-9]%(')

    SET @str =...

  • RE: Retrieve Number based on Indexkey

    Ok, this kind of work is not for T-SQL to do.

    You will be best to create CLR function for this. Your IndexKey is not really a Key, but a pattern....

  • RE: Intresting Question need answer ASAP

    dwain.c (9/21/2012)


    Eugene Elutin (9/21/2012)


    SELECT COS($)

    Will do the same, but it's to obvious...

    I think the harder question would be: How to return 4 without using number in SELECT,

    finding SELECT LEN($),...

  • RE: Intresting Question need answer ASAP

    SELECT COS($)

    Will do the same, but it's to obvious...

    I think the harder question would be: How to return 4 without using number in SELECT,

    finding SELECT LEN($), would be a...

  • RE: help with a query

    erics44 (9/21/2012)


    Eugene Elutin (9/21/2012)


    you and Ayn Rand are mistaken

    Of course we are!

    it's definately giving mixed messages

    Just allow the option that it was intentional...

    Everyone can hurt a poet :crying:

    of course it...

  • RE: T-SQL Help Needed

    Greg Snidow (9/21/2012)


    Eugene Elutin (9/21/2012)

    BTW, COBOL is still in use across wide range of industries which offer sometimes very lucrative positions and contracts...

    Yes, the main application at my company is...

  • RE: Retrieve Number based on Indexkey

    ssskumar4u (9/21/2012)


    Hi,

    I am expecting a generic solution so that even if the attributes change,it should work

    Hi,

    And I am expecting you to read and follow forum "how to post questions" guide....

  • RE: help with a query

    you and Ayn Rand are mistaken

    Of course we are!

    it's definately giving mixed messages

    Just allow the option that it was intentional...

    Everyone can hurt a poet :crying:

Viewing 15 posts - 1,141 through 1,155 (of 2,894 total)