Forum Replies Created

Viewing 15 posts - 16 through 30 (of 101 total)

  • RE: Help Solving Running Total Problem

    Hi Goldie,

    Do you have an index on UserID?

  • RE: Compare Two Tables

    You are right, it will convert automatically. I believe it will attempt to convert the varchar to an int.

    The explicit conversion is useful as it will catch any bad...

  • RE: Help Solving Running Total Problem

    hi Goldie,

    Before you posted that code I was trying to solve this another way - by concatenating all the comments and then searching for three blanks in a row

    with cte(UserID,...

  • RE: Compare Two Tables

    You need to use the CAST function:

    http://msdn.microsoft.com/en-us/library/ms187928(SQL.90).aspx

    Something like:

    select cast(users as int) from clientsDB.dbo.firsttable where cast(users as int) not in (select users from MarketingDB.dbo.secondtable)

    Then to do an insert:

    insert MarketingDB.dbo.secondtable...

  • RE: Help Solving Running Total Problem

    Hi. What is your current update statement?

    Bevan

  • RE: Compare Two Tables

    Hi,

    You need to fully qualify your table names when comparing accross databases. i.e. DatabaseName.owner.table

    'owner' will probably be dbo.

    Write a query similar to the following and see how you...

  • RE: how to nest hierarchical rows

    The first list is sorted by nodeID - the second list starts with the parent (the one with no parentID listed) and then lists the child, then it's children (grandchildren)...

  • RE: how to nest hierarchical rows

    Hi,

    Use a recursive cte to build up your structure. The [sort] column is only used to store the relationships (and therefore the sorting).

    create table #temp(NodeID int, ParentNodeID int null,...

  • RE: t-sql help

    Hi Mh,

    Is the logic wrong somewhere? If so, could you please explain further.

    Or is it just that this query is not showing all 15 columns?

  • RE: t-sql help

    Thanks Lowell for the table creates.

    Mh is this what you are after? If this is not right you may need to provide further explanation.

    with cte(loc, online_order, non_onlineOrder)

    as (

    select loc,...

  • RE: JOIN-UPDATE FROM 3 TABLES

    Hi,

    Are you wanting to join table1 and table2 based on firstname and then join table2 and table3 based on ID? Try the code below and if that does not...

  • RE: Which country is best for Outsourcing?

    David Webb (3/23/2009)


    Ohio.

    Or maybe West Virginia.....

    Clearly the best answer is New Zealand! 🙂

    A first world country with solid infrastructure but relatively weaker dollar means you get more bang (code?)...

  • RE: Return first match in second table of a left join statment

    Can you please provide statements for table create and insert of some example data?

    Thanks

  • RE: Not your average WHERE Clause

    I was just re-reading OP. If you have start and end date parameters you could just check if they are null...

    -- Or you could use null as the...

  • RE: Not your average WHERE Clause

    Hi,

    Is this in a stored proc? If so you can add a parameter that will define what criteria to use. See below:

    ---- Table and sample data

    drop table...

Viewing 15 posts - 16 through 30 (of 101 total)