Forum Replies Created

Viewing 15 posts - 3,691 through 3,705 (of 5,103 total)

  • RE: Select any 5 rows in random

    What is row_number()? I searched books online, but there is no row_number.

    that's SQL Server 2005

    Does your table has a numeric pkey ?

    if the answer is yes can use something...

  • RE: CASE UPDATE Query

    You are more than welcome

     

  • RE: Generate a AutoInc with StoredProcedure

    I don't think you need a rollback there.

    If you want to prevent this proc from being executed in the middle of a transaction use "RETURN" instead

    and You should be returning always...

  • RE: CASE UPDATE Query

    UPDATE [RiskSysSum of Source ClaimType]

    SET FinLagCatagory =

    (CASE

    WHEN ClaimType IN ('OP','SPU') THEN 'OP/SPU'

    WHEN ClaimType IN ('SNF','RHB') THEN 'SUBACUTE'

    WHEN ClaimType IN ('PCP', 'PH', 'SP', 'SPI', 'SPO') THEN 'Spec'

    WHEN ClaimType...

  • RE: need help with sql insert with concat

     >> I think I found my anwser:

     

    INSERT INTO tblCatalog ( Product_ID, img )

    SELECT Product_Id, rtrim(Pattern) + '-' + rtrim(Color) + '.jpg' as img

    FROM dbo.Product_Dimension <<

    To be on the safe...

  • RE: Update query error

    May the force be with you

     

  • RE: Odd logs

    Because of the scalability built in SQL Server when the DB is used on a Workstation with MSDE it is actually a good thing because it preserve local resources as...

  • RE: Generate a AutoInc with StoredProcedure

    Marco, LOOK at my code, the double assignment it is not a typo!

    UPDATE PARAMETRO SET

      @CONTADOR =  NM1_PARAMETRO   = NM1_PARAMETRO + 1

      WHERE SIG_PARAMETRO = 'CT' AND GRU_PARAMETRO = '001' AND...

  • RE: Corrleated Subquery problem...

    SELECT distinct a.name as UserName, b.name as Rolename  FROM  sysusers a,

     (SELECT name  FROM sysusers b

      WHERE (b.name NOT LIKE 'db%')

       AND (b.name NOT IN ('guest', 'public'))

       AND (b.uid = gid)) b

      WHERE ...

  • RE: List stored procedure view depenedencies

    select ROUTINE_NAME, VName

    from INFORMATION_SCHEMA.ROUTINES

       cross join

    ( select TABLE_NAME as VName

      from INFORMATION_SCHEMA.TABLES

      where TABLE_TYPE = 'VIEW'

       and OBJECTPROPERTY(OBJECT_ID(TABLE_NAME),'IsMSShipped') = 0 ) v where patindex ( '%'+Vname+'%', ROUTINE_DEFINITION) >...

  • RE: Seems like it shouldn''''t be that difficult

    select EquipNumber

    , MIN(LicenseNumber) as License

    from tblLicenses

    group by EquipNumber

    [Edit:] Should learn to type faster, damn!

  • RE: Filegroup question

    Well I think there is a reason for having more than one file in a filegroup and it is that you get a proportional fill (parallel operation)  therefore you are supposed to get...

  • RE: Parallelism & Optimization of queries

    Allow me to differ! ... well a bit...

    The "optimized" didn't removed the joins it simply added one more filter to the equation

  • RE: SUM

    This is just a guess ...

    select dt.TransactionType , SUM (dt.S) as SaleAmount , SUM(dt.P) as PaymentAmount , SUM(dt.S - dt.P)   AS Balance

    FROM  (

    Select UserID ,TransactionType, Sum(SaleAmount) as S, Sum(PaymentAmount)...

  • RE: sp_getAppLock which Resource are locked?

    Carl,

    On all examples that I have came across the ussage pattern of it is:

    call sp_getapplock

     if failed return -- This is doing the check for you

      ... do your stuff

    call sp_releaseapplock

    hth

     

Viewing 15 posts - 3,691 through 3,705 (of 5,103 total)