Viewing 15 posts - 1,021 through 1,035 (of 2,007 total)
mick burden (1/23/2012)
EDITplease excuse me, I've gone back over the code and discovered a typo caused by me. Everything appears ok, thanks
Make sure you understand what's going on in the...
January 23, 2012 at 2:00 am
Cadavre (1/20/2012)
Here's the query I'd use:
SELECT [name], [count]
FROM (SELECT
SUM(CASE...
January 20, 2012 at 9:21 am
I'm going to go and be a little different, because I always am 😀
Here's the query I'd use:
SELECT [name], [count]
FROM (SELECT
SUM(CASE WHEN...
January 20, 2012 at 9:13 am
luissantos (1/20/2012)
Any explanation ?
Yes, the white space trailing your varchar wasn't a space - it was a tab or some other white space character instead.
e.g.
DECLARE @test-2 TABLE(testID INT IDENTITY, cct...
January 20, 2012 at 8:20 am
DECLARE @ColumnList NVARCHAR(MAX)
SELECT @ColumnList = COALESCE(@ColumnList, '') + ',' + CHAR(13) + CHAR(10) + CAST(COLUMN_NAME AS VARCHAR(128))
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'MY_TABLE'
ORDER BY ORDINAL_POSITION
IF LEN(@ColumnList) > 0
BEGIN
SELECT @ColumnList = STUFF(@ColumnList, 1,...
January 20, 2012 at 7:53 am
{fn length} is a Microsoft ODBC canonical function that is supposed to work the same with any data type.
January 20, 2012 at 5:06 am
adrian.facio (1/19/2012)
I just know i wont say "this don't work" to things that works and i have not tested
GSquared (1/19/2012)
I'm not disagreeing with semicolons being...
January 19, 2012 at 9:15 am
L' Eomot Inversé (1/18/2012)
Incidentally, using char(10)+char(13) (as you apparently do) instead is not acceptable
I more meant that I include CR/LF, I didn't mean that I specifically wrote them as LF...
January 19, 2012 at 2:05 am
GSquared (1/18/2012)
Cadavre (1/18/2012)
adrian.facio (1/18/2012)
Did you tried it before your change??
Admittedly, the answer to that is "no".
However IMO, to avoid ambiguity, whether or not your method works is irrelevant....
January 18, 2012 at 10:06 am
adrian.facio (1/18/2012)
Did you tried it before your change??
Admittedly, the answer to that is "no".
However IMO, to avoid ambiguity, whether or not your method works is irrelevant. It...
January 18, 2012 at 9:44 am
Here's my guess: -
BEGIN TRAN
CREATE TABLE #yourSampleData (AssignmentID INT IDENTITY, QuestionID INT, StakeholderID INT)
INSERT INTO #yourSampleData
SELECT * FROM (VALUES(1, 10),(1, 9),(2, 10),(1, 2))a(QuestionID,StakeholderID)
--Set string and question number
DECLARE @string VARCHAR(4000) =...
January 18, 2012 at 9:22 am
Laurie-1124340 (1/18/2012)
QuestionID StakeholderID
1...
January 18, 2012 at 8:38 am
Wikipedia's black-out is javascript based. I didn't realise it was "blacked-out" until a colleague informed me - I block all web-based scripts from running on my machine so it was...
January 18, 2012 at 8:06 am
Check out Jeff Moden's splitter article for the best way to split your comma separated string --> http://www.sqlservercentral.com/articles/Tally+Table/72993/%5B/url%5D.
Once you've implemented that, you can split the strings into a data-set (temp...
January 18, 2012 at 7:53 am
Jeff Moden wrote an excellent article that does exactly what you need. Click this link --> http://www.sqlservercentral.com/articles/Tally+Table/72993/%5B/url%5D
January 18, 2012 at 7:19 am
Viewing 15 posts - 1,021 through 1,035 (of 2,007 total)