The following methods can be used to quickly generate a batch of data
if (object_id (' t ') is not null) drop table T
Go
CREATE TABLE t (ID int identity (1,1), name varchar (40))
Go
Insert into T (name) select NEWID ()
Go 10
SELECT * FROM t
/*
1 18
Recursion refers to the case where the code fragment calls itself; the danger is that if you call itself once, then how to prevent him from repeatedly calling itself. This means providing a recursive test to ensure that the appropriate time to jump
First, use C # to convert image to byte[] and insert the database:
1.1 Convert Image control image to stream:
Copy Code code as follows:
Private byte[] Pictoarray ()
{
Bitmap BM = new Bitmap (picbox.image);
MemoryStream ms =
In and exists these two functions are similar, but because the optimization scheme is different, the not exists is usually faster than not, because the not exists can use the binding algorithm two not in, and the exists is not as fast as in, Because
Recently there is a project that needs to check whether a character field value is a number, because the data row is massive, so need to pass through the SQL statement to screen, here to make a memo.
The function used is isnumeric, and the concrete
Recently interviewed an interview problem, suddenly a bit confused, only to say the idea, and then Baidu a bit, sorted out the idea, so record down, convenient to learn later. (Please refer to the annex for the test questions)
Related Data tables:
MS SQL SERVER obtains information such as the current database file and is available for multiple versions:
Copy Code code as follows:
SELECT dbf.file_id as Fileid
, dbf.name as [FileName]
, S.filename as Filelocation
, CAST (dbf.size/1
For a newly added record, you get the value of the automatic identity column for the new record, in two ways:1. Use the OUTPUT keyword in insertINSERT into table_name (COLUMN1,COLUMN2,COLUMN3)OUTPUT Inserted.id--Returns the value of an automatically
Table types can be used in stored procedures for bulk additionsTable type definition:
Copy Code code as follows:
The CREATE TYPE dbo. Subcardtable as Table
(
[SC_ID] [varchar] (50),
[ZHUKAINFO_ID] [varchar]
SELECT * FROM table name where Convert (varchar (100), Date field, 23) = ' 2008-12-15 '
And I'll give you the application of the CONVERT function:
Copy Code code as follows:
Select CONVERT (varchar), GETDATE (), 0): 2006 10:57am
Error message: Error mssqlserversqlserveragent could not be started (Reason:sqlserveragent must be able to connect to SQL Server as SysAdmin, but "(unknown)" is not Sy Members of the Sadmin role).
Operating Environment: WINDOWS2003R2 32bit + mssql2
Once the hacker gets the Webshell, the hacker knows your SQL Server administrator password, and if SQL Server is not securely set up then the hacker can easily claim and create a new system administrator account, then the hacker will be able to
If you use the Datename () function to get the full English name of the month, but the report needs it, just display the month name abbreviation.
The 12-month abbreviation, only May is the full name and abbreviation, the other month abbreviation
Therefore, the plan first inserts the data into a temporary table, and then analyzes the data for the temporary table.
The question point is how to create a temporary table dynamically. The original insus.net was implemented using the following code:
For a database to have more or less to master, the first basic SQL statements to understand. Here's a summary of some entry-level SQL statements.
Create related
Show Database; Show the existing databaseuse database_x; Now you want to use the
Copy Code code as follows:
--Create test table, insert data
CREATE TABLE Test (code varchar (), [values] varchar (a), [count] int)
INSERT Test SELECT ' 001 ', ' AA ', 1
UNION all SELECT ' 001 ', ' BB ', 2
UNION all SELECT ' 002 ', ' AAA ',
Myth #9: Database file shrinkage does not affect performance
Error!
Shrinking a database file does not affect performance only if there is space left at the end of the file, and the TRUNCATEONLY option is specified in the shrink file.
The
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