Backup Database is terminated Abnormally Failed
Hi All,My Database backup is not working in SQL 2014 RTM version. It works fine on SQL Server 2008 R2. All databases are in Simple recovery model. Not sure what might be the issue. I'm admin for SQL...
View ArticleSQL Server Management Studio experiences lock timeout when using SELECT INTO
Whenever I execute a long-running SELECT INTO statement and while it is running I try to use the SQL Server Management Studio object browser to view tables or other objects, I get a lock timeout error....
View ArticleCTE with pivotting
Our db in SQL Server has a ragged heirarchy with 6 columns, i have created some insert code to get it perfect.Desired output is to find the top layer for each CostCentreid and not output any layers...
View ArticleSelf Join with Randomisation too slow
Hi,I have a query which run thousand of times within the loop with randomised data. Basically, the loop randomises the data/column on each iteration and then performs some calculations. The below...
View ArticleFree Connections to a table before truncate
Hi All,I need to kill all connections to table before truncating table in production environment.Is there any script for the same?RegardsRahul
View ArticleDo we need Indexes when a view is calling select * from tables using Union?
Hi All,We have application slow issue which is calling a SQL view it has Union of two tables. Most of the columns calling are having Primary Keys and non-clustered indexes. Do we need to create...
View ArticleHelp with a T sql query
I have a set of record where I need to find all the customerID`s that went into a location within 180 daysMy table as the following columnsDate_of_Service datetime,LOB varchar(2)CustomerID Int,Customer...
View ArticleHelp with Oracle SQL to strip unwanted characters
Hello,I have 2 columns (Weight and Height) where I need to strip the alpha characters and convert them to numbers (I am required to derive additional columns where I need to present these values in...
View ArticleCan I delete NT SERVICE\SQLWriter and NT SERVICE\Winmgmt logins?
We’ve just installed our first SQL2012 instance and migrated some SQL2008 databases to it. I noticed we have 2 new logins with sa role. Can I safely delete them?
View ArticleInvalid SQL Logic - Temp Tables
Could someone explain WHY SQL does not obey logic:Code that Fails:IF OBJECT_ID('tempdb..##SCDITL') IS NOT NULL DROP TABLE ##SCDITL IF OBJECT_ID('tempdb..##SCDITLTemp') IS NOT NULL DROP TABLE...
View ArticleStored Procedure issue
Hi Pituach,Below is the Table structureTbl_ProductCreate table Tbl_Product ( Product varchar(50) NULL, Code Varchar (50) NULL )Insert into Tbl_Product values('PEN','A') Insert into Tbl_Product...
View ArticleHow to indicate whether more than total number exists?
I'm developing a relational database for storing environmental (biological and ecological) data.A sub-consultant submitted caribou survey data for which I have one column that records an actual total...
View ArticleIS there any way to see the xml plan including the index scan, table scan...
Hi,I tried running set showplan xml onset noexec onselect * from openquery(linkedserver,'select query')it jus returned xml with only remote scan and also in the form of block diagram.But when I ran the...
View ArticleMin Aggregate function performs too slow
Hi, I am using below query to get the minimum date to aggregate within a subquery. The problem I am having is that runs very slow, almost 10 times slower than without aggregation. I thought aggregating...
View ArticleSql server 2008 result displays wrong date format.
hi all,I am connecting SQL Server 2005 from remote computer, and my PC has SQL Server 2008 Installed. on Server when i open the table the date format is correct that is dd/MM/yyyybut when i open it in...
View ArticleCreating dynamic columns in the result set based on values in a Lookup table...
Hi ,I have a code that returns the Capacity, Utilization and Availability of resources for a particular time period based on budget type associated with the task assigned to the resource. This Budget...
View ArticleAdd trigger to all table at once
I created trigger to one table like this CREATE TRIGGER REPPartition_WorkflowStatus ON [dbo].[WorkflowStatus] AFTER INSERT, UPDATE AS UPDATE [dbo].[WorkflowStatus] SET [PartitionId] = (SELECT...
View ArticleSearch
Hi I am trying a select statement to show me properties with more than one Installation numbers.egProperty | InstallationPro..1 | 99999999Pro..1 | 980989, I want the answer to be something like...
View ArticleSQL 2000: How to I find out when databases were last updated for a vast...
Hi,How do I find out when databases were last updated for a vast legacy server with lots of databases and each database has lots of tables?I am trying to find out the above information to influence a...
View ArticleLogon Trigger to control Sessions
Good afternoon!Please forgive my English mistakes.I'm trying to control number of connections or session form every user on a instance server in SQL Server Express 2008R2 and 2012 but it doesn't work...
View Article