Forum Replies Created

Viewing 15 posts - 121 through 135 (of 171 total)

  • RE: loops and cursor

    Like it?

    create table TableA (textname char(3))

    GO

    insert into tableA values ('ABC'),('DEF'),('GHI')

    GO

    create table TableB (id int, ind tinyint, textname char(3))

    GO

    insert into tableB values

    (101,1,'ABC')

    ,(102,1,'ABC')

    ,(103,2,'ABC')

    ,(104,2,'ABC')

    ,(105,1,'DEF')

    ,(105,1,'DEF')

    ,(106,2,'DEF')

    ,(107,1,'GHI')

    ,(108,2,'GHI')

    GO

    select *

    from tableA a

    cross join TableB b

    where...

  • RE: Create parameter for a table in a procedure

    It ill not work.

    You are selecting from a STRING not from a table.

    If are you trying do create a generic "select * from" using a parameter to pass the name...

  • RE: Datetime Ceiling Function. Rounding Dates and Times Up

    The cast to float trick is good for get rid of the hour:minute:second.millisecond part.

    But as I said its imprecise if used direclty to hour/minute/second by multiply and division.

    That's why I...

  • RE: Datetime Ceiling Function. Rounding Dates and Times Up

    You solution is not bad but:

    1. My method can be adapted as well, think about it.

    2. Any implementation of datetime rely on internaly using a kind of float (and it...

  • RE: loops and cursor

    Svakka,

    I worked with Oracle and for SQL Server most cursor based "traditional ways" can be done using relational logic.

    Tell more about your goal.

    Its a insert, update, delete?

    Can you join dept...

  • RE: Date format

    The records seing insert are wrong since only dates like '30-01-2012' ill fail, poping a error message.

    Your database language most probabily is seted to US-en (default value).

    You can change instance,...

  • RE: Datetime Ceiling Function. Rounding Dates and Times Up

    You can cast the datetime to float and apply ceiling or floor to it.

    select GETDATE(), CAST(getdate() as float), CAST(ceiling(cast(getdate() as float)) as datetime)

    select GETDATE(), CAST(getdate() as float), CAST(floor(cast(getdate() as float))...

  • RE: Delete data from table issue

    Before going further make sure this column is not referenced by a FK.

    If there are a FK pointing to that column dont touch it!

    If you realy want to repopulate the...

  • RE: Join performance

    Someone droped the index at production?

    If can only make selects at production box try a select top 10 id column order by id column for each table.

    if its too slow...

  • RE: Exotic join

    chowdarysurendranath.c (2/1/2012)


    ...

    2) select t1.col1,t2.col1 from t1 full outer join t2 on t1.col1 <> t1.col1

    ...

    t1.col1 <> t1.col1

    this clause returns false for every row (is the same as 1 <> 1...

  • RE: Unique key concept:Shubham Saxena@Bajaj Capital

    A common misconception about null lies in most people thinks: null = nothing or even null = 0.

    Null sounds more "I dont know".

    "null = null" sounds like "what's in my...

  • RE: Automatic truncate of varchar string

    "can't do" attitude is bad for everyone and works both sides.

    Just go direct to the point: Deactivating this messagens ill deactivate also usefull messages and you cannot guarantee correctness =...

  • RE: Automatic truncate of varchar string

    I understand the team worry about extending the size of the column.

    It can broke some procedure expecting a 245 size string.

    I dont know you DB or app, but I know...

  • RE: Automatic truncate of varchar string

    Let me clarify,

    Alter the column to varchar(max) AND create the trigger, it ill avoid you to set off warnings (setting it off is a bad, bad, very bad idea)

    and keep...

  • RE: Automatic truncate of varchar string

    Can You rely on a trigger to safe truncate the data to the column?

    And tell your team it's not acceptable to the UI to sent invalid data to the DB!

    And...

Viewing 15 posts - 121 through 135 (of 171 total)