Help Please Running Total with Date Gaps
I am using SQL Server 2008R2 I have a very simple table with 4 columnsDate, Product, Customer, SalesI need to accomplish 2 things, A running total by Product & Customer (I have figured this out),...
View ArticleHow to make an application update data in SQL Server Database
Hi guys, do you know of any free software out there which I can use to practice queries on, such as add data in the software and to make that data update automatically in the SQL Server Database I...
View ArticleField Size (50K characters results in 150MB field size)
Hi,There was some data inserted a nvarchar(max) field into a table using an application. If we count the number of characters in the field, its about 50k, however if we check the size of the field...
View ArticleWhy am I only getting the years ?
Hi guys, I'm executing the following code but my result is only returning 26 years and not the months and days too, any ideas what am I doing wrong? would appreciate the help, thanks :-) DECLARE @DOB...
View ArticleSQL Server DELETE massively inflates transaction log
When trying to run a DELETE on a large set of data (23,416,618 records as of today) we observed twice this behaviour:query runs for over 6 hours at which point transaction log goes over 60G in size and...
View Articlescript for gather and store the log running queries details in a table?
Hi All,Please suggest the best query that gather and store the long running queries details in a table.Thanks,rup
View ArticleRemoving old data from Log_shipping_monitor_error_detail and...
Hi I have a sql server acting as a primary log shipping server that contains a large msdb database this is primarily concerned with entries in the above mention tables. Turning off log shipping doesn't...
View ArticleI am not able to get exact output with all ranking functions
create table employeedetails(id int, name varchar(20),gender varchar(10),salary int ,city varchar(10)) insert into employeedetails values...
View ArticleCalculate milliseconds iterativelly
Experts,CREATE TABLE [dbo].[TimeStats] ( [TimingStatsID] [int] IDENTITY(1,1) NOT NULL, [TimingObject] [varchar](50) NOT NULL, [TimingStep] [int] NULL, [TimingBatch] [uniqueidentifier] NOT NULL, [Time]...
View ArticleHow to capture transaction response time in SQL
I need to capture Transaction response time (i.e. ping test) to calculated the peak hours and averaged on a daily basis.andPage refresh time that is calculated no less than every 2 hours for peak...
View Articlewhy cant you update more than one table through a view?
Hi All,my question is not about a workaround like instead of trigger but why this logic exists in the first place. if you can update one table i'd would assume there should not any constraint on more...
View ArticleTicket Booking System
HI friendsPlease help me outI want to know how to handle ACID of database for a database of ticketing system e.g.Let c ticket booking system of a theater where at a time many users can book a ticket(s)...
View Articlewhen a database is last used in SQL Server 2000.
Hi,Need to create one script by which I can get my any of the database lastly used, which is running on SQL Server 2000 lastly used.Lets say if I have 100 databases running on SQL Server 2000, then...
View Articlerestore one full backup(need to move), 1 differential backup,2 transaction...
Is following script correct? I don't need to add "move" when do restore differential, log later. Correct?RESTORE DATABASE AdventureWorks FROM DISK =...
View ArticleActivate Command Prompt from Stored Procedure
Hi I am connecting Sql Server and R together to perform some Statistical Analysis.The R script creates some plots which are Saved as Jpg into a SQL database which can be used for reports etc.Using the...
View Articlebcp import error numeric value out of range
lo, I have table with columns of type int. I export this table by using bcp:bcp dbo.int_table out file.dat -q -CRAW -T -S localhost -E . Now I want to import it to table with columns of type bigint. I...
View ArticleSQL query for join table and multiple values
Trying to join two tables , Emphours and EmpStatus to getresult which gives each emplyees hour worked each dayin past say 1 year in what status. I need result similar to table 3 , Hours Can also be...
View ArticleAn explicit value for the identity column in table 'productsales' can only be...
--first table create table product([id] int identity(1,1) primary key,[name] nvarchar(50),[description] nvarchar(50)) insert into product values('tv','52 inches '),('laptops','16 inches...
View ArticleCase Statement Question
I currently have a successful case statement that returns "True" for a condition and "False" for those that don't meet the condition. However, I would like my query to return only "True" statements,...
View ArticleA script for Windows Disk Estimation.
Hi,I need to implement a script by which I can get the windows disk used space and available space.In brief; If I have 4 disks on my SQL Server, so using one script I can get all the used space and...
View Article