Viewing 15 posts - 46,711 through 46,725 (of 49,552 total)
SQL King (5/5/2008)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 5, 2008 at 8:03 am
IMHO = In my humble opinion.
No.MID has any value,I look at only CODE
So how do you define the 'first' row for a specific code?
Remember, SQL Server has no concept of...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 5, 2008 at 7:51 am
You can't add more filegroups to TempDB. Just more files (tempDB1.ndf. tempdb2.ndf, ...)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 5, 2008 at 7:36 am
By 'first', do you mean the one with the lowest MID? If so, this will work for you.
SELECT <Column List>
FROM Emp Inner join
(SELECT MIN(Mid) AS FirstMID, Code FROM...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 5, 2008 at 7:34 am
Yup.
It's something for you to consider when deciding whether to switch to simple or enable log backups
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 5, 2008 at 7:15 am
If you're not going to do tran log backups and you don't care about recovering to a point in time, in the case of a failure, then there's no reason...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 5, 2008 at 6:12 am
What's the formula for calculating RGB from R, G, B? It's possible that T-SQL can do the maths.
You could create a calculated column in the table, which means the RGB...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 5, 2008 at 6:08 am
Yup. That will work great if the backup was created on the server where the query is being run.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 5, 2008 at 6:07 am
Here's something:
Working with tempdb in SQL Server 2005
An excerpt...
tempdb supports only one data filegroup and one log filegroup. By default, the number of files is set to 1. Multiple files...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 5, 2008 at 5:57 am
No. those will be up to the query optimiser/query processor depending on memory availability, number of rows, etc
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 5, 2008 at 3:29 am
Note it's a resultset, so it's going to be difficult to get into a variable, unless you do something like this.
insert into SomeTable
execute ('Restore .... ')
select @SomeVar = [Database] From...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 5, 2008 at 3:13 am
karthikeyan (5/5/2008)
Can you give me the full query ?
You should be able to figure it out.
I don't have time to type out 6 subqueries each with 10 unioned queries...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 5, 2008 at 3:10 am
... FROM tbl1 INNER LOOP JOIN tbl2 ON ... -- nested loop join
... FROM tbl1 INNER MERGE JOIN tbl2 ON ... -- merge join
... FROM tbl1 INNER HASH JOIN tbl2...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 5, 2008 at 3:08 am
On 2005, you could use a recursive CTE.
Why can't you use a table?
If you absolutely want to do this the hard way, something kinda like this will probably...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 5, 2008 at 2:46 am
Cross join a couple of system tables together. Jeff usually uses spt_values (in master)
You could use a user table also. All you need is one table of 1000 rows.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 5, 2008 at 2:28 am
Viewing 15 posts - 46,711 through 46,725 (of 49,552 total)