Viewing 15 posts - 3,421 through 3,435 (of 3,957 total)
Lowell (6/14/2012)
CREATE SYNONYM MailView FOR msdb.dbo.sysmail_allitems
select * from MailView
* note a synonym must point to an object.
so you cannot try to make it part of a name, like...
June 14, 2012 at 7:13 pm
I can add a couple of points because I'm a great believer in using CTEs to improve code readability.
1. You can also think of a CTE as a single-use VIEW....
June 14, 2012 at 6:56 pm
Couple of issues here:
1) You did not post DDL nor data in readily consumable form, but as I'm feeling charitable this morning, I have done that for you.
2) Your expected...
June 14, 2012 at 6:48 pm
Sean Lange (6/14/2012)
;with...
June 14, 2012 at 6:26 pm
anthony.green (6/14/2012)
Have you checked the query and the syntax for sp_executesql?
I would use sp_executesql too in the real world. Too lazy to post solutions to the forum in that...
June 14, 2012 at 6:22 pm
I'm still wondering where CTE2 is defined.
June 14, 2012 at 4:31 am
I'm 99.99% certain that the posted SQL will generate a syntax error.
I'd suggest an answer (I know how to do this) but I'd want to put it into a syntactically...
June 14, 2012 at 12:24 am
Lowell (6/13/2012)
--Results:
/*
ServerName Instance
----------- --------
MyServer SQL2005
*/
SELECT
PARSENAME(Replace(instancename,'\','.'),2) AS ServerName,
PARSENAME(Replace(instancename,'\','.'),1) AS Instance
from(SELECT 'MyServer\SQL2005'...
June 13, 2012 at 10:53 pm
Or this?
SELECT CASE WHEN SourceA IS NULL THEN 'NONE' ELSE SourceA END
FROM #Temp1
GROUP BY SourceA WITH ROLLUP
ORDER BY SourceA
June 13, 2012 at 10:24 pm
My preference is the Dynamic Crosstab approach, so let me give you the briefest of tutorials on how I go about achieving a working query.
First, you need to create a...
June 13, 2012 at 7:34 pm
ChrisM@Work (6/13/2012)
dwain.c (6/13/2012)
sridhar_kola (6/13/2012)
Thanks , it does give the right results .
However, just to understand the code , what does the n%2 in the Where condition signify...
June 13, 2012 at 6:13 am
This might work but it may end up being slower without some kind of indexing:
;WITH CTE AS (
SELECT Student, Grade, Apple, Pear, Banana, Age, Tag
...
June 13, 2012 at 5:40 am
sridhar_kola (6/13/2012)
Hi ,Thanks , it does give the right results .
However, just to understand the code , what does the n%2 in the Where condition signify ?
thanks
I use...
June 13, 2012 at 4:25 am
Methew (6/12/2012)
The only issue is for data integrity....i dnt want mixing of data...Is Inserted.ID is good option OR SCOPE_IDENTITY?which one i should use?
Well, it's not like Inserted.ID is going to...
June 12, 2012 at 7:23 am
Viewing 15 posts - 3,421 through 3,435 (of 3,957 total)