Viewing 15 posts - 5,686 through 5,700 (of 7,597 total)
From a purely performance stand-point, we'd almost certainly want to process Countries prior to it being JOINed:
SELECT A.City_Name, B.Country_Code, B.Country_Area
FROM Cities A
INNER JOIN (
SELECT Country_Code,...
October 16, 2014 at 1:36 pm
The GO separates the code into "batches". SQL parses and prepares an execution plan separately for each batch.
Thus, without the GO, when SQL parses the query below...
October 16, 2014 at 1:28 pm
kd11 (10/16/2014)
October 16, 2014 at 1:17 pm
I'd think you'd definitely want to use LTRIM() and RTRIM() to make sure you get rid of extraneous spaces. I added ISNULL(NULLIF(...)...) just in case there isn't a dash...
October 16, 2014 at 12:55 pm
If you can live with only a three-char month, you can remove the STUFF() function. If you need to have the full month name, you'll need the STUFF() part...
October 16, 2014 at 12:34 pm
I admit, I name all constraints myself, including DEFAULTs, even though for DEFAULTs that may be deprecated.
CREATE TABLE Theory (
Id int identity(1,1) CONSTRAINT Theory__PK primary key,
Data varchar(20),
LogDate datetime CONSTRAINT Theory__DF_LogDate...
October 16, 2014 at 12:21 pm
Do you have some type of id or other unique/key value on the row?
October 15, 2014 at 12:56 pm
I agree with others, particularly on ISNULL(). In fact, there's a simple, very easy to remember rule:
NEVER use ISNULL() in a WHERE or JOIN clause.
If, as is typical, the...
October 15, 2014 at 11:11 am
You could even DROP and (re)CREATE the procedure as long as you re-added the extended procedure with the version number after the CREATE.
October 15, 2014 at 11:01 am
Staggerlee (10/14/2014)
Is there a way via T-SQL to check or read information from a stored procedure? Ie, could I add a comment with a build number in it?
I suggest...
October 14, 2014 at 3:12 pm
I suggest a different method to avoid 2 or more decimal points:
AND CASE
...
October 14, 2014 at 3:09 pm
Jeff Moden (10/14/2014)
It'll be interesting when an actual vendor name also contains dashes. 😛
In that case, presumably we would search first for a digit only, "%0-9%", then do the search...
October 14, 2014 at 8:14 am
SELECT Fulltext, Contract2,
Substring(Contract2, Contract3_Start, Contract3_Length) AS Contract3
FROM (
SELECT Fulltext From [Sonae].[dbo].[Images_Local]
) AS test_data
cross apply (
SELECT Substring(FullText, PATINDEX('%Contrato%',FullText), 50) as Contract2
) as...
October 13, 2014 at 3:45 pm
SELECT Fulltext, Contract2,
Substring(Contract2, Contract3_Start, Contract3_Length) AS Contract3
FROM (
SELECT 'Contrato Promocional 2010-241772 Descrico CDR TD' AS Fulltext UNION ALL
...
October 13, 2014 at 10:59 am
CELKO (10/10/2014)
Identity is as good, convenient, practical way of assigning something like a sequential Order#.
No it is not; we have the ANSI/ISO Standard CREATE SEQUENCE now....
October 13, 2014 at 8:54 am
Viewing 15 posts - 5,686 through 5,700 (of 7,597 total)