Viewing 15 posts - 2,956 through 2,970 (of 3,957 total)
Can you post some DDL and sample data so I can check?
It may depend on the type of your sal column.
RTRIM(ISNULL(abc, '')) = ''
The above code converts abc (character string)...
August 26, 2012 at 10:29 pm
Sorry. Let's try that one more time.
;WITH CTE1 AS (
SELECT TOP 100 PERCENT Origin, Destination, Tonnage
FROM #Trips
ORDER...
August 26, 2012 at 8:25 pm
Try:
select *
from tablename
where RTRIM(ISNULL(id, '')) = '' or RTRIM(ISNULL(name, '')) = '' OR RTRIM(ISNULL(sal, '')) = ''
August 26, 2012 at 8:07 pm
Interesting. I found a way to force it to work.
;WITH CTE AS (
SELECT c.Origin, c.Destination, c.Tonnage
,n=ROW_NUMBER() OVER...
August 26, 2012 at 7:59 pm
Jeff is probably right, of course.
However I thought I'd try this using a quirk I've seen in CROSS APPLY VALUES with respect to the order of the results...
August 26, 2012 at 7:45 pm
ChrisM@Work (8/24/2012)
TVC implies a set of row value expressions; single-row value expressions can be very useful, see this article [/url]by Dangler Dwain.
Just what am I dangling? I didn't think...
August 26, 2012 at 6:39 pm
Something like this perhaps?
DECLARE @t TABLE (Name VARCHAR(10), [TYPE] VARCHAR(10), Price MONEY)
INSERT INTO @t
SELECT 'nameA', 'typeA', 1.00
UNION ALL SELECT 'nameA', 'typeB', 2.75
UNION ALL SELECT 'nameB', 'typeA', 2.00
UNION ALL SELECT 'nameC',...
August 26, 2012 at 6:32 pm
saschup (8/24/2012)
August 24, 2012 at 6:05 pm
ChrisM@Work (8/24/2012)
Shadab Shah (8/23/2012)
I have one query as SELECT A FROM TEMP1.
And the other query as SELECT B FROM TEMP2.
Now i want the answer to be shown as A-B.
I don't...
August 24, 2012 at 6:13 am
J Livingston SQL (8/24/2012)
CREATE TABLE #Test
(ID int NOT NULL IDENTITY(1,1) Primary key,
TranID int NOT NULL,
OriginCode varchar(5) NOT NULL,
DestinationCode...
August 24, 2012 at 4:32 am
There is a faster way though.
SELECT TranID, RouteInfo=
(
SELECT OriginCode + ''
FROM (
...
August 24, 2012 at 4:03 am
A deadlock will throw this exception:
Error Number: 1205
Error Severity: 13
Error State: 13
Error Message: Transaction (Process ID 78) was deadlocked on lock | communication buffer resources with another process and has...
August 24, 2012 at 2:43 am
ChrisM@Work (8/24/2012)
SQL Kiwi (8/24/2012)
...This is not a democracy....
Absolutely. The weight of opinion won't magically change the way SQL Server works, or anything else for that matter - and yet it's...
August 24, 2012 at 2:26 am
Depending on how many legacy rows you need to convert, you may want to consider this approach to the phone numbers:
INSERT INTO #TempPhone
( ContactID, PhoneTypeID, PhoneNumber)
SELECT
ContactID, n, Phone
FROM
#TempLegacy
CROSS APPLY (
...
August 24, 2012 at 1:41 am
Since row ordering is not guaranteed by SQL, how do you know you're subtracting the right numbers at each row?
August 24, 2012 at 12:43 am
Viewing 15 posts - 2,956 through 2,970 (of 3,957 total)