Viewing 15 posts - 826 through 840 (of 3,957 total)
With a PRIMARY KEY on telephone number using SQL 2012, both of these queries get me a Clustered Index Scan.
DECLARE @TempTab TABLE (PhoneNum VARCHAR(10) PRIMARY KEY);
INSERT INTO @TempTab (PhoneNum) VALUES...
February 4, 2014 at 6:21 pm
Probably your best course of action is to post the exact SQL you are running along with the results you're getting just as I have done.
February 4, 2014 at 6:11 pm
Are you running the queries I provided using the Temp tables as I defined? Or have you modified them to operate off your real tables?
When I run the second...
February 4, 2014 at 6:09 pm
Sowbhari (2/4/2014)
If the data is always numbers then just convert the data-type to integer which will remove the leading zero's.
SELECT CONVERT(INT,SUBSTRING(Oddvalue,1,charindex(' ',Oddvalue+' ',1)))
FROM @OddRows
Just when you're convinced the first value...
February 4, 2014 at 5:42 pm
p.barwick (2/4/2014)
These are the results I am getting - there are four images in total:The last query doesn't seem to be doing a lot.
Thanks.
Unfortunately I don't have a Skydrive account...
February 4, 2014 at 5:23 pm
p.barwick (2/3/2014)
Color me stupid but where exactly do I need to declare it?Thanks.
It is already declared in the code I provided. You need to do it before the first...
February 3, 2014 at 8:17 pm
p.barwick (2/3/2014)
Thanks for your hard work, it's appreciated. As it stands, executing that query results in:
[Err] 42000 - [SQL Server] Must declare the scalar variable "@N"
...
Can I send you the...
February 3, 2014 at 7:48 pm
To the OP: Please specify precisely what your expected results are. Do not describe them. List out the rows you want to see.
I'm thinking this is a relational...
February 3, 2014 at 7:19 pm
Not sure this is exactly what will work for you but it may be close. Note that I added a PN (STC3333) to see if it would put it...
February 3, 2014 at 6:41 pm
Jeff Moden (2/2/2014)
February 2, 2014 at 8:35 pm
The best advice you're going to get is that you should not be storing your billing month as CHAR(7). Instead, a better choice would be to store it as...
February 2, 2014 at 8:05 pm
Very nice article Jeff and I put in my vote to bump the rating accordingly.
As it turns out, I ran across this problem early in my SQLing. I like...
February 2, 2014 at 6:00 pm
p.barwick (1/30/2014)
Hi,(oldest number) RTC5756 > STC8572 > STC3765 > STC9150 > STC9191 > SFP500160 (newest number)
Is the above exactly the way you want to see the output from the query?...
February 2, 2014 at 5:17 pm
Are you looking for something like this:
WITH Supercessions (PartNo, PNPrior) AS
(
SELECT 'RTC5756','STC9191'
UNION ALL SELECT 'SFP500160','STC9191'
UNION ALL SELECT 'STC9191','STC2951'
...
January 29, 2014 at 9:34 pm
+1 to Luis for your good/charitable mood and two excellent solutions.
January 29, 2014 at 6:17 pm
Viewing 15 posts - 826 through 840 (of 3,957 total)