Viewing 15 posts - 3,136 through 3,150 (of 4,085 total)
CELKO (5/23/2012)
we do not use bit flags
Until SQL supports a true Boolean data type, bit is the best alternative.
* Why would I reserve 2 bytes for a...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 24, 2012 at 8:31 am
Jeff Moden (5/23/2012)
The day that I want is really the end of the previous month which is always 1 day less the 1st of the month. So I just...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 24, 2012 at 7:43 am
Consider adding a computed column to your CustomerMaster table to produce the domain name. If you can't update the structure, then you can use a CROSS APPLY to make...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 23, 2012 at 7:51 am
CELKO (5/22/2012)
Rows are not records. Again, this is COBOL and not SQL. Time for a total re-write .. sorry.
Wikipedia disagrees with you
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 23, 2012 at 7:35 am
Consider using a reporting tool, such as SSRS, to write your reports. Otherwise the crosstab/pivot already recommended is your best approach.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 22, 2012 at 11:33 am
Brandie Tarvin (5/17/2012)
drew.allen (5/17/2012)
I prefer this to prevent NULL values.
DECLARE @L_ZERO INT = 0
SELECT @L_ZERO = IdMyTable FROM MyTable WHERE ColumnRef = 1000
Drew
Drew, how does that prevent NULL from overriding...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 17, 2012 at 12:12 pm
Nakul Vachhrajani (5/17/2012)
How's this?
DECLARE @L_ZERO INT
SELECT @L_ZERO = ISNULL(IdMyTable,0) FROM MyTable WHERE ColumnRef = 1000
SELECT @L_ZERO
This doesn't produce the same results as the original queries. Specifically, when there is...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 17, 2012 at 11:23 am
I prefer this to prevent NULL values.
DECLARE @L_ZERO INT = 0
SELECT @L_ZERO = IdMyTable FROM MyTable WHERE ColumnRef = 1000
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 17, 2012 at 11:18 am
You have a couple of options depending on what you want. As Lynn is trying to point out you have an implicit CROSS JOIN, so you can make it...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 17, 2012 at 11:12 am
The problem is here:
from GLDEFRLS
INNER JOIN accropts AC
ON AC.AccAccrOption = EM.EacAccrOption
INNER JOIN empaccr...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 17, 2012 at 9:59 am
anthony.green (5/17/2012)
set datefirst 1
DECLARE @dt DATETIME, @WeekOfMonth TINYINT
SET @dt = '2007-07-08'
SET @WeekOfMonth = DATEDIFF(week,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 17, 2012 at 8:37 am
Sean Lange (5/16/2012)
Your points are all...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 16, 2012 at 9:56 am
Mark-101232 (5/16/2012)
Use LIKE
SELECT ..FROM mytable
WHERE PartNumber LIKE '[0-9][0-9][0-9][0-9][A-Za-z][0-9][0-9]'
If your collation is case-insensitive (default ), you don't need to specify both A-Z and a-z.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 16, 2012 at 9:03 am
Sean Lange (5/16/2012)
alter proc MyProc
(
@SomethingElse int
)
as begin
select top 5 * from sys.sysobjects as Something
if exists(select...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 16, 2012 at 8:51 am
You might also want to add the CASE statement as a computed column on your PART table and create an index on that computed column.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 16, 2012 at 7:31 am
Viewing 15 posts - 3,136 through 3,150 (of 4,085 total)