Viewing 15 posts - 6,976 through 6,990 (of 10,144 total)
pravin.sawant99 (11/30/2010)
Please can you tell1) which table will first scan by sql server then which one..
2) which join will be considered first.
3) whether order of join causes query performance?
1) Check...
November 30, 2010 at 8:36 am
cimbom_kid (11/30/2010)
Many thanks for your help, but the query doesn't return the results i need. The resulting query should be:
linenum, fileline, group_id
1 a, 1
2 b, 1
3 c, 1
4...
November 30, 2010 at 6:52 am
DROP TABLE #TMP_LOADER
CREATE TABLE #TMP_LOADER (
linenum int IDENTITY (1, 1),
fileline varchar(max),
group_id int)
INSERT INTO #TMP_LOADER (fileline)
SELECT 'a' UNION ALL
SELECT 'b' UNION ALL
SELECT 'c' UNION ALL
SELECT '------' UNION ALL
SELECT 'd' UNION...
November 30, 2010 at 5:41 am
You're welcome Dan, thanks for the generous feedback.
Don't forget in future to always include sample data.
November 30, 2010 at 4:30 am
Thanks Dan.
SELECT rn = ROW_NUMBER() OVER(ORDER BY JobNo, Line),
Line, JobNo, PropRef, Cont, RepDate, RepTime, LogDate, LogTime, ShortDesc, Access, JobDesc, ClientJob
FROM (
SELECT Line, JobNo, PropRef, Cont, RepDate, RepTime, LogDate, LogTime,...
November 30, 2010 at 4:13 am
Try this, untested of course - no sample data to test against!
DROP TABLE #Table
CREATE TABLE #Table (
JobNo CHAR(5),
...
November 30, 2010 at 3:28 am
Dan, if you set up the sample data like I suggested, it will be instantly usable. Not many folks will be inclined to do the formatting for you.
SELECT 'JobNo', 'Ref',...
November 30, 2010 at 3:07 am
Dan
Copy the following code and paste it into an SSMS window. Correct the DDL to match your table then amend the INSERT script to provide say 10 rows of data...
November 30, 2010 at 2:36 am
darunsurey (11/29/2010)
I need to know whether we can use corelated sub query in case satatements.Arun
Yes you can but it's rarely a good idea.
darunsurey (11/29/2010)
I have a student table, employee table,...
November 29, 2010 at 7:15 am
RichardDouglas (11/27/2010)
Duplicate post due to refresh error
Haha! That's how I ended up posting "What's next"!
November 29, 2010 at 2:12 am
Sorry my bad - this matches your original requirement in your first post.
You would benefit from experimenting with the code and understanding how it works:)
DECLARE @Today DATETIME, @nMonths TINYINT
SET...
November 25, 2010 at 10:05 am
Which query are you running? If you altered the code, best post it here.
November 25, 2010 at 9:43 am
kevin4u06 (11/24/2010)
This is the table and sample data (Attached below)my out put shoud be something like this.
My function does the splitting of the address field .
Thank you in advance
You might...
November 25, 2010 at 8:55 am
Kelvin Phayre (11/25/2010)
From your data.
INSERT INTO @Table2 VALUES (01,'P1','01/01/2010',100),
...
November 25, 2010 at 6:55 am
-- Make a couple of sample tables
CREATE TABLE #Table1 (wh CHAR(2), item CHAR(2), stock INT)
INSERT INTO #Table1 (wh, item, stock)
SELECT '01','P1',1 UNION ALL
SELECT '02','P1',1 UNION ALL
SELECT '03','P1',1
CREATE TABLE #table2 (wh...
November 25, 2010 at 6:53 am
Viewing 15 posts - 6,976 through 6,990 (of 10,144 total)