Viewing 15 posts - 48,241 through 48,255 (of 59,099 total)
rbarryyoung (9/18/2008)
Declare @sql as NVarchar(MAX)
Set @sql = ''
Select @sql = @sql + 'EXEC sp_refreshview ''['
...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2008 at 10:40 pm
It's even easier than that...
SELECT *
INTO #MyFiles
FROM OPENROWSET('SQLOLEDB','Server=(local);Trusted_Connection=Yes;Database=Master',
...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2008 at 10:33 pm
Much simpler than all that... check out the ROUND function or the STR function (which also right justifies if you need that for a report or file). 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2008 at 10:27 pm
Heh... and the PIVOT operator is slower and uglier than the CrossTab that Chris showed. Think not? Check it out...
http://www.sqlservercentral.com/articles/T-SQL/63681/
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2008 at 10:26 pm
Ninja's_RGR'us (9/18/2008)
Yes you need to create it first, including column definitions.
Heh... not exactly true...
SELECT *
INTO #MyHead
FROM OPENROWSET('SQLOLEDB','Server=(local);Trusted_Connection=Yes;Database=Master',
...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2008 at 10:18 pm
Heh... absolutely... we need a copy of the file, a copy of the record layout, and copy of the CREATE statement for the target table, and any gotcha's that you...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2008 at 9:39 pm
karthikeyan (9/18/2008)
For what YOU did, yes. But you moved lines of code I posted out of order. You have to figure out where the Pipe character is first...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2008 at 9:29 pm
In that vein, I normally make the test boxes less robust than the production server. If it's fast on the test box, imagine what it will do on the...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2008 at 9:10 pm
Steve Jones - Editor (9/18/2008)
I'd rename the table. That will tell you if it's still being used.Quick.
Heh... that's my favorite method. But, I believe the OP might have a...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2008 at 9:07 pm
bkDBA (9/18/2008)
Jeff Moden (9/18/2008)
Ummm... that'll find the last date a table was SELECTED from?
Yes, provided the new 2008 database audit events are set up:
2008 BOL says: "SQL Server audits consist...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2008 at 9:05 pm
Problem:
SELECT 1/10
Solution:
SELECT 1/10.0
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2008 at 2:37 pm
dva2007 (9/18/2008)
You are creating a table or declaring a table? there is no syntax which you are using. Please use create table syntax.
Ever heard of "Table variables"?
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2008 at 2:34 pm
PaulB (9/18/2008)
abba (9/18/2008)
Syntax will probably be the least of your concerns.:w00t: I respectfully disagree 🙂
I'll agree with that disagreement... syntax changes will be a doozy. Wait until...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2008 at 2:31 pm
Jason Wisdom (9/18/2008)
TempDB is so much more important in SQL 2005 than it was in earlier versions.
And the default settings of 8MB / 1MB with 10% growth is...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2008 at 2:26 pm
Ummm... that'll find the last date a table was SELECTED from?
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2008 at 2:20 pm
Viewing 15 posts - 48,241 through 48,255 (of 59,099 total)