Forum Replies Created

Viewing 15 posts - 151 through 165 (of 223 total)

  • RE: Is there a way to delay a trigger.,

    I've got snapshot_isolation on and read_committed_snapshot on. Will delaying the trigger still block the tables.

    If it's not feasible i guess i have to look for other options, Job is one...

  • RE: Is there a way to delay a trigger.,

    The reason i want to delay this is because the some of the fields gets updated after the audit process which is done in Java. My Java knowledge is very...

  • RE: Is there a way to delay a trigger.,

    Thanks for the prompt response Pradeep.. Where in my trigger i can put Waitfor delay. I have used Waitfor in stored procedures but not in triggers..

    It gives me an error...

  • RE: Looking For Duplication

    i think u needed the recordid as well,,,

    with CTE

    as

    (

    select *, ROW_NUMBER() over (PARTITION by productid,productclass,producttype,orderdate order by orderdate) as rn

    from tmpOrders

    )

    select * from CTE where rn>1;

  • RE: Looking For Duplication

    If the you looking for Duplicates based on productids then this should work:

    select COUNT(tmpOrders.productid) as duplicates,tmpOrders.productid,tmpOrders.productclass,tmpOrders.OrderDate,tmpOrders.ProductType

    from tmpOrders

    group by tmpOrders.productid,tmpOrders.productclass,tmpOrders.OrderDate,tmpOrders.ProductType

    having COUNT(tmpOrders.productid)>1

  • RE: Changing the default date format of SQL server 2005

    As a quick work around i have changed the logins language as english.

    For future purposes we need to look at amending the queries. wat is the best way to do...

  • RE: Changing the default date format of SQL server 2005

    U r right Lamprey, the reports are using varchar instead of datetime, Some thing that probably be looked into for future releases.

    Lynn, i changed the language to English, by rt...

  • RE: Changing the default date format of SQL server 2005

    I've just changed the login to English and that seems to work.

    But i'll still be interested to know if the SQL server Language can be changed to US_English from spanish.

  • RE: Changing the default date format of SQL server 2005

    Hi Lynn; thanks for your response. But i have got about 100 reports which use the dates.. these reports work for our US customers. It's not working for our Spanish...

  • RE: Changing the default date format of SQL server 2005

    When i do rt click properties on SQL server it says language spanish.

    When i run a query :

    select * from shifthistory where vfrom='2009-07-23 00:00:00'. i get an error.

    but when...

  • RE: sql query

    something on the lines of this should work:

    select dateadd(hh, datediff(hh, 0, start_entry), 0) as starthour, dateadd(hh, datediff(hh, 0, start_entry) + 1, 0) as endhour,emp_id

    from #tempsql

    group by...

  • RE: Calculate a Percentage

    You can try this as well:

    select t1.company, SUM(t1.hours),cast(sum(t1.hours)*100.00/(select SUM([hours]) from #CompanyHours) as decimal(5,2)) as [percent]

    from #CompanyHours t1

    group by t1.company

    order by SUM(t1.hours) desc

  • RE: Not in and Not exists

    Thank you guys for the responses

    I am still not clear why Not Exists doesn't give me the same result as 'Not in' which should be an empty result when...

  • RE: Not in and Not exists

    Thanks John for your response, I have the following Not exists Query which gives me a result:

    SELECT custid, companyname

    FROM Sales.Customers AS C

    WHERE country = N'Spain'

    AND NOT EXISTS

    ...

  • RE: charindex() and substring() functions

    select RTRIM(SUBSTRING(name,charindex(',',name)+1,len(name)))+'.' from test

Viewing 15 posts - 151 through 165 (of 223 total)