Viewing 15 posts - 226 through 240 (of 327 total)
Select g.name
From tblGroups g
Join tblGroupMemberships gm
On gm.groupId = g.GroupId
Where gm.UserId = 7
Or the same thing turned around
Select g.name
From tblGroupMemberships gm
Join tblGroups g
On g.GroupID = gm.GroupId
Where gm.UserId =...
April 26, 2005 at 12:26 pm
Chris,
Yes, my concern is trapping for errors. I would like to make the code as bulletproof (within reason) as possible.
I'm not so concerned about a "fatal" error since as...
April 26, 2005 at 8:39 am
"...so is the comma separated group list in the user table the best way..."
Bite your tongue! Pretty much listen to what David said although I think you want your third...
April 25, 2005 at 8:35 pm
If siteglobalcode can be null then you may have to do something like this:
Where...And Isnull(siteglobalcode,'') =
Case
When @p_sitecode is null then Isnull(siteglobalcode, '')
Else @p_sitecode
End
Of course the second Isnull parameter...
April 25, 2005 at 6:20 pm
Edited to correct syntax:
Where...And siteglobalcode =
Case
When @p_sitecode is null then siteglobalcode
Else @p_sitecode
End
April 25, 2005 at 5:37 pm
Steve,
Thanks for the suggestion. I'm also consdering:
Declare @pk int,
@error int
Select top 1 @pk = MyPrimaryKey
From MyTable
Where ...
Select @error = @@error
If @error <> 0
Begin
Raiserror...
April 25, 2005 at 3:00 pm
Many people develop the false idea that Sql Server or any relational database will return rows in the order they were inserted. Although this may...
April 23, 2005 at 11:23 pm
If your looking for another way to teminate the while loop you can use BREAK.
example:
While 1 = 1
... your code
if <condition to terminate loop>
BREAK
...
April 22, 2005 at 3:11 pm
You can return values by using an "output" paramenter or by capturing the value returned by the "Return" statement.
Its well documented in BOL.
April 22, 2005 at 12:13 pm
Everything you need to know about SQL Dates:
http://www.sql-server-performance.com/fk_datetime.asp
with credit to Frank Kalis
April 21, 2005 at 8:31 pm
He's a link to info on the snapshot isolation level in sql 2005.
April 21, 2005 at 2:57 pm
I don't believe you can do that in Sql 2000. However I think Sql Server 2005 will have a method to accomplish what you are asking. For now you need...
April 21, 2005 at 2:44 pm
I guess I just don't understand because I don't see how the statement above could ever return any rows since grouping by OrderNumber, EmailAddress would never have a count...
April 21, 2005 at 2:28 pm
For a full and complete excellent explanation of all of the above and more check out Frank's article noted above:
http://www.sql-server-performance.com/fk_datetime.asp
Very nice piece of work! Thanks Frank.
April 21, 2005 at 12:10 pm
What John posted should work. Just sort on the date column in the table. You can still select and convert that column for display in any format of your choice.
April 20, 2005 at 8:19 pm
Viewing 15 posts - 226 through 240 (of 327 total)