Viewing 15 posts - 21,121 through 21,135 (of 22,224 total)
How about using a CTE within a UNION query. Something like this:
WITH MyCTE AS
(SELECT SalesOrderId
,row_number() over (order by TotalDue DESC) AS TotalRank
,TotalDue
FROM Sales.SalesOrderHeader)
SELECT TOP 5 *
FROM MyCTE
UNION
SELECT *
FROM MyCTE
WHERE SalesOrderId...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 4, 2008 at 4:13 am
This seriously sounds like a highly questionable approach.
However, if you really want to do it, you need to use dynamic SQL:
DECLARE @mySQL nvarchar(max)
SET @mySQL = 'SELECT ' + @Column...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 1, 2008 at 12:31 pm
But if you were using SMO as a code generation utility, it wouldn't matter that you had to use the name would it? I mean if we assume that you...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 1, 2008 at 12:26 pm
I've done it both ways. The one recommendation I can make is to make this consistent with the rest of the system. If the system is using artificial and invisible...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 1, 2008 at 11:48 am
I'm sorry. I really don't know at this point. We use this all the time and it works just fine.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 1, 2008 at 10:12 am
Dynamic management views related to transactions are what you're looking for. But, just so you know, that's not the final answer. That's where to look in the documentation to get...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 1, 2008 at 9:56 am
How about that fact that FoxPro is no longer in the development path (although they're supporting it through 2015)?
Sorry, couldn't help it. I really don't know that much about FoxPro.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 1, 2008 at 9:29 am
A CTE is very local. In fact, it's only available to the SQL query that immediately follows it, although it can be used multiple times within that query. so you...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 1, 2008 at 9:25 am
Posting homework is bad enough. Cross-posting homework is getting a bit over the line. See my response on the other thread.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 1, 2008 at 9:22 am
Clearly, obviously homework. You even posted the question numbers.
For help of this kind, you have to show what you tried that didn't work rather than have any of us do...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 1, 2008 at 9:21 am
Sorry I wasn't clear. We collect both BatchComplete & RPCComplete because, depending on the app, the calls are made in different ways and we want to see both (most are...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 1, 2008 at 9:17 am
Talking about which tool is better can be a pretty slippery slope. I've been using ERStudio for years. I used to use ERWin and the company I'm currently at was...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 1, 2008 at 7:57 am
The one approach that occurs to me is to use SMO to walk your procedures, identify the parameters, and alter the CATCH statements with an additional insert to a log...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 1, 2008 at 7:48 am
What about using the OUTPUT clause. That will capture the generated fields. This script assumes the ID field in the t1 table is
CREATE TABLE #temptable
(id INT, val VARCHAR(50))
INSERT INTO t1
(val)
OUTPUT...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 1, 2008 at 7:41 am
I'm still not sure you found a bug. I use scripts to capture profiler traces all the time and the two events we capture are RPC complete and Batch complete....
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 1, 2008 at 6:10 am
Viewing 15 posts - 21,121 through 21,135 (of 22,224 total)