Viewing 15 posts - 196 through 210 (of 428 total)
kbsk333000 (6/23/2011)
Is there any alternate way in trigger?
Yes there is, it is called SQL Server Service Broker. SSB is SQL server's service/queue mechanisme. It will let you, from the trigger...
December 12, 2011 at 1:13 am
Please provide the DDL for your table so we can give you proper advise. Follow the link to Jeff Moden's article on posting etiquette in my footer text if you...
December 12, 2011 at 12:55 am
Have a look a Jeff Moden's article about crosstab's, the link is in my footer text.
with cteClaims as (
select row_number() over (partition by c.[Claimant Number] order by...
December 12, 2011 at 12:44 am
Formatting the date should not be done in T-SQL. Formatting (read: "creating an end-user representation of the date value") is the responsibility of the front-end. How would you implement showing...
December 9, 2011 at 3:42 am
You can very easily use the row_number() function to do this.
with cte as (
select row_number() over (partition by MemberFullName order by DateEntered) as nr,
...
December 8, 2011 at 12:24 pm
So I was wrong indeed (and I will quickly revoke the QoD based on this :Whistling:)
I do think I'll put up a new one, just to illustrate how easily one...
December 6, 2011 at 4:08 am
No DDL in your question ,so untested code:
declare @dateFrom datetime;
declare @dateTo datetime;
select @dateTo = getdate(),
@dateFrom = dateadd(day, -14, @dateTo);
select top 10 p.*, c.cnt
from ProductDetails p
...
November 1, 2011 at 5:12 am
I'm sorry but there is too much wrong in your query to make anything out of it. You'll have to describe what you intended to do, because this does not...
October 31, 2011 at 5:15 pm
For me it results in a totally different set of errors:
Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'case'.
Msg 156, Level 15, State 1, Line 26
Incorrect...
October 31, 2011 at 2:05 am
The request was to produce 5 rows, not the top 5 values. row_number() is the way to produce at most 5 rows. rank() can be used to produce any number...
October 27, 2011 at 10:23 am
You should use row_number() instead of rank() if you intend to get the top most 5 entries. rank() will return the same number for rows with duplicate date values, i.e....
October 27, 2011 at 8:34 am
Apart from the technical reasons not to use coalesce (or isnull, which does the same thing) in join or where clauses, this problem is better addressed by a little remodeling...
October 26, 2011 at 12:13 am
Did you think of a way to "clean" those phone numbers yet? i.e. '123-4567890' won't be the same number as '1234567890' or '123 - 4567890' if you don't clean them...
October 22, 2011 at 2:26 pm
Here's an example:
ID, phone name email
1, null, 'companyA', 'companya@hotmail.com'
2, null, 'companyA', 'x@companya.com'
3, null, 'companyB', 'companya@hotmail.com'
See how the row with ID = 1 fits both your rules 2 and 3 at...
October 21, 2011 at 10:37 am
Viewing 15 posts - 196 through 210 (of 428 total)