Click here to Skip to main content
15,900,258 members
Home / Discussions / Database
   

Database

 
AnswerRe: Deducting data vs saving it explicitly Pin
Eddy Vluggen31-Mar-10 0:36
professionalEddy Vluggen31-Mar-10 0:36 
Questionlogin Pin
farokhian30-Mar-10 9:44
farokhian30-Mar-10 9:44 
AnswerRe: login Pin
netJP12L30-Mar-10 10:13
netJP12L30-Mar-10 10:13 
GeneralRe: login Pin
farokhian30-Mar-10 10:42
farokhian30-Mar-10 10:42 
AnswerRe: login Pin
Don Burton30-Mar-10 10:21
Don Burton30-Mar-10 10:21 
Questiontable join Pin
netJP12L30-Mar-10 8:15
netJP12L30-Mar-10 8:15 
AnswerRe: table join Pin
Mycroft Holmes30-Mar-10 22:56
professionalMycroft Holmes30-Mar-10 22:56 
QuestionHelp with T-SQL Statement?? Pin
ostinoh30-Mar-10 5:02
ostinoh30-Mar-10 5:02 
Hello -

I'm in the process of using a script that will help with re-indexes. I keep getting the following errors.

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '('.
Msg 156, Level 15, State 1, Line 10
Incorrect syntax near the keyword 'ELSE'.

My database name is Backdrop and the table is dbo.PJTRAN and the index is pjtran0. Here is the script if someone can help me understand why I keep getting those errors.


IF EXISTS (SELECT [object_id],[index_id],[avg_fragmentation_in_percent] FROM sys.dm_db_index_physical_stats
(DB_ID(N'Backdrop'), OBJECT_ID(N'PJTRAN.PJTRAN0'), NULL, NULL , 'DETAILED')
WHERE [avg_fragmentation_in_percent] < 30)

BEGIN

ALTER INDEX ALL ON PJTRAN REORGANIZE

END
ELSE

ALTER INDEX ALL ON PJTRAN REBUILD


Thank you..
AnswerRe: Help with T-SQL Statement?? Pin
Don Burton30-Mar-10 10:23
Don Burton30-Mar-10 10:23 
GeneralRe: Help with T-SQL Statement?? Pin
ostinoh30-Mar-10 15:21
ostinoh30-Mar-10 15:21 
AnswerRe: Help with T-SQL Statement?? Pin
Mycroft Holmes30-Mar-10 23:03
professionalMycroft Holmes30-Mar-10 23:03 
QuestionDynamic stored procedure returns error and can't find culprit Pin
DeepToot30-Mar-10 3:52
DeepToot30-Mar-10 3:52 
AnswerRe: Dynamic stored procedure returns error and can't find culprit Pin
R. Giskard Reventlov30-Mar-10 4:09
R. Giskard Reventlov30-Mar-10 4:09 
GeneralRe: Dynamic stored procedure returns error and can't find culprit Pin
DeepToot30-Mar-10 4:28
DeepToot30-Mar-10 4:28 
GeneralRe: Dynamic stored procedure returns error and can't find culprit Pin
DeepToot30-Mar-10 4:30
DeepToot30-Mar-10 4:30 
GeneralRe: Dynamic stored procedure returns error and can't find culprit Pin
J4amieC30-Mar-10 5:57
J4amieC30-Mar-10 5:57 
QuestionDynamic CrystalReports Pin
Enobong Adahada30-Mar-10 1:20
Enobong Adahada30-Mar-10 1:20 
AnswerRe: Dynamic CrystalReports Pin
David Mujica30-Mar-10 3:22
David Mujica30-Mar-10 3:22 
GeneralRe: Dynamic CrystalReports Pin
Enobong Adahada30-Mar-10 22:01
Enobong Adahada30-Mar-10 22:01 
QuestionSQL IN statement or exists Pin
programmervb.netc++29-Mar-10 18:32
programmervb.netc++29-Mar-10 18:32 
AnswerRe: SQL IN statement or exists Pin
_Damian S_29-Mar-10 18:46
professional_Damian S_29-Mar-10 18:46 
AnswerRe: SQL IN statement or exists Pin
Mycroft Holmes29-Mar-10 19:11
professionalMycroft Holmes29-Mar-10 19:11 
AnswerRe: SQL IN statement or exists Pin
PIEBALDconsult31-Mar-10 8:38
mvePIEBALDconsult31-Mar-10 8:38 
GeneralRe: SQL IN statement or exists Pin
programmervb.netc++31-Mar-10 9:28
programmervb.netc++31-Mar-10 9:28 
QuestionReusable DataGridView and TableAdapter components in Lookup Tables? Pin
Bert Edens29-Mar-10 11:38
Bert Edens29-Mar-10 11:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.