Viewing 15 posts - 3,376 through 3,390 (of 4,087 total)
You can use UNPIVOT, but that gets very messy when you're trying to unpivot into more than one column. You would need three.
You can also use CROSS APPLY to...
January 5, 2012 at 12:08 pm
ChrisM@home (1/5/2012)
drew.allen (1/4/2012)
ChrisM@home (1/4/2012)
say there are ten rows with the same VND_ID and only one of them matches the filter?
You'll need to post sample data illustrating the problem and the...
January 5, 2012 at 11:51 am
ChrisM@home (1/4/2012)
say there are ten rows with the same VND_ID and only one of them matches the filter?
You'll need to post sample data illustrating the problem and the desired results.
Drew
January 4, 2012 at 2:56 pm
Actually, why are you using a subquery in the first place. Doesn't the following give you what you want?
UPDATE PLU_1
SET DSPL_DESCR = replace ([DSPL_DESCR],'"','in')
WHERE AND DSPL_DESCR LIKE '%"%'
AND len(replace...
January 4, 2012 at 12:32 pm
The problem is that your REPLACE function is increasing the length of the string beyond the maximum allowed and you haven't correctly accounted for that fact. Given your subquery,...
January 4, 2012 at 12:26 pm
This is a presentation issue and is best handled in the presentation layer, not the database layer. You don't mention what you are using for your presentation layer, but...
January 4, 2012 at 7:03 am
Welsh Corgi (12/31/2011)
@Drew,You probably already know this but you can get a SQL Server 2008 R2 Developer Edition for under $50 USD.
Yes, I already have it installed on my laptop...
January 3, 2012 at 8:13 am
CELKO (12/30/2011)
A function or a procedure is names with <verb>_<object> and does not have the meta-data like “udf_”; name things for what they are, not how they are implemented.
Naming...
December 30, 2011 at 11:23 am
If you just want the differences without updating, the easiest approach is to use the EXCEPT statement.
SELECT [id], [name], [address], meter_flag, end_date
FROM TableB
EXCEPT
SELECT [id], [name], [address], meter_flag, end_date
FROM TableA
This will...
December 30, 2011 at 9:56 am
You're looking for the MERGE statement, which was introduced in SQL 2008. You can find more information in BOL. We still don't have SQL 2008, so I can't...
December 30, 2011 at 9:19 am
Evil Kraig F (12/29/2011)
I wouldn't do this with Row_Number
I would use Row_Number, because using MAX() in a subquery has the possibility of duplicate values if there are multiple records with...
December 29, 2011 at 3:12 pm
Welsh Corgi (12/29/2011)
drew.allen (12/29/2011)
You realize that this is a presentation issue and is best handled in the presentation layer.Drew
I guess that it depends because you may not always have a...
December 29, 2011 at 10:12 am
I should mention another advantage of STUFF(). You're not cutting the string into pieces and reassembling them, so you don't have to worry about getting the pieces in the...
December 29, 2011 at 10:03 am
I prefer using STUFF rather than SUBSTRING and concatenation for a couple of reasons:
* It's language independent. The substring approach will fail if the language settings don't match...
December 29, 2011 at 9:52 am
cometav2011 (12/29/2011)
December 29, 2011 at 9:23 am
Viewing 15 posts - 3,376 through 3,390 (of 4,087 total)