I was wondering if there was any way of making a backup of an entire SQL Server (we are using SQL Server 2008) at regular intervals to a specific location. I know we are able to backup single specific databases but for ease of use and not having to set up a backup each time I want a new database,
Tag: sql-server-2008
Determine ROW that caused “unexpected end of file” error in BULK INSERT?
i am doing a bulk insert: DECLARE @row_terminator CHAR; SET @row_terminator = CHAR(10); — or char(10) DECLARE @stmt NVARCHAR(2000); SET @stmt = ‘ BULK INSERT accn_errors FROM ”F:FullUnzipped…
How to use regular expression in T-SQL?
For example: where strword match with {%{J{GC * GC}J} or strword={%{J{GC * GC}J}
SQL – Blank default namespaces
I have a relation which has an XML column storing data in the following structure
SQL Server: Cannot insert an explicit value into a timestamp column
When using this statement I get the following error: Cannot insert an explicit value into a timestamp column. Use INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column How do I insert the current time to a timestamp column? Answer According to MSDN, timestamp Is a data type that exposes automatically
How to sum Accounts
I have 3 tables: DimAccounts, DimTime and FactBudget. DimAccounts example: DimTime example: FactBudget example: In FactBudget are many Accounts just with type B. I need to calculate Debit and Credit Sums where Account type is S (Sum). Columns AccountFrom and AccountTo shows B Type Accounts from where to begin summing (AccountFrom ) and where end (AccountTo). I have made solution
Use one CTE many times
I have this, and i get an error at set total. Why can’t i access a cte many times? ALTER PROCEDURE [dbo].[GetLeaguePlayers] ( @idleague int, @pageNumber int, @pageSize int, @total int …
sql runs fast in ssms slow in asp.net
I have been having this problem for a couple of weeks now. The problem is that the query takes 4-5 minutes to run on the website and at most 2 or 3 seconds to run in ssms. Also I found that after I make a change to this query like adding the customerId variable it will start running quickly on
Create a trigger that inserts values into a new table when a column is updated
I’ve been looking at some previous answers on triggers on here but can’t find what I need exactly but I’m sure my question has been asked/answered before. I’m trying to keep track of any changes to …
SQL datetime needs to read 00:00:00.000
I have the following piece of SQL: select DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE()),0)) which comes through as this format: 2012-02-29 23:59:59.000 I need the exact piece of code with the …