Category:MsSql

  • Solution of inconsistent name caused by server renaming after SQL 2008 installation

    Time:2019-8-17

    Use select @@servername and select serverproperty (‘servername’) to see if the server names are consistent If not, serve rProperty (‘servername’) shall prevail. Terms of settlement: Copy codeThe code is as follows: Exec [email protected]=’server name’Exec [email protected]=’server name’, @local=’LOCAL’ Restart sql2008 database service and check again for consistency

  • SQL Server 2005 automatically creates data tables and automatically adds a field index

    Time:2019-8-17

    The SQL statement for creating the data table is as follows: String tatlename = T_useruid; // Define a variable. Name for automatically creating data tables, current table name: T_useruid string sql = “CREATE TABLE [dbo].[” + tatlename + “]([Cid] [int] IDENTITY(1,1) NOT NULL,[Uid] [nchar](32) COLLATE Chinese_PRC_CI_AS NULL,CONSTRAINT [PK_” + tatlename + “] PRIMARY KEY CLUSTERED […]

  • Detailed Explanation of Data Interception and Replacement Method in SQL Server

    Time:2019-8-16

    REPLACE (to modify field names,’substituted specific characters’,’substituted characters’) Table structure and insertion of data CREATE DATABASE TEST GO USE TEST GO CREATE TABLE TestTable ( UserName VARCHAR(50), UserPwd VARCHAR(50) ) GO INSERT INTO TestTable (UserName,UserPwd) VALUES (‘ASDFFFF’,’WWWEEE’) INSERT INTO TestTable (UserName,UserPwd) VALUES (‘ASDFFFF’,’WWWEEE’) INSERT INTO TestTable (UserName,UserPwd) VALUES (‘ASDFFFF’,’WWWEEE’) INSERT INTO TestTable (UserName,UserPwd) VALUES (‘ASDFFFF’,’WWWEEE’) […]

  • Method of Clearing Logs in SQL Server Database

    Time:2019-8-16

    Method 1:1. Open the query analyzer and enter commandsBACKUP LOG database_name WITH NO_LOG 2. Open the enterprise manager again — right-click the database to be compressed — all tasks — shrink the database — shrink the file — select the log file — choose to shrink to XXM in the shrinkage mode, here will be […]

  • Solutions and serial numbers for SQL 2008 evaluation period

    Time:2019-8-16

    The operation is as follows:(1) Place the SQL Installation CD (or ISO) into operation and enter the installation interface. (You can also enter the Start Program, Microsoft SQL Server 2008 Configuration Tool, SQL Server Installation Center)(2) Select version upgrade in Maintenance.(3) According to the version upgrade wizard, first enter the product key, which is the […]

  • SQL Server Implements Session Information Capturing DML Operations with Triggers [Instances]

    Time:2019-8-15

    Demand Background Last week, the maintainers found that the data of a table was often modified due to historical reasons, lack of documentation, and frequent changes of the maintainers, which led them to be not fully familiar with the system business, and they were not fully aware of which systems and applications would manipulate the […]

  • Data synchronization using Sqlserver transaction publishing (sql2008)

    Time:2019-8-15

    Transaction function has a long history in SQL server. Because we are doing a data synchronization scheme recently, we have the opportunity to study it and snapshots again. We find that there are still many good functions and improvements. Here, taking the transaction publishing function of SQL Server 2008 as an example, this paper briefly […]

  • Questions about the use of temporary tables in sqlserver 2005 (Invalid object name # temptb)

    Time:2019-8-15

    Recently, when using SSRS 2005 to make reports, when calling data sources with temporary tables, the system will report errors and will not be able to enter the next step of the wizard. The errors are as follows:There is an error in the query. Invalid object name ‘#temptb’. After research, three solutions are proposed as […]

  • SQL Server 2005 Installation Example Environment Diagram Page 1/2

    Time:2019-8-14

    Key installation considerations Although most SQL Server installations use default parameters, which is a simple process, failure to understand the installation parameters can lead to confusion or future security attacks. Because of this, here are some key points for you to think about when installing SQL Server: Install only the necessary SQL Server components to […]

  • Solution to 5120 Error in SQL 2008 Additional Database Tips

    Time:2019-8-14

    When using sql2008 for additional database on win7 x64 system (including database files being used in x86 system and directly copying attached to X64 system), prompt can not open file, 5120 error. Because there is no permission to operate, there is an error when attaching, as long as the file or folder security attributes can […]

  • SQL Server Gets Disk Space Usage

    Time:2019-8-14

    For DBA, monitoring disk usage is a necessary task. There is no easy way to obtain disk space usage information. Here’s a summary of the scripts saved over the years: The most commonly used way to view disk free space, which is a must-remember entry to DBA: –View the available disk space EXEC master.dbo.xp_fixeddrives The […]

  • SQL Server Database Timing Automatic Backup

    Time:2019-8-13

    SQL Server database automatic backup at regular intervals, for your reference, the specific content is as follows Data security considerations arise in SQL Server, so regular database backups are required. The backup database is usually done in the morning when there is no database operation, so we can not ask the administrator to backup the […]