Viewing 15 posts - 256 through 270 (of 2,171 total)
The problem with this approach is that when the execution plan is created, it has to read ALL records to know which are within the "binary" range you talk about....
July 10, 2010 at 3:59 pm
July 7, 2010 at 4:35 am
If the search criteria is dynamic (usnig a variable) see this blog post
July 7, 2010 at 4:23 am
Works for me. Remember UTF-16 is similar to UNICODE.
Please note the N string-prefix.
declare @xml xml
set @xml =
N'<?xml version="1.0" encoding="utf-16"?>
<root>
<names>
...
July 6, 2010 at 1:33 am
Same question asked over here last week http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=146582
I guess OP gave up.
July 5, 2010 at 3:33 am
Are you using table variables? Or temp tables?
There are no statistics for table variables. The number of records are always estimated to 1 in the query optimizer for table variables.
July 5, 2010 at 3:21 am
Let's do some testing...SET NOCOUNT ON
-- Prepare sample data
DECLARE@UserRole TABLE
(
UserID INT NOT NULL,
RoleName VARCHAR(100) NOT NULL,
ProjectID INT NOT NULL,
RoleAssignedDate DATETIME NOT NULL
)
-- Populate sample data
INSERT@UserRole
(
UserID,
RoleName,
ProjectID,
RoleAssignedDate
)
VALUES(1112, 'Technical Director', ...
June 29, 2010 at 3:39 am
-- The XML way and current connection language setting
SELECTm.i.value('(text()[1])', 'VARCHAR(20)') AS theMonthName,
ROW_NUMBER() OVER (ORDER BY m.i) AS theMonthNumber
FROM(
SELECTCAST('<m>' + REPLACE(months, ',', '</m><m>') + '</m>' AS XML).query('(.)')
FROMsys.syslanguages
WHERElangid = @@LANGID
) AS d(m)
CROSS...
June 17, 2010 at 6:47 am
Paul White NZ (4/28/2010)
For giggles, here's an extension to my previous code that supports sequnces up to 146,813,779,479,510 (way beyond INT32) - which gives ZZZZZZZZZZ (ten of them!)
Paul, what if...
April 28, 2010 at 12:22 pm
Dohsan (4/28/2010)
701 = ZY (Correct)702 = AZZ (Incorrect)
703 = AAA (Correct)
Edge condition fixed!
April 28, 2010 at 9:19 am
You can make the code as a scalar function in your database and add the result of the query to your resultset in your report.
April 28, 2010 at 9:01 am
I posted a generic example here http://weblogs.sqlteam.com/peterl/archive/2010/04/28/The-Excel-Column-Name-assigment-problem.aspx
if someone is interested about a generic solution...
The solution is a one-statement query and works really well for any number under INT range.
April 28, 2010 at 7:48 am
Here are two problems?
The original and the "Excel column numbering" question?
For the original question, to keep the result within VARCHAR(8000) the maximum line number to convert is 208000 which...
April 28, 2010 at 6:05 am
Viewing 15 posts - 256 through 270 (of 2,171 total)