Quantcast
Channel: Transact-SQL forum
Browsing all 23857 articles
Browse latest View live

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 Article


can 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 Article


CASE 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 Article

SQL 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 Article

Table 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 Article


Index 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 Article

Index 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 Article

how 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 Article


SQL 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 Article


Segmenting 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 Article

LTRIM RTRIM not working for unicode char string in SQL 2005

select len(ltrim(rtrim('メタルワン IFR 12/06 13/05 国際Ⅰ ')))

View Article

deadlock

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 Article

SUBSTRING 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 Article


Order 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 Article

Openrowset /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 Article


Create 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 Article

Get 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 Article


Deadlocks: 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 Article

Merge 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 Article

Maintain 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
Browsing all 23857 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>