SQL determines whether a stored procedure exists
1 Determine if the database tutorial existsSQL codeif exists (SELECT * from sys.databases WHERE name = ' database name ')drop database [database name] if exists (SELECT * from sys.databases WHERE
XML query in SQL Server: For XML specify Auto
Objective
In SQL Server, an XML query can specify Raw,auto,explicit,path. This article introduces some examples of XML queries that specify auto in SQL Server.
Basic example
Fragment 1:
With
Ext: http://topic.csdn.net/t/20040428/12/3016902.html
If you can easily get the table structure of the stored procedure result set. The use of the stored procedure is much more convenient. Like what:INSERT INTO #tmp exec sp_whoTo execute this
The function of database backup and restore using T-SQL statementRepresents four points of knowledge in SQL Server:1. Get the default directory on a SQL Server server2. Use of Backup SQL statements3. Restores the use of SQL statements, taking into
Why is my suffix array running so slow ...Copy the string over to the last, then run SA and sweep it all over again ...---------------------------------------------------------------------#include using namespace std;const int MAXN = 200009;struct
/* Main functions:1. Input basic information of new books.2. Show All records3. query the basic information of a book by its name.4. Delete the withdrawn book information based on the book name.5. sort by book name from small to large.6. count the
Description
I believe that multi-level classification will be used in any information system, and many versions can be found online. The following is based on the MSSQL Stored Procedure edition,
There are still versions of VB and C # in hand, but
The following table structure is available:
Create table OA_GoodType (ID int not null, -- ID field, u can also be said to be a child ID Name varchar (50) null, -- Name Pid int not null, -- parent class ID, if it is a top-level category when it is
XML query in SQL SERVER: FOR XML specifies AUTO
Preface
In SQL SERVER, you can specify RAW, AUTO, EXPLICIT, and PATH for XML queries. This article uses some examples to introduce the XML query of AUTO in SQL SERVER.
Basic example Section 1:
With
/*************************************** ******Reads the structure information of tables in the database.**************************************** *****/Create procedure getalltableinfoBegin
Declare @ strname nvarchar (128), @ TID int, @ strowner
IntroductionThe theory foundation of distributed systems-conformance, 2PC and 3PC describes the issues of consistency, the need to reach a consensus, and the 2PC, 3PC model, where the Paxos protocol guarantees consistent resolution in the scenario
Title Description:If there is a known n person and M-to-friend relationship (stored in the number R). If two people are direct or indirect friends (friends of Friend's friends ...) ), think that they belong to the same circle of friends, please
XML query in SQLSERVER: FORXML specifies AUTO preface. In SQLSERVER, RAW, AUTO, EXPLICIT, and PATH can be specified for XML query. This article uses some examples to introduce the XML query of AUTO in SQLSERVER. Basic example Segment 1:
-- Delete a stored procedure
DECLARE @ string varchar (8000)
While exists (select name from sysobjects where type = 'p' and status> = 0)
BEGIN
SELECT @ STRING = 'drop PROCEDURE '+ name from sysobjects where type = 'p' and status> = 0
-- SELECT @
Topic Description Narration:If there is a known n person and M-to-friend relationship (stored in the number R). Let's say that two people are direct or indirect friends (Friends of friends ... )。 Think they belong to the same circle of friends,
Stored Procedures | data | database | index
--Deleting stored procedures
DECLARE @STRING VARCHAR (8000)
While EXISTS (SELECT NAME from sysobjects WHERE type= ' P ' and status>=0)
BEGIN
SELECT top 1 @STRING = ' DROP PROCEDURE ' +name from sysobjects
1 determining whether a database existsSQL codeif exists (SELECT * from sys.databases WHERE name = ' database name ')drop database [DB name] if exists (SELECT * from sys.databases WHERE name = ' database name ')drop database [DB name]2 Determining
Use if exists to build a table "go"1 Determine if the database has SQL codeif exists (SELECT * from sys.databases WHERE name = ' database name ')drop database [DB name] if exists (SELECT * from sys.databases WHERE name = ' database name ')drop
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.