Viewing 15 posts - 4,606 through 4,620 (of 10,144 total)
The RETURN value of a stored procedure is kinda reserved for the error status. 0 means no error, any other number means an error occurred. Check the stored procedure for...
May 10, 2013 at 3:34 am
ravi@sql (5/9/2013)
Thank you for your valuble reply .. finally am able to over come my prob .. here is the query
Declare @date Datetime='2013-06-16 00:00:00.000'
select...
May 10, 2013 at 1:48 am
j2cagle (5/9/2013)
I just cut-n-pasted from above:DECLARE @VARBINARY VARBINARY (16)
SET @VARBINARY = CONVERT(VARBINARY (16),'0x0000000000018662',1)
SELECT @VARBINARY;
go
DECLARE @VARBINARY VARBINARY (16)
SET @VARBINARY = CONVERT(VARBINARY (16),'0x0000000000018662',0)
SELECT @VARBINARY;
go
You missed the @@version...
May 9, 2013 at 10:08 am
Lynn Pettis (5/9/2013)
When I run the following in SQL Server 2008 R2:
DECLARE @VARBINARY VARBINARY (16)
SET @VARBINARY = CONVERT(VARBINARY (16),'0x0000000000018662',1)
SELECT @VARBINARY;
go
DECLARE @VARBINARY VARBINARY (16)
SET @VARBINARY = CONVERT(VARBINARY (16),'0x0000000000018662',0)
SELECT @VARBINARY;
go
I get;
0x0000000000018662
0x30783030303030303030303030313836
Same here.
May 9, 2013 at 9:58 am
j2cagle (5/9/2013)
That's what I've been trying, but that results in:0x30783030303030303030303030313836
Interesting - I get the same as you if I execute the batch against SQL Server 2000. Against 2k8 it appears...
May 9, 2013 at 9:46 am
j2cagle (5/9/2013)
May 9, 2013 at 9:35 am
How many rows are returned if you comment out the WHERE clause?
May 9, 2013 at 9:22 am
-- standard crosstab query
SELECT [SlNo#] = ROW_NUMBER() OVER(ORDER BY GrandTotal DESC),
OrganizationName, HumanResourse, Finance, HelpDesk, ITDevision, GrandTotal
FROM (
SELECT
OrganizationName,
HumanResourse= SUM(CASE WHEN DeptName = 'HumanResourse' THEN Total ELSE 0 END),
Finance=...
May 9, 2013 at 9:04 am
paul.j.kemna (5/9/2013)
May 9, 2013 at 8:29 am
Thanks for the feedback, and you're welcome. An actual plan for the revised query would be very interesting - if you have the time.
May 9, 2013 at 7:12 am
suneet.mlvy (5/9/2013)
drew.georgopulos (5/8/2013)
all take the same hit on Sort?Is there any way to mitigate that or conditions that make one cheaper than another forcing uniqueness?
thanks very much
drew
I don't think...
May 9, 2013 at 6:52 am
Eugene Elutin (5/9/2013)
--WHERE LEFT(CompanyIdentifier, 5) != 'EXCLU' -- NOT SARGABLE
WHERE CompanyIdentifier NOT LIKE 'EXCLU%' -- SARGABLE
Yeah, I thought about this one too, but if you check attached execution plan...
May 9, 2013 at 6:35 am
paul.j.kemna (5/9/2013)
May 9, 2013 at 6:31 am
Here's a basic crosstab query to get you started. It might just work 😉
SELECT
CompanyIdentifier,
,COALESCE(Field1,Field2)
,COALESCE(Field3,Field4)
,Field5
FROM (
SELECT
CompanyIdentifier,
Field1 = MAX(CASE WHEN FieldIDNumber = 1 THEN Data END),
Field2 = MAX(CASE WHEN FieldIDNumber =...
May 9, 2013 at 5:22 am
-- Have a look at the result of this:
-- ('#' is an arbitrary divider between the columns of one table and the columns of another)
SELECT h.*, '#' '#', x.*
FROM...
May 9, 2013 at 5:10 am
Viewing 15 posts - 4,606 through 4,620 (of 10,144 total)