Viewing 15 posts - 1,396 through 1,410 (of 3,957 total)
September 27, 2013 at 2:14 am
That is my recommendation.
I find the resulting code to be a bit easier to understand.
September 27, 2013 at 1:50 am
enriquezreyjoseph (9/27/2013)
My sexID will never contain embedded quotes...because with this table
*Bio
bioIB
fname
mname
lname
sexID
statusID
*sex
sexID
sex(male or female only)
*status
statusID
status(single,married or divorced only)
sexID and statusID from bioID belongs to different table...
so my View table would...
September 27, 2013 at 1:28 am
I'd bet money though that ChrisM's first solution, bizarre as it seems, is probably the fastest one suggested.
I had to dissect it myself before I figured out what he was...
September 27, 2013 at 1:25 am
Perhaps a rather incomplete example will help:
SET @SqlQuery = ' SELECT * FROM TestMyView WHERE 1 = 1 ' +
...
September 27, 2013 at 1:20 am
Continuing curiosity regarding this problem drove me to see how the proposed solutions scale, so I built a test harness.
CREATE TABLE #T (
Rate int NOT NULL,
Shift int NOT NULL,
PRIMARY KEY...
September 27, 2013 at 12:41 am
sqlnes (9/26/2013)
I've done a test,
Step 1: run "select count(*) from table1;" -- return 3
Step 2: begin a transaction to insert 3 records...
September 27, 2013 at 12:08 am
I love extended properties. Very comprehensive introductory article!
The only think I find annoying about them (unless I missed something) is that you can't update them. Need to delete...
September 26, 2013 at 11:48 pm
T.Ashish (9/26/2013)
Thanks hunchback, Sean Lange and dwain.c for help.I'm going with CROSS APPLY as it has least logical reads and lesser cost then other two.
Thanks Again.
I do not recommend that...
September 26, 2013 at 11:16 pm
If I am reading this article (http://weblogs.sqlteam.com/peterl/archive/2010/07/02/Proper-Relational-Division-With-Sets.aspx) correctly, this solution should also be pretty fast:
WITH Target AS
(
SELECT Rate, Shift
FROM @T
...
September 26, 2013 at 11:08 pm
And I just noted that while your question is different, the answers to your earlier post:
http://www.sqlservercentral.com/Forums/Topic1498669-1292-1.aspx
will cross over with the answers here.
September 26, 2013 at 10:19 pm
The short answer is yes, however I have several issues with what you're trying to do.
1. [Issue #1] In the statement below, you're setting the right part of the quality...
September 26, 2013 at 10:13 pm
I am a bit curious how hunchback and my solutions would scale against a divide and conquer approach.
SELECT Shift
INTO #T
FROM @T
WHERE Rate = @Rate;
DECLARE @Rows INT = @@ROWCOUNT;
SELECT...
September 26, 2013 at 9:16 pm
enriquezreyjoseph (9/26/2013)
Hi everyone 😉why is this statement has error??.. 🙁 i can't figure it out..
SET @statusID = ' AND statusID = ' + convert(varchar(20), @statusID)
Most likely, the declaration for...
September 26, 2013 at 8:13 pm
I like the SQL# library too.
Note that this article was based on a "call for an article" by this site's editor, which constrained how the input data was to appear....
September 26, 2013 at 8:04 pm
Viewing 15 posts - 1,396 through 1,410 (of 3,957 total)