Viewing 15 posts - 11,521 through 11,535 (of 13,469 total)
you'll want to use the Row_Number() function featuring the Partition parameters:
CREATE TABLE Proj
(ProjId INT
,ProjDt...
February 25, 2009 at 9:01 pm
yep i think you got it;
do you also need to find users with zero roles, or roles with zero users?
February 25, 2009 at 7:48 pm
i think it should be fairly simple, right? didn't test it, but this is my first guess:
SELECT
UserRole.UserID,
UserRole.RoleID
FROM UserRole
LEFT OUTER JOIN (SELECT UserId, COUNT(RoleID) AS...
February 25, 2009 at 6:48 pm
clearly you've copied and pasted your homework straight from the book.
we don't do homework, but if you show us what you've done so far, we can offer suggestions.
February 25, 2009 at 5:54 pm
e wants to hide the column names in his presentation layer; he's going to get column names regardless, right?
also i think his columns are char and not varchar, so he...
February 25, 2009 at 4:53 pm
ok, you'd have to tweak this to become a function i guess, but this seems to work.
you'll have to have a Numbers or Tally table to use this, but it...
February 25, 2009 at 9:48 am
well, if it's displayed as html, CRLF do not show up!
html does not respect whitespace... you need {BR} markups to do that!
(replace curly braces with LT/GT..forum doesn't like real HTML...
February 24, 2009 at 6:56 pm
the carriage returns are still there...are you looking at the data in SSMS in grid mode? grid mode hides CrLf.
in SSMS, hit Control T, then re-run your query.
your data should...
February 24, 2009 at 6:46 pm
SQL has a case statement so you can say exactly that...when somestring then ...
only caveat is all the values returned by the case statement must be the same data type.
but...
February 24, 2009 at 6:38 pm
what result are you getting?
create table #test(
testid int identity(1,1) not null primary key,
stuff varchar(30) )
insert into #test
select 'one' union all
select 'two' union all
select 'three' union all
select 'four'
select * from...
February 24, 2009 at 6:31 pm
yeah, you are mistaken. the reseed value assigns the next value, not next+1.
February 24, 2009 at 6:08 pm
your command reset the Id to zero...if you want, you could DBCC CHECKIDENT('sometablename', RESEED,-999); and the identi would start at -999, and work it's way towards zero and beyond
I assume...
February 24, 2009 at 6:02 pm
We had a similar situation...Developers were givien full access because an important project needed to be updated to production as soon as the developers finished a module.
the problem was, because...
February 24, 2009 at 8:06 am
there is no built in, easy way.
the procedure sp_fkeys [YourTableName] will report all the tables that have a FK relationship with your table, but there is no way to get...
February 24, 2009 at 7:45 am
Viewing 15 posts - 11,521 through 11,535 (of 13,469 total)