Viewing 15 posts - 46,861 through 46,875 (of 49,552 total)
Use sp_executesql insead of EXECUTE. It allows you to pass variables in and out of dynamic SQL
books online has plenty examples
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
April 17, 2008 at 4:33 am
chandrachurhghosh (4/17/2008)
Well, to support my opinion about storage and clustered index, try out the following....create a view with schema binding......then try to create a non-clustered index on it......
Indexed views are...
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
April 17, 2008 at 4:25 am
chandrachurhghosh (4/17/2008)
Isn't...
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
April 17, 2008 at 4:19 am
That is not true.
The definition of a heap is a table that does not have a clustered index, not a table with no index at all.
It is very possible...
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
April 17, 2008 at 2:45 am
Because the index is not covering and the table scan is cheaper
To do an index seek in this case requires 3 reads. 2 of the index tree and one 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
April 17, 2008 at 2:24 am
Lookup the ISNULL function. Should do what you want.
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
April 17, 2008 at 1:55 am
Then the interviewer is either wrong (the syntax is valid and works fine in sQL 2005) or he has something else in mind.
If someone told me that, I would...
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
April 17, 2008 at 1:52 am
If there's no cluster on the table, then the Rid (Row identifier) is the file ID, page number and slot index for the row.
I don't think there's any definitive...
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
April 17, 2008 at 1:49 am
I believe that's the partition_id.... Try this query in whatever DB has the ID 9
SELECT object_id, index_id from sys.partitions where partition_id = 72057594112638976
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
April 17, 2008 at 1:41 am
Ahmad Osama (4/17/2008)
Well..I think that we cant use CASE statement in update query..however,
Why not?
CREATE TABLE [dbo].[TheTable](
[ID] [int] identity,
[TheName] [varchar](50) NULL
)
GO
insert into TheTable (TheName) Values ('Tom')
insert into TheTable (TheName) Values...
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
April 17, 2008 at 1:38 am
The first and the third are equivalent, though the first is using an older form of joins that is not recommended any more.
The 2nd and 3rd should be equivalent. The...
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
April 17, 2008 at 1:33 am
Developer edition includes the agent and there's no way to install the db engine without it been installed as well. (I tested that out yesterday)
Is that the version of your...
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
April 17, 2008 at 1:31 am
A case statement should do the trick.
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
April 17, 2008 at 1:14 am
I don't think I want to know what the DB looks like. I do wonder what account the web site was accessing the DB with.
Drop database .... ?
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
April 17, 2008 at 12:28 am
Severe overkill. 😉
Reindex completely rebuilds an index and updates the statistics with a full scan.
Reorganise shuffles leaf pages of an index into order. If the index has just been rebuilt,...
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
April 17, 2008 at 12:21 am
Viewing 15 posts - 46,861 through 46,875 (of 49,552 total)