Forum Replies Created

Viewing 15 posts - 151 through 165 (of 172 total)

  • RE: Design question

    I haven't examined the query writing end of this but you can:

    Group_X_Group (ChildGroupMasterID, ParentGroupMasterID)

  • RE: SQL Sudoko

    David, my bad. I read the first page of discussions and missed the forum was multi-page.

    Sounds like I need to add more functionality.

    thanks

  • RE: SQL Sudoko

    Loved the idea, so tried to create my own. Which works except on Fridays and Saturdays in the Phoenix paper.

    If somebody has scripted out and tried the authors solution...

  • RE: Get the max out of a series of periods

    step 1 create a sequential numbers table (I cannot find my script so heres a manual creation)

    create table #nbrs (cnt int)

    insert into #nbrs

    select 0 Union

    select 1 Union

    select 2 Union

    select 3...

  • RE: Multi-task sproc

    In a SPROC you should be able to do multiple steps.. That being a large part of the idea.

    CREATE PROCEDURE ..

    AS

    SET NOCOUNT ON

    -- comment t1

    Insert Into Transaction (for Fee...

  • RE: Inserting ID field from separate table

    Thanks Ryan Randall,

    The trick select

    (select a.myvalue, count(*) as id from #table1 a, #table1 b where a.myvalue >= b.myvalue group by a.myvalue) c,

    was the statement I was looking...

  • RE: TSQL optimize database

    Errrr,

    The separate databases are backed up and optimized after the (nightly)data pull/increment. The request from the customer was to have them available asap for any nightly scheduled reports against...

  • RE: TSQL optimize database

    Thanks all for feedback/assistance:

    I created an additional sproc prior to my backup sproc that performs the optimization and transaction log sizing. (Note: i did NOT shrink the log...

  • RE: TSQL optimize database

    I have perused DBCC DBREINDEX. I have the database set to RESTRICTED_USER so would have sole access.

    I'll do some research to see if DBCC DBREINDEX covers the tasks in...

  • RE: Stored Proc advice - avoiding duplicates

    I would think an easy method. Which would fail if hit 'exactly' the same time.

    Would be to add a check on your first select

    SELECT

    @FullName = Enq_CustName,

    @TelephoneDay = Enq_CustPhone1,

    @TelephoneEve =...

  • RE: DateDiff??

    There is no easy method unless you create a function:

    --aka

    CREATE function fn_datediff_custom date1 datetime, date2 datetime

    --with something like

    select cast((datediff(hh, date1, date2) - datediff(hh, date1, date2) %24)/24 as varchar(20)) +...

  • RE: Update statement

    Instead of a subselect try a join

    UPDATE OccRadiology

    SET OccRadiology.Ipsil= [CodeLookUp].[CodeID]

    FROM CodeLookUp

    WHERE OccRadiology.Ipsil = '' + CodeLookUp.Code+'' AND CodeLookUp.CType = 93)

    If you really like the subselect

    add after the subselect

    WHERE...

  • RE: Select DISTINCT question...

    If you place the select distinct in a derived table you should be able to order by the column you desire and have select distincts.

    select *

    FROM (SELECT distinct B.BookingID, ISNULL(UPPER(C.CustomerSurname),'')...

  • RE: Query question

    Probably isn't close to what you want but...

    create table id (id_id int identity, line_id int, status int, category10 int, other varchar(20))

    select * from ID

    id_id line_id status category10 other

    111111a

    214111b

    314212c

    4111d

    SELECT...

  • RE: Query question

    step 1) add an identity to the table. Life will be simpler in soo may ways

    (tongue in cheek column name)

    id_id line_id status category10 ...

Viewing 15 posts - 151 through 165 (of 172 total)