Forum Replies Created

Viewing 15 posts - 646 through 660 (of 668 total)

  • RE: Update column

    I'm not really sure what you're trying to accomplish. Can you provide table scripts and inserts as well as what you've already tried? Here's a link on best...

  • RE: Database Synchronization

    you can try Visual Studio (need database edition) or RedGate

  • RE: stored procedure for seeding

    Not realy sure what you're looking for. Do you want to delete the data before loading? Reseeding has to do with a table that has an identity column....

  • RE: Set date parameter

    declare @vdt_date smalldatetime

    set @vdt_date = getdate()

    set @vdt_date = '2009-09-30'

    set @vdt_date = '2009-10-01'

    select @vdt_date,

    case when month(@vdt_date) >= 10 then

    ...

  • RE: how to find max data in duplicate table values

    select max(id) id , name, max(version) version

    from versions

    group by name

  • RE: Set date parameter

    you can use a proc with output parameters. Then you could use some logic on the month to determine which fiscal year the date is in

  • RE: Running Count

    You can use a CTE to accomplish this, but I think you should read the link provided by Lynn first.

  • RE: Running Count

    do you have any table layouts, data that you could post?

  • RE: Group by Count question

    you have to remove the criteria from the query. You can place it in a case when statement and use sum instead of count

    SELECT department, sum(case when salary >...

  • RE: Join Help

    I think I might be missing something, but it looks like all the joins are going against the QALS table, so you don't need the inner join. Couldn't you...

  • RE: Is there tsql to change the server connection for Mgmt Studio?

    There is an SSMS tool pack that you can install as an addin to SSMS. That allows you to color code each connection. You can find it here...

  • RE: Group by help needed

    Once you find the max price then you can find the max date. Try this

    declare @tbl table

    (

    sort int,

    type varchar(100),

    date datetime,

    price decimal(12,2),

    ...

  • RE: Update from multiple records

    Here's one way, but if the source table is large could be a performance nightmare

    --===== If the test tables already exist, drop

    IF OBJECT_ID('TempDB..#mysourcetable','U') IS NOT NULL

    ...

  • RE: Rolling DateDiff to compare dates within a dataset

    You can use a cte with row_number to order and get the days. Here's an example using your data

    create table cust (CustomerID int, OrderID int,OrderDate smalldatetime,DaysBetweenOrders tinyint)

    insert into cust...

  • RE: Group by

    you can group by fields that are not in the select clause. Results won't make much sense, but sql allows this.

    SELECT a,b

    FROM #temp

    ...

Viewing 15 posts - 646 through 660 (of 668 total)