Using SQL Server stored procedures can greatly improve the running speed of programs, simplifying the difficulty of programming maintenance, has been widely used. The stored procedure is actually a collection of Transact-SQL statements that are
/**
* Authorized
*/
EXEC sp_configure ' show advanced options ', 1;
Go
Reconfigure;
Go
exec sp_configure ' xp_cmdshell ', 1;
Go
Reconfigure;
Go
/** Import a text file for a specified table.
EXEC Master.. xp_cmdshell ' bcp dbname.
Sometimes we want to know by a value that this value comes from which table and which field in the database, search the Web and find a better way to implement it through a stored procedure. You just need to pass in a value you want to find, and you
A. Stored procedures
1. Classification of stored procedures
A stored procedure is a database object that is stored in a database and can be executed by an application through one call, and
Allows users to declare variables, perform conditionally,
To create a stored procedure annotation in SQL Server to MySQL
#!/usr/bin/perl
Use DBI;
Use Switch;
Use Encode;
Use ENCODE::CN;
My $source _name = "Sqldb";
My $source _user_name = "sa";
My $source _user_psd = "123";
My $db _name= "MySQLdb";
Default in SQL Server is not sensitive to case, for example, Username= ' Jesse ' and Username= ' Jesse ' result are the same. When validating a password, you may need to be sensitive to string capitalization, and you need to do some processing to
In general, people choose to vertically expand (scale up) SQL Server databases rather than scale-out (scale out). Vertical scaling is easy: adding hardware, processing power, memory, disk, and increasing network speed. The principle is to still run
A string that requires a location in the string AA,DD,CC,RR,FFF is easily implemented in C # or Java by split, but there is no direct split function in SQL Server.
Of course, such problems can always be solved.
ALTER function [dbo].
The following statements are part of the MS SQL statement and are not available in Access.
SQL Category:
ddl-Data Definition language (create,alter,drop,declare)
dml-Data Manipulation Language (Select,delete,update,insert)
dcl-Data Control
Problem Description:
There will always be times in the work of this situation, in the development or QA program running is always good, but to the production environment, the program is not run out. The most impressive is the two Web page items
The problem is described as follows:
-------YYC
A network-related or specific and instance error occurred while establishing a connection to SQL Server. The server was not found or could not be accessed. Verify that the instance name is correct
The following is an example of a full-text index for SQL Server databases, as in the pubs database. Need a friend under the reference
first, introduce the steps to create a FULL-TEXT index using system stored procedures: 1 ) to start the
Recently learned the new features of SQL 2005, probably a lot of people know, I am relatively slow, after two days are 2010 years, before I began to learn 2005. To sum up:
The table is as follows:
CREATE TABLE TB (ID varchar (m), CName varchar (),
Too many VLFs
The SQL Server database engine internally divides each physical log file into multiple virtual log files, so that the log management system can easily track those parts that can be reused. The transaction log file determines how many
Lock of database
Lock is a very important concept in database, it is mainly used to guarantee database integrality and consistency under multi-user environment. We know that data inconsistency occurs when multiple users can manipulate data in the
Server we can save any type of file to SQL Server, and before we do that, we'll set up a test table, Testfile.sql:
if exists (SELECT * from dbo.sysobjects WHERE id = object_id (N ' [dbo].[ TestFiles] ')
and OBJECTPROPERTY (ID, N ' isusertable ') = 1
Server/* Access to User table information travel target
SET NOCOUNT on
DECLARE find_user_table CURSOR
For
SELECT [name],crdate from sysobjects
WHERE type= ' U '/* Here only refer to the User Defined table * *
Order BY [name]
DECLARE @cName VARCHAR (
In the daily work, we will encounter the following situation, a table daily growth of tens of thousands of levels, and the query data is usually in this month or this year, the previous data is occasionally used, but the efficiency of query and
One, stored proceduresA stored procedure is a set of T-SQL statements that are compiled in a single execution planStored procedures: Like functions are saved in the database (programmability)Advantages of stored procedures:1. Allow modular
SQL Server uses fuzzy query to process special characters.
Today, when I was dealing with SQL queries, I encountered the like Query problem, so I analyzed the problem.
Problem:
Select * from v_workflow_rt_task_circulate where Name like '% [admin]
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.