C:\Program Files\mysql\mysql Server 5.1\bin1.1 Defining a stored procedure with no parametersDefine statement End with//Delimiter//CREATE PROCEDURE Proc_teacher_noparam ()BeginSELECT * from teacher;End//Define statement end use;delimiter;1.2.
Connecting to a databaseThe following PHP code shows how to connect to an existing database. If the database does not exist, it will be created and a database object will be returned.PHPclassMyDBextendsSQLite3 {function__construct () {$this->open ('
1. Add a fieldCopy codeThe Code is as follows:If not exists (SELECT * from syscolumns where id = OBJECT_ID ('querydatasource ') and name = 'iscrosstable ')BEGINAlter table QueryDataSource ADD IsCrossTable bit default (0) -- insert FieldEND 2 stored
In ajax programming, we often need to assign the page content obtained by xmlhttp to a container (such as div, span, or td) through innerHTML, but there is a problem here, that is, if the page content we will assign to innerHTML contains scripts,
SQL server to determine whether a table or temporary table exists, SQL server
1. Determine whether a data table exists
Method 1:
Use yourdb; goif object_id (N 'tablename', N 'U') is not nullprint 'There is 'else' print' doesn't exist'
For
One of the stored procedures-creating a simple Stored Procedure
I. Stored Procedure
Stored Procedures (Stored Procedure) are a set of SQL statements for specific functions in large database systems. They are compiled and Stored in the database.You
The following are common SQL statements used by SQL Server and access to operate database structures. The content is organized by HAI wa. if the content is incorrect or incomplete, please submit it. Thank you.
Create a table:Create Table [Table
ArticleDirectory
Sp_spaceused
Sp_spaceused
Displays the number of rows, the reserved disk space, and the disk space used by the tables in the current database, or the disk space reserved and used by the entire database. Syntax
View the space occupied by each table in the MSSQL database. Recently, you need to check the size of the user table, including the number of records and the number of occupied disk space. After searching for a long time on the Internet, you can view
--- Obtain the occupied capacity of tables in the SQL Server database
Create procedure get_tableinfo
If not exists (select * from dbo. sysobjects where id = object_id (n' [dbo]. [tablespaceinfo] ') and OBJECTPROPERTY (id, n' isusertable') =
In fact, you only need to use the built-in storage process sp_spaceused to obtain table-related information.
For example, sp_spaceused 'tablename'
The following is a stored procedure for writing convenience. The purpose is to store all the
If exists (select * From DBO. sysobjects where id = object_id (n' [DBO]. [p_getpassword] ') and objectproperty (ID, n' isprocedure') = 1)
Drop procedure [DBO]. [p_getpassword]
Go
/* -- Brute-force cracking SQL Server user password
Attackers can
1. SQL Server 2000 database Dictionary (table structure. SQL)
Select top 100 PERCENT -- a. id,
Case when a. colorder = 1 THEN d. name ELSE ''end as table name,Case when a. colorder = 1 THEN isnull (f. value, '') ELSE'' end as table description,A.
From http://www.cnblogs.com/suno/archive/2008/02/04/1064368.html
Use Product function optimization.
This article mainly introduces 3 Algorithms
1Prime Number of linear time sieve
2Returns the Euler's number of the first N in linear time.
3Evaluate
/Files/bgming/sqlhistory.rar
In many applications, you need to save the historical records of a data table for future query. in SQL Server 2000
.
In the trigger, the SQL server's inserted and deleted virtual tables are used to execute the
If not exists (select * From DBO. sysobjects where id = object_id (n' [DBO]. [tablespaceinfo] ') and objectproperty (ID, n' isusertable') = 1)
Create Table tablespaceinfo -- create a temporary table(Nameinfo varchar (50), -- table nameRowsinfo int, -
Recently, you need to check the size of the User table, including the number of records and the number of occupied disk space. After searching for a long time on the Internet, you can view the space occupied by each table in the MSSQL
SQL Server C # connection and object existence judgment
This article provides a comprehensive overview of C # database connection.
For C # connection to ms SQL Server, sqlconnection is primarily used. The authentication mode is windows integrated
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.