Add a filegroup
摘要:create database TestPrimaryDb on primary( Name='TestPrimaryDb', FILENAME ='D:\data\TestPrimaryDb.mdf') ,filegroup fg1(Name='TestPrimaryDbfg1', FILENAME ='D:\data\TestPrimaryDbfg1.mdf')log on(Name='TestPrimaryDb_log', FILENAME ='D:\data\TestPrimaryDb.ldf
阅读全文
posted @
2013-03-14 10:49
庖丁解牛
阅读(312)
推荐(0)
Tuning Performance
摘要:1. OS level:SELECT wait_type, waiting_tasks_count, wait_time_ms, max_wait_time_ms, signal_wait_time_ms FROM sys.dm_os_wait_stats ORDER BY wait_type;-- The DMV accumulates values since the server was last restarted. If you want to reset its values, run the following code DBCC SQLPERF('sys.d...
阅读全文
posted @
2013-03-12 14:51
庖丁解牛
阅读(192)
推荐(0)
Full Text Search
摘要:-- Refer to http://blog.sqlauthority.com/2008/09/05/sql-server-creating-full-text-catalog-and-index//*the following command is to change the UI method to codes.*/use AdventureWorks2008R2;gocreate fulltext catalog FTCatalog/*create fulltext catalog cataname on filegroupname*/create fulltext index on
阅读全文
posted @
2013-03-11 14:29
庖丁解牛
阅读(239)
推荐(0)
install SQL server with configuration file
摘要:We can following the following video with the installation file on the current drive:http://www.youtube.com/watch?v=e240GlAUp5kDetail steps and analysis on the following links: (How to generate configuration file with UI tool)http://msdn.microsoft.com/en-us/library/dd239405.aspxwhen installaiton fil
阅读全文
posted @
2013-03-11 11:05
庖丁解牛
阅读(212)
推荐(0)
Varchar2 vs Nvarchar
摘要:OracleAL16UTF16:Varchar2(N char) == Nvarchar(N) in SQL ServerVarchar2(N) ==Nvarchar(2*N) in SQL ServerOracleAL32UTF8:Varchar2(N char) == Nvarchar(3*N) in SQL ServerVarchar2(N) ==Nvarchar(3*2*N) in SQL Serverhttps://forums.oracle.com/forums/thread.jspa?threadID=709453&tstart=98&messageID=2788
阅读全文
posted @
2013-03-08 10:52
庖丁解牛
阅读(167)
推荐(0)
Statistics with index
摘要:1. After creating index, there will be a statistics generated.2. After dropping the index, the statistics will be dropped together.When the clustered index of an indexed view is dropped, all nonclustered indexes and auto-created statistics on the same view are automatically dropped. Manually created
阅读全文
posted @
2013-03-08 10:07
庖丁解牛
阅读(139)
推荐(0)
database table column name
摘要:-- To find all database names;select name from sys.databases;-- To find all table names under a databaseuse DBName;goselect name from sys.tables;-- To get column name, data type and length of a tableSELECT c.name 'Column Name', t.Name 'Data type', c.max_length 'Max Length'FRO
阅读全文
posted @
2013-03-07 18:00
庖丁解牛
阅读(230)
推荐(0)
database file modification
摘要:Create database SplitDBFile on primary( Name='SplitDBFile', filename='D:\SharedFolder\SplitDBFile.mdf', SIZE=50MB, FILEGROWTH=10%)use SplitDBFile;go-- [primary] must include []create table UserInfo ( ID int, Name varchar(10))on [primary]insert into UserInfo values (1,'1');--
阅读全文
posted @
2013-03-07 14:19
庖丁解牛
阅读(320)
推荐(0)
FileStream with SQL Server
摘要:Some concept:http://technet.microsoft.com/en-us/library/bb933993(v=sql.105).aspxvarbinary(max) is used to store small object within table, filestream varbinary(max) is used to store big object on file system.Step by step to configure filestream:http://technet.microsoft.com/en-us/library/bb933995(v=s
阅读全文
posted @
2013-03-06 15:20
庖丁解牛
阅读(203)
推荐(0)