Viewing 15 posts - 136 through 150 (of 192 total)
The system table cross join method is really slick (and it is a lot smaller!). The only downside is it adds I/O overhead to the query (~52,000 reads in SQL2k)...
December 6, 2006 at 2:34 pm
If I understand your comment correctly, could you not just append an:
ORDER BY 1
to the query?
December 6, 2006 at 2:34 pm
Good Points Gift Peddie and Antares686. For some reason, I was thinking in join operators. Sorry guys!
December 6, 2006 at 1:14 pm
you can't return results from EXEC() into a varchar. (unless you take the results out of the table variable)
I may be missing something here, but why are you using...
December 6, 2006 at 11:54 am
To elaborate, @Results is a table variable with a schema to match the output of your query.
December 6, 2006 at 11:41 am
Try this:
INSERT INTO @Results
EXEC (@FileExist)
December 6, 2006 at 11:40 am
That is a very subjective question.
It depends on how the tables and columns are indexed, what join operater is used, etc.
Examples:
are both columns in the join predeicate indexed at all,...
December 6, 2006 at 11:37 am
I would be surprised if there was a faster way to do it than this... (let me know if you want a different type of random number) Oh, and for...
December 6, 2006 at 11:07 am
Your example will give you the same results nomatter how your db is configured.
Len will always implicitly trim trailing spaces, datalength will not. Be aware, though, that datalength and len...
December 6, 2006 at 10:57 am
SQL Server does sometimes treat a space as the same as an empty string.
This occurs when the database compatibility is set to 65 or lower.
To quote MSDN:
Whether SQL Server...
December 6, 2006 at 10:19 am
What is the max width of your comment column? Could you please provide the schema for your two tables?
Thanks
December 6, 2006 at 9:24 am
/*************************************
*** Set up example table structure ***
*************************************/
CREATE TABLE #order
(
Order_id INT PRIMARY KEY CLUSTERED
-- ...
)
CREATE TABLE #OrderComment
(
CommentID INT PRIMARY KEY NONCLUSTERED,
Order_ID INT REFERENCES #order(Order_Id),
Comment VARCHAR(500)
-- ...
)
CREATE CLUSTERED INDEX IXC__OrderComment__Order_Id
December 5, 2006 at 3:06 pm
You can definitly concatenate rows in a select statement. Give me a few mins and I'll give you an example
December 5, 2006 at 2:26 pm
In SQL 2000 (and earlier) a deadlock will terminate the process. The only way to handle errors (that I know of) is to code error handling logic outside the scope...
December 4, 2006 at 11:46 am
There are a number of reasons SQL make the decesion not to use an index. Sometimes the query optimizer determines that a bookmark lookup is more costly than a clustered...
November 14, 2006 at 1:43 pm
Viewing 15 posts - 136 through 150 (of 192 total)