Viewing 15 posts - 16 through 30 (of 33 total)
I found this in books online. Maybe the DISTINCT is causing the error.
The SELECT statement defining an indexed view must not have the TOP, DISTINCT, COMPUTE, HAVING,...
March 11, 2005 at 2:26 pm
Here's a UDF that I found sometime back. It assumes the First letter of the string and every letter after a space should be capitalized. All else is set to...
March 11, 2005 at 1:17 pm
Table A :
ID RegDate
1 2005/1/15
2 2005/1/16
3 2005/1/18
4 2005/1/20
Table B :
ID RegDate
1 2005/1/15
2 2005/1/17
3 2005/1/18
4 2005/1/19
5 2005/1/20
6 2005/1/22
If the ID values for both tables can...
March 11, 2005 at 1:07 pm
Is there a primary/foreign key relationship between the two tables?
There would need to be a way to join the two tables together and match rows.
March 11, 2005 at 12:12 pm
Greg,
Sending a short reply as you did is a great way to show appreciation.
Glad I could help.
Mark
March 11, 2005 at 10:59 am
You probably want to look into SCOPE_IDENTITY in books online.
Here's a short description
SCOPE_IDENTITY and @@IDENTITY will return last identity values generated in any table in the current session. However, SCOPE_IDENTITY...
March 11, 2005 at 10:41 am
If you search for LIKE in books online you'll see a description of each piece of this.
In a nutshell it is saying if any characters in the string are not...
March 11, 2005 at 10:34 am
My guess would be that there would only be extra overhead when the RaiseError was invoked (Maybe not even then).
You could test it by running a script without any RaiseError...
February 14, 2005 at 2:21 pm
The scenario I've seen it used is when you don't want it to enter the loop if the initial fetch doesn't return anything (I failed to include an IF check...
February 14, 2005 at 11:04 am
Both Prasad and Vidas are referring to a more common syntax where you do one fetch outside the loop, then another inside like.
FETCH NEXT INTO
WHILE @@FETCH_STATUS = 0
BEGIN
...
...
FETCH NEXT INTO
END
Your syntax...
February 14, 2005 at 10:45 am
As far as I know there is no direct equivalent to this in SQL Server. You can use sp_help <tablename> to generate a list of column names and their types...
February 14, 2005 at 9:32 am
Try declaring your cursor as static like
'declare muCursor cursor static for ...
It is likely the cursor is resetting when the table data changes from your update.
I should also add that...
February 14, 2005 at 7:55 am
Either of these methods should work. Somebody may post an even better way too.
select a.clientid
, m.messagecount
, o.ordercount
from clients as a
join (select a.clientid,
count(b.clientid) as messagecount...
January 31, 2005 at 12:07 pm
January 24, 2005 at 8:27 pm
Since the parameters and the table values could both be NULL, you need to convert each into something you can compare with. So the following syntax works.
select x,y
from Table1
where isnull(x,'') =...
January 20, 2005 at 1:59 pm
Viewing 15 posts - 16 through 30 (of 33 total)