Forum Replies Created

Viewing 15 posts - 586 through 600 (of 1,048 total)

  • RE: Logic creation

    Lowell (4/17/2013)


    well based on how i read your description, it sounds like a simple calcuated column could be used;

    ALTER TABLE [dbo].[GV_STNDetails]ADD STN AS RIGHT('0000' + CONVERT(VARCHAR,[From_StoreCode]),4) +RIGHT('000000' + CONVERT(VARCHAR,[STNID]),6) PERSISTED

    if...

  • RE: Logic creation

    Kingston Dhasian (4/17/2013)


    kapil_kk (4/17/2013)


    Please help me on this...

    The scenario that you have mentioned is not very clear.

    It would be good if you can explain your issue with some DDL and...

  • RE: Logic creation

    Please help me on this...

  • RE: Row Constructor

    Hugo Kornelis (4/17/2013)


    Good question. Not perfect, though.

    When I read the question in the daily newsletter, I expected the answer options to be "yes" or "no", and I was fully ready...

  • RE: Row Constructor

    New thing to learn... ๐Ÿ™‚

  • RE: COUNT() Function

    Hugo Kornelis (4/16/2013)


    rals (4/16/2013)


    (...)

    The above code returns 5, 5, 4. Based on the output it looks like COUNT(*) and COUNT(1) returns the number of rows, regardless of content.

    COUNT(*) returns the...

  • RE: COUNT() Function

    Sean Lange (4/16/2013)


    kapil_kk (4/15/2013)


    For the last query:

    select COUNT(convert(int,NULL)) from #temp

    It will return 0 because when you execute the query:

    SELECT CONVERT(int,NULL) it will return NULL and as the return type of...

  • RE: Searching Database tables for a specific value within a database field

    --Variable Delaration

    Declare @keytosearch varchar(max), @Database_Selected varchar(50)

    set @keytosearch ='%london%'

    set @Database_Selected= 'Northwind'

    Declare @Table varchar(100), @Table_Name Cursor, @Count_Column int,

    @Result nvarchar(4000),@ID int,@ID_inserted int,@Count_Table int, @data_type varchar(10)

    set @ID_inserted=0

    set @Count_Table=0

    DECLARE @column...

  • RE: COUNT() Function

    Hugo Kornelis (4/16/2013)


    Good question, mediocre explanation - no errors, but complicating things more than needed.

    There are three variations of COUNT:

    * COUNT(*) - returns the number of rows, regardless of content.

    *...

  • RE: COUNT() Function

    L' Eomot Inversรฉ (4/16/2013)


    Nice question, but as only one list of values ended with 0 it was easy to get the answer without checking anything else, so much easier than...

  • RE: Fixing Divide by Zero Error

    VegasL (4/15/2013)


    Hello,

    I have in select statement select t1.A/t1.B but get divide by zero error

    when I used with isnull isnull(t1.A/t1.B,'-')

    I get error Error...

  • RE: COUNT() Function

    For the last query:

    select COUNT(convert(int,NULL)) from #temp

    It will return 0 because when you execute the query:

    SELECT CONVERT(int,NULL) it will return NULL and as the return type of COUNT is INT...

  • RE: COUNT() Function

    really good basic question Yogi ๐Ÿ™‚

    Thanks for it:-)

  • RE: Help using like operator

    GilaMonster (4/15/2013)


    pankaj2.kumar (4/15/2013)


    This query can also be answered without using escape

    The query is shown below:

    select * from accounts where accname like '%OLD%'

    Except that would also match entries such as...

  • RE: Database Query

    great explanation Jeff ๐Ÿ™‚

Viewing 15 posts - 586 through 600 (of 1,048 total)