Average calculation on 200 millions rows
Hi guys, one advice please. Bear in mind that I don't have SQL now so I cannot give you the DDL (sorry). My concern is for a task that I need to resolve on Monday. I got a table with 200 million rows...
View Articlecan indexed view be used in this situation.
Dear Allcreate table Pole (Poleid int,Position decimal(5,2)) create table Distance (Did int,FromPosition decimal(5,2), ToPosition decimal(5,2),ReprotNo varchar(10) ,DateOfReport datetime,Activity...
View ArticleContinue loop after stored procedure done
foreach(....){//My stored Procedure}My stored procedure takes several times to done but sometimes foreach doesn't allow it done and takes step forward. What should I do?
View ArticleDetermining how the index is performing?
I created an index on a transaction table after the reports were taking time to open. After creating an index, there is no improvement.Is there a way to determine how the index is performing and which...
View ArticleYear to date
DECLARE @TempData as TABLE ( Name nvarchar(1111), MonthName nvarchar(1000), CountName int)INSERT INTO @TempData VALUES ('Class 1', 'September 2013', 1), ('Class 2', 'October 2013', 4), ('Class 2',...
View ArticleCreate a table in SQL Server, Export tables from Microsoft Excel to Microsoft...
Hello team,I have a project that I need to do, what is the best approach for each step?1- I have to create a table in Microsoft SQL Server.2- I have to import data/ tables from Microsoft Excel or...
View ArticleUnique Records
Hi:I have the below 11 records in a table Date User Place1 Place2 2014/01/13 AACVQM BOM BRU 2014/01/13 AACVQM BOM BRU 2014/01/13 AACVQM BOM BRU 2014/01/13 AACVQM BOM BRU 2014/01/13...
View ArticleHow to find Similar rows?
Dear All,I have table with location data , which having around 2 million records, So performance is huge factor. Please see the table structureslStreetCityZip code stateCountrylongitude...
View ArticleSame StoredProcdure giving different results at different time
Hi all,When i execute the same StoredProcedure , I am getting different results (Count of value is different )for first time i execute i am getting expected count but at the 3rd or some times i am...
View Articleneed to run tdps sync in sql servers
Hello,I need to run tdpssync in sqlservers. Please assist.Like in oracle we have tdposync which synchronizes the tsm backup with backup repository.Best regards,Vishal
View ArticleSlow query
Hi ExpertsPlease see the execution plan of a SP , it take nearly 2 hours to finish. While its running I did profiler trace to see what it is doing. As per the trace its doing an scan( Sccan:Started,...
View ArticleJob/Maintenance plan is not giving the same result set.
Hi all, I have a script which lists out logins with a sysAdmin right. And i created a job that runs the script every week. When i run the script manually on the management studio, it gives me the...
View ArticleExtract specific STRING from field
Just wondering if its possible to extract specific string from a field?I need anything after 01 and before 1723Here a few examples 010761181936222217230800 010761181936243717231200...
View Articlesp_who2 -need only active sessions from users which are not the background...
Hello,sp_who2 -need only active sessions from users which are not the background sessionsPlease assist.Best regards,Vishal
View ArticleChoose the longest character in specific Column
Hi guys,My query returns as below:Computer NameMakeModelS/NOU NameHostname1Dell Inc.Latitude E6400A123456DOMAIN.LOCAL/ComputerHostname1Dell Inc.Latitude...
View Article2 joined crosstabbed tables creating triplicates
What I am attempting:1.Cross-tab 2 tables that contain Monthly Sales (the original text file has a column called month and lists by month. Theend user needs to view by month going across )2. Join Both...
View ArticleImport data from xml file into SQL Server table
Hi All,I have an xml file, which i need to load into a SQL Server table.As i never worked with xml files,i need help.I have below xml in a file, and i need to load this into a table.Can anyone help...
View Articlequery two tables for certain condtions (where all these are true)
How can I query against two tables for a specific condition?To simplify suppose I have two tables; NODES and TESTS. They both have 2 columns NAME and STATUS. How can I write a query that can check...
View ArticleUpdate Trigger Not Fireing When Value Is Null
I have a trigger and it works fine when I update values from one value to a new value; however when I update a value from Null to a new value or a value to Null these transactions are not being...
View ArticleDate difference in one column
Hi all, I need the column DATEDIFFERENCE as per below Kindly help me out . How to perform on the same column . Regards, Subathra
View Article