Forum Replies Created

Viewing 15 posts - 2,851 through 2,865 (of 2,894 total)

  • RE: Optimize query in 2005

    1st create indices for you FK columns.

    Adding indices for all columns used in a query also would probably increase performance of your select, but think about insert operation... Read something...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Getting most common value from several fields into one record

    And what I wanted was:

    select ID

    ,dbo.MostCommonValue(Field1)

    ,dbo.MostCommonValue(Field2)

    ,dbo.MostCommonValue(Field3)

    ,dbo.MostCommonValue(Field4)

    ,dbo.MostCommonValue(Field5)

    from #t_temp

    group by ID

    Easy hey?

    Now, only what is left is just to write CLR.

    OK, it may be not the best implementation, but...

    Here...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Getting most common value from several fields into one record

    I would create aggregate CLR function for this in C#.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Multiple inserts using key column and then flag Source table when row is loaded

    As I said before, it would be VERY helpfull if you provide the create table and data insert script together with the question.

    Are you asking about:

    required function needs...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Invalid length parameter passed to the LEFT or SUBSTRING function.

    I wonder if Jeff Moden ever experienced this issiue and have better explanatino of why this happens.

    Will hope that he will read this post and comment on it...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Invalid length parameter passed to the LEFT or SUBSTRING function.

    Proof?

    That will not be easy. The only thing I can tell that we have experienced such "nice" features of SQL while I was participating in one of the Microsoft case...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Invalid length parameter passed to the LEFT or SUBSTRING function.

    Have you aware had the division by zero error in the code like that:

    SELECT A/B FROM TABLE1 WHERE B!=0

    No? Welcome to Microsoft SQL Server version 2005 and higher query optimiser.

    IT...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Multiple inserts using key column and then flag Source table when row is loaded

    No Ideas. Create table & data population scripts together with better explanation of expected results would help to generate some...

    Your expected results are not very clear: what you refer as...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: spliting nested string

    This one (without use of cursor or loops opr UDF) will perform and scale much better...

    declare @pInput varchar(max)

    declare @n int

    set @pInput = '1:1,3,5,7,4:56,43,58,5:34,67r,234'

    set @pInput = ',' + @pInput +...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: how to do this => SET a row by default

    Sorry, can not help here.

    Please provide create table and data insert script plus better explanation of expected results (as list of desired data in the table after the insert/update/delete...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Egg exists in the basket ???

    I wanted to write an articale about using Tally table for cursor-less string splitting but it was already done by Jeff Moden: http://www.sqlservercentral.com/articles/T-SQL/62867/

    You can find there that you could create...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Egg exists in the basket ???

    try this:

    declare @pInput varchar(max)

    set @pInput = 'A123,B123,C123,D123,E123,F123'

    ;with split

    as

    (

    select CASE WHEN LEN(@pInput)= 0 THEN ''

    ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Egg exists in the basket ???

    I can suggest cursor-free and UDF-free string split functionality :

    declare @pInput varchar(max)

    set @pInput = 'A123,B123,C123,D123,E123,F123'

    ;with split

    as

    (

    select CASE WHEN LEN(@pInput)= 0 THEN ''

    ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Need a date between what MIN and MAX returns

    Do you want to select the next date after the MIN, that query will do it:

    declare @dt table (dt datetime)

    insert @dt select '20090101'

    union select '20090210'

    union select '20090312'

    union select '20090415'

    union select...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Statement Errors But Resturns Results Anyhow

    How you call your SP from Access?

    From SQL Server prospective, it is expected behaviour. The error is raised, query/sp execution stopped (conversion error will terminate your query or sp), empty...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 15 posts - 2,851 through 2,865 (of 2,894 total)