Forum Replies Created

Viewing 15 posts - 2,521 through 2,535 (of 5,103 total)

  • RE: Switch to Another User’s Login using T/SQL

    in SQL 2000 there is an equivalent of what you need but the use is reserved for sysadmins only. Have a look at SETUSER in BOL

    Now, That said you don't need...

  • RE: performance and number of variables in Triggers

    The number of variable declaration should not be the problem according to what you describe, but if you are affecting that many tables it looks like your logic is better...

  • RE: Compute

    with your current specifications there is no way to doit if there is more than one product id with the same quantity, otherwise you can use a variation of what I...

  • RE: Compute

    You are a lot better doing that formating on the client side!!

     

  • RE: Compute

    not sure if this is what you want:

    select p.productid, p.quantity, t.totals

    from

    (select distinct productid,quantity

    from products ) p

    join

    ( select productid, sum(quantity) totals ) t

     on p.productid = t.productid

    order by p.productid

    if...

  • RE: Self-Join Update

    Actually I forgot that datediff is NOT deterministic even though dateadd is

    The convert is only deterministic with datetime data type only when style is specified....

  • RE: Default join

    Mark is correct if your default value is not there!!!

    I just trusted the poster affirmation: Basically master tblB has 'H' types for ALL codes

    If that is not the case you...

  • RE: Default join

    I think it may be simpler:

       SELECT A.code

            , ISNULL( B.Type, 'H') as type

         FROM tblA AS A

    LEFT JOIN tblB AS B

           ON A.code = B.code

          AND A.Type = B.Type

  • RE: Self-Join Update

    try:

    alter table http_log_process add log_date_only AS

    dateadd(d,0,datediff(day,0,log_date))

     

  • RE: Self-Join Update

    First, make sure you have indexes in ip and log_date 

    then instead of two converts:

    CONVERT(varchar(12), http_log_process.log_date, 101) = CONVERT(varchar(12), b.log_date, 101)

     you can use

    datediff(day,http_log_process.log_date,b.log_date) = 0

    hth

     

  • RE: Change from Float to Varchar

    OR cast it to int

    select cast( col as int) phone from table

  • RE: Using Sp_columns in a procedure

    here is another one

    select * from information_schema.columns where TABLE_NAME = 'xxx'

    Cheers,

     

  • RE: Best way to snif multiple servers without the use of linked servers

    It does not require a compiler!

    Simply, create the file with the .vbs extension and you are done

    Cheers,

     

  • RE: Increpted

    All you are seen is difference in unicode support Client Side.

    You shouldn't be using the non representable caracter like that on an insert, istead use the nchar(xx) function to represent the...

  • RE: Running Totals

    Sorry if it looks complicated, it really isn't let me disect it a bit so that is a bit more digestible

    declare @startdate smalldatetime,...

Viewing 15 posts - 2,521 through 2,535 (of 5,103 total)