Forum Replies Created

Viewing 15 posts - 16 through 30 (of 33 total)

  • RE: Calculating Work Days

    I calculate wokringdays like this:

    SELECT days/7*5 + days%7

    - CASE WHEN 6 BETWEEN wd AND wd + days%7-1 THEN 1 ELSE 0 END

    -...

  • RE: T-SQL 2008

    I do not agree with the question.

    With rollup and with cube where available, so even if implementation have changed, it is not new.

    The question was about added features.

    A revision of...

  • RE: one character of data

    i think nchar(1) should be the correct answer.. nothing said it was limited to only 1byte characters!

    Using special characters will not work with char(1)

  • RE: @@DBTS

    In SQL 2008 Books online I find under @@DBTs:

    Returns the value of the current timestamp data type for the current database. This timestamp is guaranteed to be unique in the...

  • RE: Unique constraints

    without the it is rather obvious that the table would still be created but a warning will be given.

    As long as you insert/update so combined they are...

  • RE: Unique constraints

    Msg 102, Level 15, State 1, Line 1

    Incorrect syntax near '<'.

    So I think it's the last answer, query need some correction before compile!!!!!

  • RE: Intersect, Except, Union, All and Any

    Using where not exists will in most cases be faster then using a 'left join .. is null' to do an 'except'.

    Example: let's say you need the ItemCode from Item...

  • RE: Not sure how to do this join

    Could you provide the table definitions and some sample data, now it's very hard to understand what you actually want.

    It think if you would put your whole like structure in...

  • RE: combine queries

    He want the see the rows with "memberaddress" when the param is member adress, but when it's not he wants to see all the other rows(even null)

    litte example:

    CREATE TABLE [dbo].[devTable](

    [field1]...

  • RE: combine queries

    select

    AddressID,

    Building=coalesce(Building,0),

    Street,

    City,

    Zip,

    ...

  • RE: EXECUTION PLAN BUG

    Hi,

    Sql determines how to apply the filter. He figures out it would be better the to the field1>1 because that would use an index on the column while Isnumeric(field1) will...

  • RE: EXECUTION PLAN BUG

    By using :

    SELECT field1

    FROM devTable

    WHERE case when ISNUMERIC(field1) = 1 then field1 else 1 end > 1

    The problem is dat sql while try fields1 > 1 because there is no...

  • RE: Select Where Any Column Equals (or Like) Value

    create table dbo.tmpTestTable(a nvarchar(50),b nvarchar(10),c int,d float)

    Insert into dbo.tmpTestTable select 'a1f','2a',3,4

    Insert into dbo.tmpTestTable select 'a2ff','a1',3,4

    Insert into dbo.tmpTestTable select 'a3fff','a2',1,4

    Insert into dbo.tmpTestTable select 'a4fff','2a',3,1

    Insert into dbo.tmpTestTable select 'a5fff','a2',3,4

    select * from dbo.tmpTestTable

    declare...

  • RE: Please help in writing a function

    if object_id('dbo.tmpTable') is not null

    drop table dbo.tmpTable

    go

    create table dbo.tmpTable(Slno int, ParentId int, Leg int, Orign char(1), Dest char(1))

    insert into dbo.tmpTable

    select 1, 1, 1, 'V', 'X'

    union all select 2, 1, 2,...

  • RE: Debate on ways of writing T-SQL queries.

    Normally there should not be any difference in execution time and execution plan.

    Be carefull to test with dbcc dropcleanbuffers and dbcc freeproccache, but don't do this on a production server.

    Other...

Viewing 15 posts - 16 through 30 (of 33 total)