Forum Replies Created

Viewing 15 posts - 5,776 through 5,790 (of 6,036 total)

  • RE: how search BETWEEN the first day of the month and Last day

    I told you to search

    between 1.11.2005   and    3ms before 1.12.2005.

    What's wrong with this approach?

    Another way is

    >= 1.11.2005 and < 1.12.2005

    Why you don't like these?

    And...

  • RE: how search BETWEEN the first day of the month and Last day

    Never use

    where DAY(datecol) between !!!

    Unless your table not gonna exceed 100 rows.

    This option of WHERE clause eliminates all indexes, it gonna be full table scan.

  • RE: how search BETWEEN the first day of the month and Last day

    By

    SELECT DateAdd(day,-1,DateAdd(month,DateDiff(month,0,getdate())+1,0))

    you miss last day of the month

    SELECT DateAdd(ms,-3,DateAdd(month,DateDiff(month,0,getdate())+1,0))

    will be better

     

  • RE: Open an excel file automatically by using a bat file

    Ask your sysadmin what did he changed in access rights last week.

    There are possibly 3 different accounts:

    SQL Server started;

    SQL Server Agent started;

    Your local your Command Prompt started.

    Find out all 3...

  • RE: Strip this!!!

    If you look at my post again you may notice that on real server the query with UDF took 6 (six) seconds, and query with built-in functions took 10 (ten)...

  • RE: Send SMS using triggers

    Did you notice? This is a forum about transactional SQL.

    What "object of the class" in T-SQL are you talking about?

  • RE: Strip this!!!

    What I've tried:

    CREATE TABLE #Var (id int IDENTITY(1,1), col1 varchar(10))   

    declare @I int

    set @I = 0

    while @I < 100000

    BEGIN

    INSERT INTO #Var VALUES ( '000H.K6' ) 

    INSERT INTO #Var VALUES...

  • RE: Strip this!!!

    Did you ACTUALLY try it?

    Don't fool yourself with scaring trace.

    Switch off trace and run simple select from big table, one time with UDF, second time with, say, ISNULL.

    I have...

  • RE: Strip this!!!

    Can be???

    I don't see any real solution in this topic except mine.

  • RE: Strip this!!!

    Same way as REPLACE, ISNULL functions.

    But you don't worry about those function, so why do you about this one?

    Try it first, than say.

  • RE: Strip this!!!

    It will be fast.

    There are no disk operations inside of this function, so you probably would not notice the difference.

  • RE: Strip this!!!

    Why not just create a fuction?

    Supply your string as a parameter, create WHILE LEFT(@InputString, 1) = '0'...

    inside of the function and use result of the fuction in your select.

    P.S. I...

  • RE: Query to find customers that ordered x AND y AND z

    Insert list of queried produxct to temp table #QProduct

    SELECT CustomerId

    FROM Customer C

       Inner join CustomerProduct CP on CustomerId = CP.CustomerId

       Inner join Product P on P.Productd = CP.ProductId

       Inner...

  • RE: INSTEAD OF Insert Trigger and @@IDENTITY

    But what if @LastId become not really last Id before you start this statement?

    If another process inserted 1 row in the table in the moment between retrieving of @LastId and...

  • RE: Parameter slow sp

    And "CREATE TABLE ..." would be useful.

Viewing 15 posts - 5,776 through 5,790 (of 6,036 total)