Insertion and commit can happen in different order in 2 different tables one...
Hi All,I would like to know the ans of below question:Insertion and commit can happen in different order in 2 different tables one in SQL Server 2005 and another in SQL Server 2012 for the same set of...
View Articlecan i use timestamp in order by to get records which are changed , inserted...
Dear all,(sqlserver 2005)i want to save the largest timestamp in a variable then i want to get the changed and inserted record from a tablelike select * from t where timestamp>@timestampis the above...
View ArticleCASE STATEMENT IN WHERE CLAUSE
IN MY WHERE CLAUSE, I NEED TO DETERMINE THE FOLLOWING:(((WHERE gl.CashierDate >= @BeginDate AND gl.CashierDate < DateAdd(d, 1, @EndDate) AND IF THE ACCOUNTNUMBER IS '22030000' THEN I NEED TO...
View ArticleSQL to split the string based on the space (Example -Split the first_name...
Hi, I would like to know the SQL function to split the string based on the space. Example Column ( Complete Name)PETE MAHADEVAN SANKARAN Expect to have result as PETEPlease help with the SQL...
View ArticleTable with non clustred
Description :Table two type- Heap table and Clustered table.Suppose i have table with non clusterd (but no clustered index ) ... then how it will be structure , ...is it B-Tree or Heap type?How impact...
View ArticleIndex usage for a given index?
I have an index that I am curious about usage (last use, how often is being used). What query should I execute for looking at the use stats for a given index of a given table?sql2008
View ArticleIndex Size Limit
Hi ,What is the reason behind size limit of Index.Why SQL Server fix that into 900 B ?Samith C Valsalan There is no Wrong time to do Right thing :) Please mark it as an answer/helpful if you find it as...
View Articlehow to get difference of two rows as third row
hi..i want to calculate variance of row..for example salary of employeeemp_code month basic hra splall da ltaa001 jan100005000500080007000a001...
View ArticleSQL Server 2008 - Row-Overflow Data Exceeding 8 KB
We receive the below warning message in SQL Server (2008 R2) when we try to add the new columns. The present, following are the column counts in each of the 3 tables that are reporting this warning...
View ArticleSegmenting the data in the table
Hello,I need to create the segmentation on a table. Below is the original data in the table.Begmeasure EndMeasure DetMethod Testpressure0 7703...
View ArticleLTRIM RTRIM not working for unicode char string in SQL 2005
select len(ltrim(rtrim('メタルワン IFR 12/06 13/05 国際Ⅰ ')))
View Articledeadlock
Transaction (Process ID 72) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. [SQLSTATE 40001] (Error 1205). The step failed.This...
View ArticleSUBSTRING QUANDRY
I have a field called 'description', that cna include a number of abbreviations that do not have to be in a specific order. However if a charge for mileage isi ncluded in the list it is always in this...
View ArticleOrder by Caps first and order by asc
Hi SQL Gurus,I have a requirement to order by a job title with CAPS in it as first and do the rest in ascending.For simplicity I have populated only job title starts with "a". So for job title starts...
View ArticleOpenrowset /stored procedure works on one server, fails on another
I have 2 servers, production and UAT. I have the same stored procedure on each of them. SQL is configured the same on both.When I use openrowset to execute the SP on UAT it works, when I use openrowset...
View ArticleCreate a query to remove last two characters of a string
I am writing a Sql query where I need to remove the last two characters of a string. The string length is variable (6 or 7).The following query works for the 6 character stringSELECT...
View ArticleGet first occurance of records in a group
Hello,I have a query that I'm trying to get the first occurance of each item grouping when an item changes. However, the is grouping all similar items together. For example;Select LocationNumber,...
View ArticleDeadlocks: What locks are obtained for an update
Hi all,I'm currently investigating a deadlock & I'm not understanding why my update statement on table x is holding an exclusive lock on table y.I'm guessing it is because table x has a foreign key...
View ArticleMerge command using 2 different servers leaving tables blank sometimes
So i'm merging about 5 tables (5 merge commands) on 2 different servers. If there's an error I roll everything back.It normally works great, but 1 out of 100 times it will blank out the target...
View ArticleMaintain Inventory Current Stock
How to maintain inventory for multiuser system using same inventory data. eg. i have 5000 quantity of goods for sale. one user loged in and saw available quantity is 5000. now he prepare an invoice of...
View Article