sql-server-2008

Why is SQL Server backup so much larger than the DB files?

北城以北 提交于 2021-01-21 06:20:14
问题 I have a SQL Server DB that is about 13Gb with a 1.6Gb log file. When I back it up, however, it creates a 50Gb .bak file! Why is that? I have read some commentary here about transaction logs, but my DB runs on my laptop and there is no DB activity during the time of the backup. (It only takes 5 minutes). My backup type is Full, my recovery type is Full, and I am doing Copy-Only backups. Any ideas? Much appreciated! I am using SQL 2008 R2, Developer Edition. 回答1: It might be because the backup

Why is SQL Server backup so much larger than the DB files?

眉间皱痕 提交于 2021-01-21 06:19:57
问题 I have a SQL Server DB that is about 13Gb with a 1.6Gb log file. When I back it up, however, it creates a 50Gb .bak file! Why is that? I have read some commentary here about transaction logs, but my DB runs on my laptop and there is no DB activity during the time of the backup. (It only takes 5 minutes). My backup type is Full, my recovery type is Full, and I am doing Copy-Only backups. Any ideas? Much appreciated! I am using SQL 2008 R2, Developer Edition. 回答1: It might be because the backup

CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP in mssql?

我们两清 提交于 2021-01-08 02:48:34
问题 Here i am trying to use CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP in mssql. Here getdate() is available.How can i rewrite with current-date with updated date automatically in sql. Code I am trying to update: CREATE TABLE XXXXX ( fid int(11) NOT NULL AUTO_INCREMENT, Name varchar(100) NOT NULL, status varchar(4) DEFAULT 'yes', fdate timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (fid) ) 回答1: Create database CREATE TABLE XXXXX ( fid int NOT NULL

CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP in mssql?

做~自己de王妃 提交于 2021-01-08 02:45:26
问题 Here i am trying to use CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP in mssql. Here getdate() is available.How can i rewrite with current-date with updated date automatically in sql. Code I am trying to update: CREATE TABLE XXXXX ( fid int(11) NOT NULL AUTO_INCREMENT, Name varchar(100) NOT NULL, status varchar(4) DEFAULT 'yes', fdate timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (fid) ) 回答1: Create database CREATE TABLE XXXXX ( fid int NOT NULL

CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP in mssql?

主宰稳场 提交于 2021-01-08 02:45:16
问题 Here i am trying to use CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP in mssql. Here getdate() is available.How can i rewrite with current-date with updated date automatically in sql. Code I am trying to update: CREATE TABLE XXXXX ( fid int(11) NOT NULL AUTO_INCREMENT, Name varchar(100) NOT NULL, status varchar(4) DEFAULT 'yes', fdate timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (fid) ) 回答1: Create database CREATE TABLE XXXXX ( fid int NOT NULL

MS SQL Server - Export Results To File without “NULL”

痞子三分冷 提交于 2021-01-02 05:43:26
问题 I am using SQL Server Management Studio to export the results of my query to text. I would like to export the results without the character NULL being printed between delimiters. For example, instead of: ,NULL, I would like to export: ,, Thanks for your help 回答1: Just simply use ISNULL(someColumn, '') in our query. This will replace all NULL values with an empty string 回答2: It depends on how you export the data. If you use the Import and Export Wizard, the NULL strings do not show up in the

losing null values filtering sql query results using where

生来就可爱ヽ(ⅴ<●) 提交于 2020-12-31 05:42:13
问题 I have a complex query which joins more than 7 tables. After the joins, I would like to filter the result of my query . Here is something that I observed. When I do a where clause where X.Name != 'xxx' and XY.Product != 1 I get the filtered results , but all the null values for the X.Name and XY.Product also disappear from my result. I would like to retain the null values. I also tried : and X.Name != 'xxx' and XY.Product != 1 I removed the where clause totally and put in an and , but I dont

SQL Server Web vs Standard edition

谁说胖子不能爱 提交于 2020-12-29 09:06:34
问题 I have found out that there's two versions of SQL Server types that are very different in terms of pricing... The Web version from my host provider costs about 13$ per 2 core packs, whereas the Standard edition is right around 200$. From my standpoint, we expect our database to be around 150-200GB in size, only few tables would take up most of that space. So my only concern is would the web version of SQL Server support this large database and not cause any performance issues to the end users

Create a Stored Procedure for AES Encryption in MS SQL Server 2008

送分小仙女□ 提交于 2020-12-29 08:44:23
问题 I have an SQL Server 2008 table with a structure similar to the following: ID int PRIMARY KEY IDENTITY(1,1) Name nvarchar(100) LongText ntext What I am trying to achieve is simple. Before inserting data inside this table, I want to encrypt the LongText using AES_192 algorithm. I am using the following SP to encrypt data: create proc sp_Encrypt_LongText @rawText ntext = null, @encryptedText nvarchar(max) output as begin OPEN SYMMETRIC KEY Encryption_Symmetric_Key DECRYPTION BY CERTIFICATE

Create a Stored Procedure for AES Encryption in MS SQL Server 2008

ⅰ亾dé卋堺 提交于 2020-12-29 08:44:16
问题 I have an SQL Server 2008 table with a structure similar to the following: ID int PRIMARY KEY IDENTITY(1,1) Name nvarchar(100) LongText ntext What I am trying to achieve is simple. Before inserting data inside this table, I want to encrypt the LongText using AES_192 algorithm. I am using the following SP to encrypt data: create proc sp_Encrypt_LongText @rawText ntext = null, @encryptedText nvarchar(max) output as begin OPEN SYMMETRIC KEY Encryption_Symmetric_Key DECRYPTION BY CERTIFICATE