Viewing 15 posts - 10,666 through 10,680 (of 13,461 total)
elegant way? not really...you've got to convert to int, add the value, then convert the value back to varchar/nvarchar, then you have to add the preceeeding zeros:
SELECT RIGHT('000000' + convert(varchar(30),...
August 7, 2009 at 9:11 am
i had the first monday of this month as an already saved snippet;
her's the step by step on how i got the third friday:
now instead of adding two weeks as...
August 6, 2009 at 11:05 am
thanks for the feedback;
can you clarify, you wanted to edit the procedure so it only returned results for 'CONSUME','SLOFF' and not all 5 values? was that the objective?
August 5, 2009 at 10:49 am
there was a syntax error in the OR portion of the where statement where a minus sign should be an OR;
'SLOFF' - mx_2 = 'UNCONSUME'
should be
'SLOFF'...
August 5, 2009 at 10:00 am
sure...the ISNULL or COALESCE function can do what you want:
create view myView
as
select
tableA.col1 as cola1,
tableA.col2 as cola2,
ISNULL(tableB.col1,'no selection') as colb1, --assuming...
August 5, 2009 at 9:40 am
misread the requirement...how about this:
SELECT
IssueNumber,
Status,
min(ActivityDate) As ActivityDate,
min(EndDate) As EndDate
FROM(
select MyAlias.* ,myAlias2.ActivityDate as EndDate from
(select
IssueNumber,
...
August 5, 2009 at 8:49 am
thank you for the DDL and sample data; that makes it SO easy to test and offer suggestions;
will row_number give you the data you are looking for?
try these two SQLs...
August 5, 2009 at 8:36 am
Yeah, SQL Server is really stateless in that situation, like a web page would be...unless you poll for a new snapshot of data,and compare against your local cache to see...
August 5, 2009 at 7:15 am
well it can be done...but the better question is do you really want to....you might not after you think through the ramifications...
lets assume that someone adds a new record and...
August 5, 2009 at 6:32 am
correct me if I'm wrong, but i think you want to find the first Monday of the month, and delete anything prior to that?
is that right? or do you want...
August 4, 2009 at 8:03 pm
as Steve identified, your trigger is designed for just a single row of data.
here's a version that should handle multiple rows gracefully.
compare it to yours and see how it simplified...
August 4, 2009 at 6:59 pm
by default, SSMS only shows the first 255 characters in text mode, so your results are being cut off.
Tools>options, and go to the spot below, icrease it to 8000 and...
August 4, 2009 at 4:11 pm
do you know if the search call is coming from a stored procedure?
that's the next thing i'd look at, was parameter sniffing. if the procedure being called has any...
August 4, 2009 at 12:02 pm
you could use a LOGON TRIGGER, and test the app_name() = 'Microsoft SQL Server Management Studio Express - Query', and deny the logon attempt if it is not in...
August 4, 2009 at 11:05 am
most likely manually updating statistics more often would resolve the issue;
statistics only get auto-updated(assuming auto update is ON) if 20% of the rows in a table have changed...
on a...
August 4, 2009 at 10:56 am
Viewing 15 posts - 10,666 through 10,680 (of 13,461 total)