Viewing 15 posts - 136 through 150 (of 1,347 total)
>>I continually get 'String or Binary Data would be Truncated' error
1 or more rows that you are trying to update already have a ProductCode that fills the column. If you...
March 6, 2007 at 12:45 pm
The only given requirement is this:
How can I join these two tables so that we recoginze that table1.Doe, John = table2.Doe | John?
I don't see any requirement for fuzzy...
March 6, 2007 at 10:15 am
The requirement is to return 1 record per orderid. What you've posted does not accomplish this and fails to meet the requirement.
March 6, 2007 at 8:56 am
No. It's not working:
Select Soundex('Smith, John')
Select Soundex('Smyth, Jon')
March 6, 2007 at 8:53 am
Derived table to contruct FullName from the 3 name parts, then join on the concatenated column of the derived table
Select *
From Table1
Inner Join
(
Select *,
Rtrim(LastName + ', ' +...
March 5, 2007 at 2:46 pm
It helps to break the problem down into chunks. First, you need total amount summed at the facility_code level. This query accomplishes that:
Select m.facility_code, Sum(d.quantity_issued * d.Price) As TotalAmount
From ...
March 2, 2007 at 2:26 pm
>>sqlserver 2005 would not accept it
Did you get a syntax error ? Or the wrong result ?
Declare @Startdate Smalldatetime
Declare @EndDate Smalldatetime
Declare @Currentdate Smalldatetime
Select @StartDate = '01 Mar...
March 2, 2007 at 12:48 pm
I would use 2 derived tables, 1st gets the earliest date per order, and 2nd finds the lowest line number to use as a tie-breaker if there are 2 or...
March 2, 2007 at 10:30 am
Are the data volumes the same in Dev and Prod ?
Is it the same set of data, or different data, with different distribution of indexed column values ?
Are statistics up...
March 1, 2007 at 3:35 pm
Use UNION ALL so that the 2 resultsets aren't subjected to sort/distinct operations.
February 28, 2007 at 3:48 pm
Why not simply create a foreign key constraint and let the database engine handle it ?
If you absolutely must code it in a trigger, make it set-based to handle multiple...
February 28, 2007 at 2:44 pm
Select e.RespondentID
From EventLog e
Inner Join tblLookup l
On e.RespondentID = l.RespondentID
Where Not Exists (
Select *
From EventLog As e2
Where e2.RespondentID = e.RespondentID
And e2.eventID In (2,3)
)
February 28, 2007 at 2:33 pm
The advantage is a larger range of possible values before you reach the max possible value for the data type.
The disadvantage is increased storage space in table and index pages,...
February 23, 2007 at 3:37 pm
Since this is posted in the SQL2K5 forums, here's an example using SQL2K5's new features.
Use a recursive CTE to generate your 60 months:
With
SixtyMonths (
February 20, 2007 at 4:30 pm
Viewing 15 posts - 136 through 150 (of 1,347 total)