Viewing 15 posts - 48,676 through 48,690 (of 49,552 total)
DECLARE @Challenge TABLE (
RowNo INT IDENTITY
DesignationName varchar(100)
Description Varchar(1000)
)
DECLARE @LastRow INT, @MiddleRow INT
INSERT INTO @Challenge (DesidnationName, Description)
SELECT * FROM tblDesignation
ORDER BY DesidnationName --(replace with order of your choice here)
SELECT @LastRow =...
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 17, 2007 at 5:55 am
I had exactly the same question in my last job interview. Really threw me for a few moments
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 17, 2007 at 4:43 am
This will probably work, but it is not nice. Untested. Give it a try, if it throws errors, let me know
SELECT tab1.name, min(tab2.company)
from tab1 inner join tab2 on tab1.id...
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 17, 2007 at 3:59 am
If you're using 2000, please rather post in the 2000 forums in the future. The row_number function is SQL 2005 only. Since the query was in the 2005 forum, I...
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 17, 2007 at 3:29 am
You asked for non-cursor. Try this (untested). If not 100%, should give you a start
INSERT INTO New_Cust_Table (UserId, Password, SelectStmt)
SELECT UserID, UserID + '1#',
'AND Account Like ''%''' + REPLACE(REPLACE(AccountNo,'& ',...
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 17, 2007 at 3:26 am
Which two do you want?
This will get you first 2 alphabetically. I assume you are using SQL 2005.
SELECT
Name, Company 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
We stand on the bridge and no one may pass
May 17, 2007 at 2:57 am
Hard to tell really without seeing the table and index structure. Your best be would be to run the query in query analyser with the execution plan enabled, and see...
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 17, 2007 at 2:39 am
Run profiler for a while. When you get the blocking, check the spid and refer back to profiler to find out what the spid did before calling the get_attachment.
Possible (frightening)...
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 17, 2007 at 12:13 am
From a quick look, it looks like the sp_get_attachment stored proc is beginning a transaction and not committing or rolling it back. A stored proc should always commit or...
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 16, 2007 at 3:11 am
I'm what most people would call a development dba. I tune indexes, rewrite scripts, monitor performance and suggest better ways of doing things.
I have a say in the design 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 16, 2007 at 1:47 am
Books Online (the SQL online help) is extremely good.
Are you looking for more for info on administration or development?
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 15, 2007 at 2:40 am
Try
LIKE '/%' ESCAPE '/'
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 15, 2007 at 2:17 am
Thanks. I'm planning to put a similar trigger on a couple of my servers. Good to know about the execute as
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 14, 2007 at 6:17 am
And don't forget Books Online
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 14, 2007 at 3:42 am
You would see reduced space used, how much depends on the size of the rows and the number of rows in the table. You'll only see the space reclaimed after...
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 11, 2007 at 4:24 am
Viewing 15 posts - 48,676 through 48,690 (of 49,552 total)