Viewing 15 posts - 151 through 165 (of 1,923 total)
Nope, not required. A INSERT + UPDATE stament could do it; else, as you are in SQL 2008, you can use MERGE syntax to do that in one shot.
Post...
May 7, 2012 at 1:24 pm
Doable, but with a bit of help from you.
Please read the following article and provide us create table, sample data and ur expected output based off of the sample data
May 4, 2012 at 12:51 pm
Try DATENAME function
May 4, 2012 at 11:10 am
Totally lost.... can you be more elaborate on what u r trying to accomplish?
take a look at this article for more information -> How to post questions[/url]
May 3, 2012 at 1:18 pm
Schema binding has its own advantages and disadvantages.. But whn u create a view, how ofter do u alter it? You wouldnt right? then i think, schema binding can be...
May 3, 2012 at 12:06 pm
sqlfriends (5/3/2012)
I can understand them, but just cannot think of how to make it like this at the beginning :(.lack of practice and experience?
Yep, Practice and experience can only...
May 3, 2012 at 11:13 am
Jeff Moden (5/2/2012)
ColdCoffee (5/2/2012)
SELECT STUFF(CONVERT(VARCHAR(30),'2012-12-12 18:07:33.933',7),4,5,'-')
Result -- 201-12 18:07:33.933
But this produces proper result:
declare @date datetime = '2012-12-12 18:07:33.933'
SELECT STUFF(CONVERT(VARCHAR(30),@date,7),4,5,'-')
I guess, the CONVERT, when...
May 2, 2012 at 11:19 pm
For anyone that is interesed in solving the problem but feeling sore due to OPs attachement, pfa the .sql file that has the table script, insert statements and my solutions...
May 2, 2012 at 11:14 pm
Method 1 (Multiple Row Number)
; with base as
(
SELECT sg.schoolyear, sg.schoolid,sg.GradeCd,g.GradeSortNbr
, rn1 = row_number() over...
May 2, 2012 at 7:35 pm
Jeff Moden (5/2/2012)
Regardless of language selected (well... at...
May 2, 2012 at 7:08 pm
Thomas Stringer (5/2/2012)
A few notes, your "teacherid" field doesn't seem like much of an "id".
Completely agree.. it looks more of a dud column..
May 2, 2012 at 6:29 pm
We dont need , 2 ROW_NUMBERs
this will do
; with cte as
(
select t.teacherid,t.tlname,t.tfname, cast(t.schoolid as varchar) as schoolid, s.schoolname
, rn = row_number() over (partition by t.tlname,t.tfname order by...
May 2, 2012 at 6:28 pm
try this
; with cte as
(
select t.teacherid,t.tlname,t.tfname, cast(t.schoolid as varchar) as schoolid, s.schoolname
, rn = row_number() over (partition by t.tlname,t.tfname order by s.schoolid)
from teacher t
join school s...
May 2, 2012 at 6:25 pm
Can you reduce the number of rows in ur sample data? my SSMS hangs while i copy paste it 🙁
May 2, 2012 at 4:55 pm
Did u alteast read the article me and Lynn pointed?
May 2, 2012 at 4:31 pm
Viewing 15 posts - 151 through 165 (of 1,923 total)