Forum Replies Created

Viewing 15 posts - 6,001 through 6,015 (of 6,036 total)

  • RE: trigger on view

    It's absolutely natural to create INSTEAD OF trigger on a view.

    This trigger suppose to contain set of statements taking data from view fields and put it into source tables.

    Query Analizer...

  • RE: Using alias in equations

    Fools think same way.

  • RE: Using alias in equations

    select subtotal, (subtotal * .05) as tax

    FROM (select (quantity * price) as subtotal

              from table) DT

  • RE: Column to row

    You can join table to itself

    SELECT MT1.ID, MT1.Data as Name, MT2.Data as Address, MT3.Data as City

    FROM MyTable MT1

    inner join MyTable MT2 on MT1.ID = MT2.ID

    inner join MyTable MT3 on MT2.ID...

  • RE: INSERT Takes too Long

    To compare data in nullable columns everytime use such construction:

    isnull(u.telephone, 'NULL') = isnull(ADT.telephone, 'NULL')

    I use string 'NULL' because there are definitely no telephones like 'NULL'.

    For other columns if you are not...

  • RE: INSERT Takes too Long

              ......

              or u.c<>ADT.c

              or u.l<>ADT.l

              or u.st<>ADT.st

              or u.postalCode<>ADT.postalCode

              or u.mAPIRecipient<>ADT.mAPIRecipient

    will be times faster if it will be

              NOT (.....

              and u.c = ADT.c

              and u.l =...

  • RE: Converting textual dates to actual dates

    I believe problem is in format of date in string. DD/MM/YY vs MM/DD/YY. Application and SQL Server are using different formats.

    So while it's 1/1/1900 everything is all right. But...

  • RE: Script to obtain database name and associated files

    Profiler - is your best friend!!!

    Start profiler and open properties for the DB. Profiler will show you the query EM used to retrieve this...

  • RE: Query working in one DB, not in another

    > Moral of the story: Putting quotes around the value in your WHERE clause is the only safe option)
     
    Not really.
     
    Keep in mind: ' 2619', '002619' and '2619' are not equal...
  • RE: Query working in one DB, not in another

    Be careful with ISNUMERIC!

    Look at this:

    declare @a nvarchar(50)

    SET @a = '10,000.00'

    select isnumeric(@A)

    --  returms 1 - @a is numeric because it's valid money type value

    select...

  • RE: Query working in one DB, not in another

    When you include "VALUE1 IN (2619) " into WHERE clause it means that every value in column VALUE1 will be converted to datatype INT and copmpared to integer value 2619....

  • RE: Splitting Database into Mulitple Others

    Sounds like a lot of job to do if to do it proper way.

    You will do it anyway but there is a way to postpone this job.

    Create in DB...

  • RE: How to retrieve intermediate records using SQL or T-SQL?

    Another option:

    select tbl1.* from

    (select top 300 * from tblX Order By keys ) tbl1

    left join (select top 200 keys from tblX Order By keys ) tbl2 on tbl2.keys=tbl1.keys

    where tbl2.col is...

  • RE: Convert getdate() to date only

    If you look inside of any any table with datetime field you can see that SQL server uses 4 bytes for smalldatetime (same as real) and 8 bytes for datetime (same...

  • RE: Question of the Day for 17 Sep 2004

    From the explanation:

    "Answer C is not valid syntax."

    For which language?

    I thought it's about SQL Server...

Viewing 15 posts - 6,001 through 6,015 (of 6,036 total)