Viewing 15 posts - 226 through 240 (of 331 total)
Ignoring any potential logic problems, the syntax error is caused by not naming the derived table, like so
Select SUM(L_VALUE), SUM(B_VALUE) FROM (SELECT DISTINCT ID,C_NO FROM MYTABLE GROUP BY ID,C_NO)...
July 13, 2011 at 6:54 pm
It seems that way and I see some post on both the forums and ask ssc.
July 13, 2011 at 1:47 pm
What I mean is I had to register for replying on there just as I did for SQLServerCentral.com making it seem as if it is seperate or a sub part...
July 13, 2011 at 1:44 pm
It cant get any better than the SQLBOT put it for you.
July 13, 2011 at 1:38 pm
Even if your doing this only with in a database you could use sp_msforeachtable to execute across all tables. Only recommended this because you were looking for dependents which soulds...
July 13, 2011 at 1:17 pm
why don't you use the 1900-01-01 instead of the zero and then filter out that date if needed.
July 13, 2011 at 12:47 pm
what is the severity and state?
here is the state discriptions:
ERROR STATE
ERROR DESCRIPTION
2 and 5
Invalid userid
6
Attempt to use a Windows login name with SQL Authentication
7
...
July 13, 2011 at 12:38 pm
The reason I ask is their is the possibility there is no index for the order by thus causing it to scan the whole table.
July 13, 2011 at 12:20 pm
So can you post the error report? That will help.
July 13, 2011 at 11:59 am
Generally speaking I beleive in using wiindows groups and then only assign the appropreate permissions to those groups.
July 13, 2011 at 11:55 am
Have you look at the query execution plan to see what is killing it?
July 13, 2011 at 11:43 am
Try this instead
Select SUM(L_VALUE), SUM(B_VALUE) FROM (SELECT DISTINCT L_VALUE,B_VALUE FROM MYTABLE )
but I think this is what you want
Select ID, SUM(L_VALUE), SUM(B_VALUE) FROM (SELECT DISTINCT ID,L_VALUE,B_VALUE FROM...
July 13, 2011 at 11:23 am
If your going to use this accross the board. Why don't you do away with the cursor and use sp_MSForEachDB.
July 13, 2011 at 11:21 am
Do you have sql authentication enabled on the server? Do you have the error report?
July 13, 2011 at 10:57 am
Viewing 15 posts - 226 through 240 (of 331 total)