SQL Server sets uppercase letters

Copy codeThe Code is as follows:/*-- Set uppercase letters for the first character string in SQLServer:-- Author: jinjazz/csdn-- Enable OLEAutomation in SQLServer2005Sp_configure 'show advanced options', 1;GoRECONFIGURE;GoSp_configure 'ole

How to solve the problem that the create database permission is denied in the DATABASE 'master'

Copy codeThe Code is as follows:Public partial class CMS_DBDataContext{Partial void OnCreated (){// Create a database if the database does not existIf (! This. DatabaseExists ()){This. CreateDatabase ();}}} The following error occurs: the create

SQL determines the date of the Monday and Sunday of the week where the given date value (or time period) is located

1. Given a date value, obtain the date data of the Monday and Sunday of the week where the date is located.For example, if you specify a date, find that its Monday of the week is, and Sunday is.Function is created as follows:Copy codeThe Code is as

Solutions to problems caused by auto-growth columns of sqlserver

There are two tables with identical structures, one of which inserts data with the specified conditions in the other table, and the following error is reported:Only when the column list is used and IDENTITY_INSERT is ON can an explicit value be

SQL Server processing summary with time Blank

We will summarize several main cases:I. How to enter a NULL valueIf you do not enter a null value, if the time is null, "" is written by default, which is troublesome for business processing.Ctrl + 0 to enter a NULL value.Ii. How to judge the time

Operation Code for XML columns in SQL Server Table

Copy codeThe Code is as follows:-- Create a test tableDECLARE @ Users TABLE(Id int identity (1, 1 ),UserInfo XML)--- Insert Test DataDECLARE @ xml XMLSET @ xml =' 1 test1 'Insert into @ Users (UserInfo) VALUES (@ xml)-- Insert a single node (type:

Learning SQL statements (strong group by and select from modes)

Powerful groupCopy codeThe Code is as follows:Select stdname,Isnull (sum (case stdsubject when 'chemistry 'then Result end), 0) [chemistry],Isnull (sum (case stdsubject when 'mate' then Result end), 0) [math],Isnull (sum (case stdsubject when

SQL server uses custom functions and cursors

No. Standard landCode) Segment encoding (sectCode) 1 131001BG001 G001 2 131001BG002 G001 3 131001BG003 G001 4 131001BG004 G002 5 131001BG005 G003 Now you need to

SQL Server multi-database query sp_addmediaserver usage (add link server)

Exec sp_droplinkedsrvlogin ZYB, Null -- delete ing (ing between recording and remote logon on the linked server)Exec sp_dropserver ZYB -- delete the remote server LinkEXEC sp_addmediaserver@ Server = 'zyb', -- the alias of the accessed server@

Remove the preceding 0 SQL statement (leading zero, zero prefix)

In the past, SQL had a stuff function, which was very powerful.The format of a column is a number followed by a single quotation mark (single quotation mark) with four digits, for example, '2017, '2017, '2017. I want to convert it to a format like 00

MySQL multi-Table query Implementation Analysis

We will continue to use the previous example. The preceding table contains basic information about an employee, such as name, gender, date of birth, and place of birth. Create another table to describe the articles published by employees, including

How to convert Column records recorded in the database into rows under sqlserver

Assume that there is a student renewal table (tb) as follows:Name Subject ResultZhang San Language 74James math 83Zhang San physical 93Li Si language 74Li Si mathematics 84Li Si physical 94Want to becomeName, Chinese, Mathematics, Physics------------

SQL Server deletes stored procedures in batches and modifies stored procedures in batches

Modify:Copy codeThe Code is as follows:Declare proccur cursorForSelect [name] from sysobjects where name like 'Foods _ %'Declare @ procname varchar (100)Declare @ temp varchar (100)Open proccurFetch next from proccur into @ procnameWhile (@

Full parsing of SQL Server database data summary (WITH ROLLUP)

Existing table A has the following content: Code repository quantity 01 A 6 01 B 7 02 A 8 02 B 9 Now you want to query this format by encoding: 01 A 6 01 B 7 Summary Subtotal: 13 02 A 8 02 B 9 Summary Subtotal: 17 Q:

SQL SELECT statement table join

I will introduce the concept of join. For this reason, I have prepared two trial tables: album (album table) and track (track table ).Album: contains the summary of 200 music CDs from Amazon.Album (asin, title, artist, price, release, label,

How to restart the SQL Server service and computer through SQL Server

Yesterday I talked to my friends online about the application of SQL statements. My friend's remote server was unable to connect. The problem was that the remote server reached the maximum number of connections. In order to enable remote restart, I

SQL Server temporary table usage

Usage:Temporary tables can be used to store related records for complex queries, which can improve efficiency and program readability, similarMy_cursor declare my_cursor cursor scrollFor select field from tablenameTemporary tables are divided into

Failed to initialize the SQL2000 Personal Edition application normally. 0 multiplied by C0000135 failed.

If you encounter problems after installing SQL2000 Personal Edition, install the application and click the application. The preceding figure shows that the initialization of the application fails normally. A value of 0 multiplied by C0000135 fails ).

Replace inserted Trojan records in batches in SqlServer

Recently, I found a batch replacement of inserted Trojan records and found a good statement, which is very useful. I only use a dozen rows of cursor statements, the malicious trojan of all tables in the database is cleared, and the probability of

Explanation of each server role in sqlserver 2000

Fixed server role descriptionSysadmin performs any activity on SQL Server. This role's permissions span all other fixed server roles.Serveradmin configures the Server Range settings.Setupadmin adds and deletes the linked server and executes some

Total Pages: 923 1 .... 919 920 921 922 923 Go to: GO

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.