Forum Replies Created

Viewing 15 posts - 1 through 15 (of 29 total)

  • RE: Unidirectional Replication

    Hi Experts,

    Thanks for your response!:-)

    I tried to set the -ExchangeType parameter to 1 to merge agent but when I tried to reinitialize the subscription, it is throwing exception "You...

    "Often speak with code not with word,
    A simple solution for a simple question"

  • RE: Trigger: Input value based on other column value

    Is there a possibility to have a value of 2/3?

    I just notice that most of your PACK_ID examples have always 1 on numerator or denominator.

    "Often speak with code not with word,
    A simple solution for a simple question"

  • RE: Trigger: Input value based on other column value

    Can you give me a sample BOX_QTY value if let say i have PACK_ID 2/5 or 3/6 or 4/4?

    And do you have PACK_TYPE field on this table?

    "Often speak with code not with word,
    A simple solution for a simple question"

  • RE: Trigger: Input value based on other column value

    If you want to use the Computed Column approach(as per

    John Mitchell said), you can try this.

    --Note: if your table is still empty, do the following script

    --drop the column...

    "Often speak with code not with word,
    A simple solution for a simple question"

  • RE: Conditional

    'case when' may give you solution but I suggest create a reference/lookup table for those values and join it with your table to normalize your data.

    "Often speak with code not with word,
    A simple solution for a simple question"

  • RE: Update All Null of Field (data Tape "Bit") To False

    Paul's script works either, you just have to implement the generated scripts to make changes.

    "Often speak with code not with word,
    A simple solution for a simple question"

  • RE: Update All Null of Field (data Tape "Bit") To False

    My script works.

    I think you did not execute this line:

    exec(@queries)--execute your query

    This will execute the generated scripts and make changes to your database.

    "Often speak with code not with word,
    A simple solution for a simple question"

  • RE: Update All Null of Field (data Tape "Bit") To False

    Hi Paul,

    Yeah you're right! Thanks for your observation 😀

    "Often speak with code not with word,
    A simple solution for a simple question"

  • RE: Update All Null of Field (data Tape "Bit") To False

    Hi babak,

    Have you tried my reply? I dont have to use CURSOR HECK to execute the command. And its pretty short and clear I think. 🙂

    "Often speak with code not with word,
    A simple solution for a simple question"

  • RE: Update All Null of Field (data Tape "Bit") To False

    Can you try this.

    declare @queries varchar(max)

    set @queries = ''

    select @queries = @queries + 'update ' + b.name + ' set ' + a.name + ' = 0 where ' +...

    "Often speak with code not with word,
    A simple solution for a simple question"

  • RE: find out latest datetime

    --::create sample tables

    select *

    into #table1

    from

    (

    select 'User 1'[UserID], dateadd(dd, -1, getdate())[LastDateTime]

    union

    select 'User 2', dateadd(dd, -4, getdate())

    union

    select 'User 3', dateadd(dd, -8, getdate())

    union

    select 'User 4', dateadd(dd, -3, getdate())

    union

    select 'User 5', dateadd(dd,...

    "Often speak with code not with word,
    A simple solution for a simple question"

  • RE: How to insert multiple rows into a table with identity column

    Do not include your identity column to you insert statement.

    insert into myTable(identitycol, col1, col2, coln)

    values(1, 'value 1', 'value 2', 'value n') ===>WRONG!

    insert into myTable(col1, col2,...

    "Often speak with code not with word,
    A simple solution for a simple question"

  • RE: Service Broker

    Have you tried the Linked Server approach?

    http://msdn.microsoft.com/en-us/library/ms190479.aspx

    "Often speak with code not with word,
    A simple solution for a simple question"

  • RE: Toatal count

    can you give us a sample result set/output that you want to achieved?

    "Often speak with code not with word,
    A simple solution for a simple question"

  • RE: Recursive loop

    How about this?

    --::Create a tally table---------------------------

    select top 1000 identity(int, 1,1)[N]

    into #tempTally

    from master..syscolumns a, master..syscolumns b

    --::Do the trick here------------------------------

    select 'ABC' + convert(varchar(2),N)

    from #tempTally

    where N < 6

    ---------------------------------------------------

    You can check Jeff Moden[/url]'s article[/url]...

    "Often speak with code not with word,
    A simple solution for a simple question"

Viewing 15 posts - 1 through 15 (of 29 total)