Viewing 15 posts - 48,691 through 48,705 (of 49,571 total)
Or, since we're using SQL 2005, we can use a CTE
;
WITH LotsOfDates(TheDate) AS (
May 18, 2007 at 12:49 am
Can you post the query please? Table structure and sample data also, if possible.
May 17, 2007 at 11:27 pm
Don't post your homework here like that again. Homework is supposed to be for you to do to learn something, not for other people to do for you.
You learn nothing...
May 17, 2007 at 6:25 am
Maybe. Won't be the first time.
I used to do student marking when I was at university. The markers had a habit of doing an internet search for code if...
May 17, 2007 at 6:18 am
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 =...
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
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...
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...
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,'& ',...
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
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...
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)...
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...
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...
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?
May 15, 2007 at 2:40 am
Viewing 15 posts - 48,691 through 48,705 (of 49,571 total)