Viewing 15 posts - 32,221 through 32,235 (of 59,099 total)
That's essentially the same as the UNPIVOT solution already posted, Eric. I've not tested it but I'm pretty sure the CASE statement that Drew wrote will beat it fairly...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 20, 2011 at 8:43 pm
Kabelo. (10/20/2011)
try the following script
regards,
Kabelo
CREATE TABLE #Fruits(FruitID INT,FruitName VARCHAR(10))
INSERT INTO #Fruits
VALUES('1001','Apple')
INSERT INTO #Fruits
VALUES('1002','Orange')
INSERT INTO #Fruits
VALUES('1003','Mango')
INSERT INTO #Fruits
VALUES('1004','Banana')
INSERT INTO #Fruits
VALUES('1005','Grape')
--SELECT *FROM #Fruits
DECLARE @FruitNames VARCHAR(8000)
SELECT @FruitNames = COALESCE(@FruitNames + ', ',...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 20, 2011 at 8:40 pm
I believe we can shorten up the code just a bit... it probably won't make much of a difference in performance... (shamelessly leveraging Chris' test data)
-- CTE mimics real table
;
WITH...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 20, 2011 at 8:35 pm
I've found that the only things that most DBA's are "risk adverse" about are safety of the data and the safety of "the system". I know many that ride...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 20, 2011 at 8:14 pm
Chiang (10/20/2011)
I used
sqlcmd -U dbName -P password -S hostName -y 0 -u -d dbSchema -i C:\MyLargeScriptFile.sql
Is there a limit for the file size for MyLargeScriptFile.sql?
The reason is that...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 20, 2011 at 7:57 pm
I've run into similar problems and was loath to grant any privs to any login other than PUBLIC. The way I've solved the problem was very simple. I...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 20, 2011 at 7:53 pm
brad.woody (10/19/2011)
--Jeff Moden
Change is inevitable... Change for the better is not.
October 20, 2011 at 7:41 pm
OCTom (10/19/2011)
I hope you don't mind a bit of criticism about your blog. I find it difficult to read. I don't know if it's the grey background, the font, or...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 19, 2011 at 9:52 pm
Lowell (10/14/2011)
--Jeff Moden
Change is inevitable... Change for the better is not.
October 18, 2011 at 10:28 pm
[font="Arial Black"]Danger!!!! DO NOT USE RECURSIVE CTES FOR COUNTING!!!! PERIOD!!!![/font]
See the following article for why...
http://www.sqlservercentral.com/articles/T-SQL/74118/
[font="Arial Black"]Danger!!!! DO NOT USE ANY FORM OF CONCATENATION WHEN SHREDDING CSVS!!!! PERIOD!!!![/font]
See the...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 18, 2011 at 10:22 pm
Conversly, I'd also like to see them stop deprecating useful features such as sp_MakeWebTask, etc, etc.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 18, 2011 at 10:14 pm
jared-709193 (10/18/2011)
GilaMonster (10/18/2011)
Be honest, don't exaggerate your skills, don't claim to know stuff you don't.
The job that I took in April of this year was one of these types of...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 18, 2011 at 10:11 pm
stebennettsjb (10/17/2011)
We just upgraded SCCM to r3 and ive started monitoring the back-end with Red Gates SQL Monitor. Over the weekend ive got over 1k warnings about long queries....
--Jeff Moden
Change is inevitable... Change for the better is not.
October 18, 2011 at 10:07 pm
Amy.G (10/18/2011)
--Jeff Moden
Change is inevitable... Change for the better is not.
October 18, 2011 at 9:53 pm
MidBar (10/17/2011)
In one query, starting either at "Select" OR ";With", how can we generate all possible patterns of capital alphabits, order by All alphabits.
For example the desired output is follows.
A
AB
ABC
ABCD
ABCDEFGHIJKLMNOPQRSTUVWXYZ
...
...
...
B
BC
BCD
BCDE
BCDEFGHIJKLMNOPQRSTUVWXYZ
...
...
...
YZ
Z
May...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 18, 2011 at 9:45 pm
Viewing 15 posts - 32,221 through 32,235 (of 59,099 total)