Gets the modification time of the stored procedure and the creation time of the query--Table select * from sysobjects where id=object_id (N ' table name ') and xtype= ' U ' --table structure select * from syscolumns where id=obje ct_id (N '
Mysql batch Add a new column stored procedure in the table, mysql new
Generally, for websites with a large access volume, the request log table is created independently on a daily basis. The business needs to add a new column for each table. After a long time, the
Oracle tables cannot be exported with SQL scripts if they contain CLOB fields, especially when data backup is required or data import and export is inconvenient. This stored procedure you simply pass in the table name and the results that need to be returned, you can get the executable SQL, directly in PL/SQL to perform the returned results, you can export the da
I believe everyone has met the lock table. I think everyone knows how to unlock the table. However, there are some low-level kill processes. We use stored procedures to implement this function.
I believe everyone has met the lock table. I think everyone knows how to unlock the tabl
The MySql stored procedure dynamically creates a table and inserts data to a recently created Project. The database uses MySql, which is not very skillful in MySql, but can be simply used, after all, simple SQL statements are still the same, but as the project goes deeper into complicated SQL statements, MySql stored p
Tags: style blog color io data div SP CTI Log--determine if the database existsif exists(Select * fromsys.databaseswhereName= 'Database name')Drop Database [Database name]--determine if a table existsif exists(Select * fromsysobjectswhereId= object_id(N'[table name]') and ObjectProperty(ID, N'isusertable')= 1)Drop Table [Ta
DDL statements cannot be used directly in Oracle's stored procedures, such as CREATE, alter, DROP, truncate, and so on.That assumes that we want to create a temporary table in a stored procedure that can only use dynamic SQL statements:Create or replace procedure Pro as str
Check whether SQL exists-- Determine whether the database existsIf exists (select * from master .. sysdatabases where name = N 'database name ')Print 'exists'ElsePrint 'not exists'----------------- Determine whether the table name to be created existsIf exists (select * from dbo. sysobjects where id = object_id (n' [dbo]. [Table name] ') and OBJECTPROPERTY (id, n'isusertable') = 1)-- Delete a tableDrop
【Recommendation]SQL Server One of the uncommon applications
Obtains the basic information, Field List, and stored procedure parameter list of a table.
-- Establish a personal brand through knowledge sharing.
1. obtain basic table information
Select [tablename] = [Tables]. name, [tableowner] = [
Write the stored procedure for the first time, write well to suppress flexion.set @c_db := (select database());drop procedure if exists alter_tables_engine;delimiter //create procedure alter_tables_engine() begin declare db varchar(64); declare done boolean default 0; declare t varchar(64); declare table_n
Label:Original situation:A server table AServer B also has a table aThere is a stored procedure on server B to insert the local head table into the a server table.After the change:A field inserttime is added to the a server table,
Ocialrelation SET lingqi = 1800 WHERE NodeName = shizuname;24 ELSE25/* Otherwise, normal update */26 UPDATE socialrelation SET Lingqi = Lingqi + WHERE NodeName = shizuname;27 END if;28 EN D if;29 FETCH NEXT from RS toShizuname, currentlingqi;31 UNTIL done END repeat;33 34/* Close cursor */35 close rs;36 END Today write a MySQL stored procedures, according to their own needs to traverse a data t
Tags: Create PROCEDURE prctestbypage (@tablename varchar (), @selectfilter varchar (100),
@orderbyfilter varchar, @selectpage int, @pageSize int As begin--The stored procedure begins declare @pkname varchar (100)--Gets the primary key name of the table SELECT @pkname =column_name from I N
Tags: date time traffic from the name DDD package whileGeneral traffic is larger than the Web site, and the request log table is created independently of one table per day. The business needs to add a new column for each table, and for half a day, write a stored procedure li
In Oracle, compare the data in a table with the input parameters and perform corresponding operations (stored procedures). If table a contains y records greater than x, insert y A words to Table.
In Oracle, compare the data in a table with the input parameters and perform c
words) of the information, can only write this degree, or hope to have the guidance of the Great God.=======================================================================A table is created in the database to hold the data that was last processed. When the software starts, read the data to the interface and then empty the table.Before I used ADO in VC + + in 2 steps: In the transaction, read the table dat
The data in the ORACLE Stored Procedure table is overwritten and restored. The old Stored Procedure overwrites the new stored procedure. As a result, all the previously used functions a
Tags: mysq l database stored procedure dynamic table prepare
PREPARE statement_name from sql_text/* definition */
Execute statement_name [USING variable [, variable ...]]/* Execute preprocessing statement */
deallocate PREPARE statement_name/* Delete definition */
This is used in my project, as a reference to use:DELIMITER $ $DROP
For websites with a large access volume, the request log table adds a new column for each table to create a business independently for each table every day. after a long time, the stored procedure is as follows: the log table stru
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.