Viewing 15 posts - 2,581 through 2,595 (of 3,500 total)
you're not joining to the Inserted or Deleted virtual tables, so your result set is not getting filtered. Once you do that, only the affected records will be updated.
April 10, 2015 at 1:38 pm
Sounds like you tried to run an update query without a filter. You shouldn't need one. Something like this should work.
CREATE PROC uspInsertRecord
@ProductCode VARCHAR(10)
AS
BEGIN
INSERT INTO MyTable(ProductCode, SomeDateField)
VALUES (@ProductCode,GETDATE())
END
April 9, 2015 at 10:37 pm
You need to return just the date portion of the datetime field. After that, it's easy.
April 9, 2015 at 12:58 am
You would have to filter the result set...
DECLARE @StartDateTime DATETIME,
@EndDateTime DATETIME;
SELECT top 100 Ltrim([text]),objectid,total_rows,total_logical_reads , execution_count
FROM sys.dm_exec_query_stats...
April 8, 2015 at 12:07 am
Alan,
Yup, I noticed that... The link I posted is to an article by Pinal Dave simulating LAG/LEAD in 2008. Otherwise, I would have posted a query.
I guess he could...
April 7, 2015 at 2:22 pm
Found an article at SQLAuthority that covers your options:
Simulate LEAD() and LAG() without Using SQL Server 2012 Analytic Function[/url]
April 7, 2015 at 2:02 pm
these must be text...
SELECT *
FROM MyTable
WHERE RIGHT(MyColumn,1)='.'
performance is going to be abysmal, because it's a trailing character, so you're going to get a table scan.
April 2, 2015 at 6:08 pm
I think I got it... and it's not even an April Fool's joke...
April 1, 2015 at 5:43 pm
I give up (for now)... this is as close as I got. Can't figure out how to do the
Count
Percent
part. The rest works a champ.
April 1, 2015 at 5:01 pm
Grrr... I hate SSRS... in a minute I'm going to give up and try this in Excel!!! SSRS absolutely BLOWS!!!
April 1, 2015 at 4:20 pm
Something like...
=Mid(ReportItems!txtNameAddress.Value,InStr(1,ReportItems!txtNameAddress.Value,"(")+1,Len(ReportItems!txtNameAddress.Value)-InStr(1,ReportItems!txtNameAddress.Value,"(")-1)
?
April 1, 2015 at 3:26 pm
Looks like if you created a subreport for this part:
1--------------------------contacted--------------------2-------------1-------------1-----------0----->
1-------------------------%contacted-----------------66%----------100%---------50%----------0%---->
1--------------------------interviewed------------------1-------------0-------------1------------1----->
1-------------------------%interviewed---------------33%----------0%-----------50%----------100%-->
You could do the % under that, and you'd be good to go, right?
April 1, 2015 at 2:19 pm
In a word, Normalize your table. Then this is stupid easy. Repeating fields are going to make your life miserable.
April 1, 2015 at 10:09 am
Took me a while to find it... and stop sitting on Itzik's book and actually read it. Got any good references for learning the hardert part of T-SQL queries...
March 31, 2015 at 7:00 pm
"CTEs cannot be nested" Are you sure? http://stackoverflow.com/questions/7306191/how-to-nest-cte-properly
and what's with all those NOLOCK hints?
https://www.simple-talk.com/sql/database-administration/grant-fritcheys-sql-server-howlers/
March 31, 2015 at 3:22 pm
Viewing 15 posts - 2,581 through 2,595 (of 3,500 total)