Never used MySql but based on my search, you can't use that syntax in Mysql. Alternate way is, just store the result of query into some variable & use it for comparison to achieve the output. Check this sample MySQL Stored Procedures IF NOT EXISTS()[^]
BTW, always include the complete error message(just 'Syntax error' is not enough) in your question which is better for members to give you answers quickly.
VB.NET projects have a root namespace[^]. Unless you've cleared that in your project's properties, your class exists within that namespace, and you need to include it within the EXTERNAL NAME specification:
EXTERNAL NAME triggertest.[YourNamespace.Class1].abc
CREATEASSEMBLY triggertest FROM'D:\dll\Interop.ADODB.dll' WITH PERMISSION_SET = SAFE
Are you sure that's the correct assembly? That looks like an interop assembly for the ancient "ADODB" library to me.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
I have a SQL table with some existing data. In that I have a columns named "Name" and SL No (which is a primary key). For example say I have one entry for that column as "Thilak". Suppose if a next entry comes with same name i.e "Thilak", I want to rename the existing "Thilak" as "Thilak_Slno" and new entry as "Thilak_Slno". And If again any Thilak repeats I want append serial number to that before saving or soon after saving to the database.
The purpose is simple, I am giving option to post a query in my software based on username. while selecting the name, if same name exists in entry that will be difficult to select the Name, if name comes with serial number it will be easier.
So whenever a new entry comes which is same as the existing name, I am planning to append the serial number to the existing names also to the incoming name.
So, now whether it is possible to change the name as it enters into the table ? or should I change once it get saved to database ?
If you want all names to be unique, then just add the serial number in the first place. Then you do not need the extra steps of searching for an existing name and changing it when adding to your database. Alternatively just accept that there may be duplicates which you can process when searching.
You shouldn't change it at all. They are two separate facts, and should each be in their separate field. That way you don't need to "substring" on the name when the numbering changes, and can easily add another field if your combination is no longer unique.
The database is not there to store "formatted" values, but data. Upon retrievel, you paste to two fields together and have what you want.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
i have been using the below declared Cursor from the Stored-procedure for around 3 years now. The last couple of weeks i have been getting the error
Incorrect syntax near the keyword 'CROSS'.
I dont have a Cross Join in this Cursor and this started after Infrastructures upgraded the hardware on the SQL Server , i noticed other settings were lost but was able to recover them.
GO/****** Object: StoredProcedure [dbo].[DATABASE_MAINTANANCE_PLAN] Script Date: 5/22/2010 12:32:30 PM ******/SETANSI_NULLSONGOSETQUOTED_IDENTIFIERONGO/*THIS SP WILL REBUILT ALL THE INDEXES IN ALL TABLES IN ALL DATABASES
THIS WILL BE CALLED FROM AN SSIS PACKAGE. THIS WILL USED IN CLIENTS TO REBUILT INDEXES AND IT WILL BE
RAN EVERY FRIDAY NIGHT
ASDECLARE@DatabaseName SYSNAME = DB_NAME(), @TableNameVARCHAR(256)
DECLARE@FILLFACTORINT = 85DECLARE@DynamicSQLNVARCHAR(max) =
'DECLARE curAllTablesInDB CURSOR FOR SELECT TABLE_SCHEMA +
''.'' + TABLE_NAME AS TABLENAME
FROM ' + @DatabaseName + '.INFORMATION_SCHEMA.TABLES WHERE
TABLE_TYPE = ''BASE TABLE'''BEGINEXEC sp_executeSQL @DynamicSQL-- create tables cursorOPEN curAllTablesInDB
FETCH NEXT FROM curAllTablesInDB INTO@TableNameWHILE (@@FETCH_STATUS = 0)
BEGINSET@DynamicSQL = 'ALTER INDEX ALL ON ' + @TableName +
' REBUILD WITH (FILLFACTOR = ' + CONVERT(VARCHAR,@FILLFACTOR) + ')'PRINT@DynamicSQL-- ALTER INDEX ALL ON Purchasing.ShipMethod REBUILD WITH (FILLFACTOR = 85)EXEC sp_executeSQL @DynamicSQLFETCH NEXT FROM curAllTablesInDB INTO@TableNameEND-- cursor WHILECLOSE curAllTablesInDB
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
I am planning to migrate from MSFlexGrid to MsHflexGrid. In MSFlexGrid, when the .col /.row property is changed programmatically, the rowcolchange event gets fired. But in MsHflexGrid the same doesn’t work. However, on manually changing the .col/.row property through mouse click or using navigation keys, the event gets fired in MSHFlexGrid