free, and cross-platform, on the contrary, how much would it cost to use Asp+mssql?
The paging difference is different when the SQL statement gets the total number of records.Select COUNT (*) from Guestbook; MssqlSelect name from note; Mysql
MySQL is an open source database, smaller, but functional and fast. Much better than access.
SQL Server,mssql is also it. It's a database from Microsoft. Very large
-- SQL deletes the Foreign keys of all user data tables in the database
-- Query all constraints of the current database before deletionSelect * From information_schema.key_column_usage
Declare @ tablename nvarchar (250)-- Declare that the cursor mycursor1 is used to read all data tables in the databaseDeclare mycursor
database server;4. The above is the backup and restore of the data, if it is to involve the database structure of the backup, such as table structure, stored procedures ..... Backup, there are two ways: a "Attach" MDF file, which of course will come with all the information, including data, but in the case of MDF, such as the database you want to copy is someone else's server, and your permissions can not get the MDF, only use the following method, A
data, if it is to involve the database structure of the backup, such as table structure, stored procedures ..... Backup, there are two ways: a "Attach" MDF file, which of course will come with all the information, including data, but in the case of MDF, such as the database you want to copy is someone else's server, and your permissions can not get the MDF, only use the following method, Another way: first generate a script (task-build script) for th
, PersonName)Values ('1', 'name1 ')Insert Into Person (PersonId, PersonName)Values ('3', 'name3 ')Commit TransAction/*Select values include '1', 'name1', and '3', 'name3 ',This indicates that only the error in the second sentence has been canceled.*/
Method 1 for all rollback: Open XACT_ABORT
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Use TestDB
SET XACT_ABORT ON -- open
Begin TransAction
Insert
Sample script that displays all of the users in a given SQL Server dB.
Supported platforms
SQL Server 2000Yes
Script code
CopyCodeThe Code is as follows: strdbservername = "."
Strdbname = "scriptingguystestdb"
Set objsqlserver = Createobject ("sqldmo. sqlserver ")Objsqlserver. loginsecure = trueObjsqlserver. Connect strdbservername
Set objdb = objsqlse
Let me show you the picture.
The above figure stored procedure called Mup_geta (I wiped out the name associated with the project)
The above illustration uses the SQL Server Graphics manager's own features to view objects that depend on Mup_geta.
The result was a bit shocking and it didn't list MUP_GETB (I'm using SQL Server 2005)
Here's how to fix it
Method 1:
Open the database management interface-
Organize other people's SQL
Presumably the idea is to use Union and UNION ALL
--Merge duplicate rowsSELECT * FROM AUnionSELECT * FROM B
--Do not merge duplicate rowsSELECT * FROM AUNION ALLSELECT * FROM B
Sort by a field--Merge duplicate rowsSELECT *From (SELECT * FROM AUnionSELECT * from B) as TOrder BY Field name
--Do not merge duplicate rowsSELECT *From (SELECT * FROM AUNION ALLSELECT * from B) as T
... begin sql_str: = ' Select Uo.object_name,uo.object_type from User_objects uo where Uo.object_type not in ("INDEX", "LOB") Order by uo.object_type Desc '; EXECUTE IMMEDIATE sql_str BULK COLLECT into Tab_name,tab_type;For I in Tab_name. First: Tab_name. Last LOOP begin sql_str: = ' DROP ' | | Tab_type (i) | | "| | Tab_name (i); EXECUTE IMMEDIATE Sql_str; Dbms_output.put_line (SQL_STR);Exception when others then v_err_code: = SQLCODE; V_err_msg: = SUBSTR (SQLERRM, 1, 200); Dbms_output. Put
Tags:archvarchar node find null classdropvaluesselect drop table #Area; CREATE TABLE #Area (ID INT not NULL, City_name NVARCHAR (+) NOT NULL, parent_id INT NOT null) INSERT into #Area ( ID,CITY_NAME,PARENT_ID) VALUES (1, ' Jiangsu Province ', 0) insert into #Area (id,city_name,parent_id) VALUES (2, ' Changzhou ', 1) insert INTO # Area (id,city_name,parent_id) VALUES (3, ' Tinian District ', 2) insert into #Area (id,city_name,parent_id) VALUES (4, ' new North ', 2) insert Into #Area (id,city_nam
SQL Server1. Query All TablesSelect [ID], [name] from [sysobjects] where [type] = ' u ' ORDER by [name]2. Query all databasesSelect [Name] from [sysdatabases] ORDER by [name]3. Query the fields in the tableSelect [Name] from [syscolumns] where [name] = ' tablexxx ' ORDER by [Colid]Oracle1 . Find all indexes of the tabl
In MSSQL, how does one use SQL to clear data from all tables? There are three types of requirements:First, as long as the table in the database is empty;Second, the table is empty and the auto-growth column can grow from 1.Third: The table is empty, and the auto-growth column can grow from 1, and there are constraints between tables.The invitation month has been sorted out and put here for reference by frie
-- SQL backup of all database scripts declare @ currentdatabasename nvarchar (100) declare @ currentbackfolder nvarchar (200) declare @ currentbackstring nvarchar (2000)
Set @ currentbackfolder = 'd: \ test '-- this is the backup directory. All databases are backed up to this directory.-- Query all database names--
-- SQL creates a primary key for all user data tables in the database-- Primary key Description: The name is ID, and the data type is Integer auto-increment.
-- Query all constraints of the current database before creationSelect * From information_schema.key_column_usage
Declare @ tablename nvarchar (250)Declare @ columnname nvarchar (250)Set @ columnname = '
Tags: BSP set a div effect sel span technology posPrepare two tables: --T1 (2,3)--t2 (1,2,3,4) Subquery for--all,any,some-->all The result set in the parent query is greater than the value in each result set in the subquery, trueSELECT * FROM T2 WHERE n>all (select N from T1) -->any,some The result set in the parent query is greater than the value in any result
Tags: view table size Baidu occupies space sql
Query all database names and their sizes on the machine where the database is located2. Query the names and sizes of all tables under the databasePlease expert guidance!
1. View all database related information, parcel storage path, etc.Use masterSELECT * FRO
As my friends who used to work with asp often found that some code was inserted into all the content of their own database. It would be too troublesome to delete the records one by one in tables, next I found a method for batch deletion on the Internet, which is actually to replace the malicious code in batches, which is very fast.
As my friends who used to work with asp often found that some code was inserted into
Program Idea: Use select name from sysobjects where xtype = 'U' to obtain all tables, and then open the table cyclically, according to rs_colums.fields (I ). name: field name. fieldtype (rs_colums.fields (I ). type) to obtain the field type, rs_colums.fields (I ). definedsize 'width
Because rs_colums.fields (I). Type Returns numbers, a fieldtype function is written in the program to convert it to a Chinese type.
Private sub commandementclick ()
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.