Forum Replies Created

Viewing 15 posts - 136 through 150 (of 210 total)

  • RE: Using Top 1 in scalar-valued User defined function (UDF)

    this work?

    CREATE FUNCTION [dbo].[TNU_fnTop1Ethnicity] (@people_code_id varchar(10))

    RETURNS VARCHAR(255)

    AS

    /*Returns the top ethnicity alphabetically for people who have declared

    more than 1.*/

    BEGIN

    DECLARE @return varchar(255)

    select top 1 @return = [description] from people p

    join personethnicity pe

    on...

  • RE: Multiple columns at GROUP BY clause in CASE clause

    you need to modify your group by stmt

    group by b.bl_no, b.laden_date,b.container_code,b.shipper_name,b.consignee_name

    , case when @num = 2 then c.status end

    ...

  • RE: Value dependent User Key

    You could try enforcing it through a trigger. Something like this?

    SET NOCOUNT ON

    GO

    CREATE TABLE dbo.Sample (

    PK int identity(1,1)

    , Field1 varchar(50)

    , Field2 varchar(50)

    , Deleted bit )

    GO

    CREATE TRIGGER dbo.trg_Sample

    ON dbo.Sample

    INSTEAD OF INSERT

    AS

    BEGIN

    IF...

  • RE: Need Help with Query

    No problem, glad I could help.

  • RE: Need Help with Query

    declare @Tmp table (acct_nb int, phone_nb varchar(10), phone_stat_cd char(1))

    insert into @Tmp values (1, '6165276980', 'G')

    insert into @Tmp values (1, '6165277722', 'B')

    select x.acct_nb

    , case when...

  • RE: Temp DB Issue

    Have you checked for any long running processes that would be affecting the tempdb? We had a similar experience with the tempdb growing until it filled up the disk -...

  • RE: unable to delete the records in table

    Not sure what "unable to delete records" means. Does your statement error out or are you rolling it back before it finishes?

  • RE: How to catch a screen-scraper?

    Thanks all for your input.

    Taking Jeff's advice, and since we're already logging site activity, I'll create a script that aggregates hits and timing and then manually scan it for trends....

  • RE: How to catch a screen-scraper?

    I agree that each consumer has different consumption needs and in the past we've mitigated this via web services and/or custom reports. As it turns out, the sales team had...

  • RE: Indexing fields for JOINS and WHERE

    create table #tbl ([Name] varchar(10), [Deleted] int)

    insert into #tbl values ('Smith', 0)

    insert into #tbl values ('Brown', 0)

    insert into #tbl values ('Green', -1)

    create index ix_tbl on #tbl ([Name], [Deleted])

    --create index ix_tbl_1...

  • RE: order by dates

    Something like this?

    declare @tbl table (datestring varchar(10))

    insert into @tbl values ('Jan-2009')

    insert into @tbl values ('Feb-2009')

    insert into @tbl values ('Mar-2009')

    insert into @tbl values ('Feb-2010')

    select datestring

    from @tbl

    order by cast(replace(datestring, '-', ' ')...

  • RE: Indexing fields for JOINS and WHERE

    Digs (2/1/2010)


    When is it wise to sort or unsort..

    We'll frequently sort DESC on date columns for audit/historical tables - latest record first deal.

  • RE: using outer query column name in subquery while doing order by

    You're basically doing an inner join between <Student> and <School> on ID columns. Are IDs unique across these two tables?

  • RE: Store Procedure takes lot of time to execute at 1st

    Are your developers running ALTER scripts or DROP and CREATE? Seem to remember having performance issues w/ 2000 using ALTER.

  • RE: Problem inserting to a view. Not able to insert 2000+ Characters.

    What's the datatype of the column in the view definition? Might help if you post the code for the view.

Viewing 15 posts - 136 through 150 (of 210 total)