Viewing 15 posts - 46 through 60 (of 334 total)
Would something like this get you started?
create table #temp (
Row_Ndb int,
Account_Nbr int,
Account_Name char(5),
Account_Desc char(3),
Begin_Date date,
End_Date date
)
insert into #temp values
(1, 1, 'test1', 'chk', '1/1/2012', '3/1/2012'),
(2, 1, 'test1', 'chk', '3/2/2012', '6/30/2012'),
(3, 1,...
May 17, 2013 at 12:59 pm
I generally break the script down into understandable chunks to analyze it and won't post anything to production until I fully understand it. Using the execution plans and client stats...
May 17, 2013 at 12:01 pm
Yeah, ok, I'm an idiot without my morning coffee.. forgot to restart the server in single user mode for the system tables.. I'll give that a go and let you...
May 16, 2013 at 10:43 am
Both
ALTER DATABASE msdb SET SINGLE_USER
and
ALTER DATABASE msdb SET SINGLE_USER WITH ROLLBACK IMMEDIATE
return
Command(s) completed successfully.
but any attempt to run the dbcc command still gives me that same error. The...
May 16, 2013 at 10:29 am
I think you're making it more complex than it needs to be.. this will give you the customer_ID of everyone who attended.. once you have that list you can use...
April 29, 2013 at 4:42 pm
Excellent.. thank you folks.. I thought there must be some sort of fundamental flaw in my understanding.. lol
April 19, 2013 at 11:17 am
I just don't see the practical application of this foreign key. What benefit does it provide? I'll add that this is a user created database and the user is not...
April 19, 2013 at 11:06 am
Ok, Lynn, let me go pull some test data and post it. I can't, for the life of me, think of any reason why someone would build this structure.
April 19, 2013 at 10:57 am
I'm out for the night but this might get you started.. it will get all the text between the first '.' and the last '.'
NOTE: This is different than the...
April 18, 2013 at 4:57 pm
If you're going to have different length numbers on either side of the underscore you can use this.. it's ugly but works.
declare @textfield varchar(255)
set @textfield = 'Receiving Batch [1234_456.TRN]'
SELECT Replace(Substring(@textfield,...
April 18, 2013 at 1:05 pm
Your PK and consequently your index is on StudentID + SchoolYear.
Your where statement only queries half the key so you're still going to get a scan. If you want...
April 18, 2013 at 12:54 pm
It's a hack but you could always do:
select case when ID is null then 'CountOf' else cast(id as varchar(20)) end as ID, countof
from
(
select id, COUNT(*) as countof
from
(values(100001,1),
(100002,1),
(100003,1),
(100004,1),
(100005,1),
(100006,1),
(100007,1),
(100008,1),
(100009,1)) as Val...
April 18, 2013 at 12:48 pm
As far as I know select * ALWAYS does a scan. You'd have to add WHERE conditions against the indexed columns to get a seek.
April 18, 2013 at 12:37 pm
Viewing 15 posts - 46 through 60 (of 334 total)