Viewing 15 posts - 91 through 105 (of 148 total)
I am not sure what you meant there about visibility.
A CTE only exists for the duration of the query with which is defined. You can't assign a value in a...
May 12, 2013 at 10:04 pm
But you can access a local variable.
DECLARE @Start int
SET @Start = 3
;WITH NumberSequence ( MonthNumber )
AS (
-- Anchor Member
SELECT @Start AS MonthNumber
...
May 12, 2013 at 7:55 pm
I know it is giving me an error, which I state.
The question is: can you assign the result to a local variable from inside the CTE.
Here is what the 2nd...
May 12, 2013 at 4:40 pm
But you are not assigning the local variable from inside the CTE.
I know how to do it outside.
I am not really interested in how to get the monthly list. ...
May 12, 2013 at 3:48 pm
Actually, that was a mistake that I fixed. Change the line "1 AS MonthPart" in CTE1 to "2 AS MonthPart".
I hadn't realized what the CTE was doing when...
May 12, 2013 at 2:53 pm
What this CTE does is create comma separated list of months and put them on each row of months. This would be used for something else. I am...
May 12, 2013 at 2:40 pm
I have no problem getting rid of it.
My problem is that I don't ever want the scripter to add the database name. It never should. Otherwise you couldn't...
April 19, 2013 at 10:44 am
That handled that issue.
Is there a setting for the adding the database to the Insert or Update scripts:
INSERT INTO [MyDEV].[dbo].[District]
...
April 18, 2013 at 4:45 pm
Thanks, just wanted to make sure.
BTW, if I did want to make it unique, would I then use:
CREATE INDEX D_IX1 ON D(AID, DID)
Thanks,
Tom
March 4, 2013 at 5:20 pm
That was what I thought, but wasn't sure.
Thanks,
Tom
March 4, 2013 at 2:23 pm
Would I also have to reference the PK in D as well:
CREATE INDEX D_IX1 ON D(AID, DID)
Also, would it be best to have it "Unique" as well.
This normally doesn't happen....
March 4, 2013 at 11:07 am
Then maybe the foreign key constraint should be dropped and readded. Not sure how long that would take.
If you disable a constraint and reenable it and you then lose...
March 2, 2013 at 8:48 pm
I am deleting the referenced records first, so if I just disable that table do the deletes then reenable the FK then all should be well?
Is there a way to...
March 1, 2013 at 2:26 pm
That might work ok in this situation, where I only have 3 possible values.
Sorting doesn't matter as I am not going to sort by this one.
It wouldn't work as well...
October 1, 2012 at 3:28 pm
The problem is that if I add the status into the Group By clause, even inside the ROLLUP function, it uses the status as part of the grouping - which...
October 1, 2012 at 2:36 pm
Viewing 15 posts - 91 through 105 (of 148 total)