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

CDC (Change Data Capture) not recording correct data

Hi, I am using SQL Server 2012 and to me a part of data captured by CDC is not making sense. I have a table called 'Schema.Table1', and I enabled CDC on it by running 'sys.sp_cdc_enable_table'. I see...

View Article


Update value in one table with value from looping through another table

I have a table(Claims) in which I would like to take all records over a certain amount(PdAmt), assign them a random number to use for sorting and then go through the records alternating assigning them...

View Article


Image may be NSFW.
Clik here to view.

update using self join

i need tenurestart date and tenureenddate to be updated.i have 3 agents ab0186, cc676h, rd885e. Agentid is unique in the table. when agent changes his director, his tenure start date should not change,...

View Article

SQL REPORTING SERVICES 2008 R2

I HAVE THIS QUERY:SELECT     DIMENSIONS.DESCRIPTION, HOS_SALEHST.CUSTOMERCLASS, MONTH (HOS_SALEHST.INVOICEDATE) as MONTH, YEAR (HOS_SALEHST.INVOICEDATE) as YEAR, HOS_SALEHST.ITEMCLASS,...

View Article

T-SQL - formatting columns according to the value size in a column to content...

I had sql result shown below...   ProjectNO. Projectname Client Programmers 01 ave zica dee 01 ave zica law 01 ave zica amy 01 ave rowan dee 01 ave rowan law 01 ave rowan amy Now how would I represent...

View Article


Help in update query

Hi, How I can get the desired output. I want to remove the numbers till first hyphen.create table #tmp (code1 char(20))insert into #tmp values ('0201_AAAA_GFTYY')insert into #tmp values...

View Article

Number of cocatenation limit

Hi, First of all I'm not sure if this is the correct place to ask this, my apologies if this is incorrect :) The company I work for develops software and for logging purposes they use concatenations:...

View Article

Need to schedule a stored procedure on daily basis using T-sql statement

Hi I am trying to schedule my store procedure which does the backup of a table, but when I am trying to use the Sql server agent, it is disabled in my SSMS. so, I need to write the T-sql statement to...

View Article


Image may be NSFW.
Clik here to view.

Bug in Bulk Insert?

So, I'm working with a client today and we discovered some missing records from his file.  I looked into it a bit; the first 5 rows were being truncated.  I thought that is bizarre because the data...

View Article


Don't want to duplicate a row by cause of a different result in some column...

Hello,Imagine my select result, where:Columns = [id] [name] [a] [b]results received:[102] [John] [12] [5][102] [John] [12] [7][103] [Mary] [13] [8]Look how i want to get:[102] [John] [12] [5] [7][103]...

View Article

Pivot and dynamic SQL

Hi Team,I need to write a SQL to cater the requirements. Below is my requirements:pagename fieldname fieldvalue account_number consumerID AFAccountUpdate ArrangementsBroken dfsdff 1234 1234...

View Article

remove duplicate values

hi this is my sql server tableID  RID  Val  PID1   1      a     null2   1      b     null3   2      g     14   2      h     15   2      i      16   2      g     1i want to remove the duplicate rows...

View Article

How to add 0's before the string in MS SQL server?

Hi,I need to add 0's to the left.my rule says that "loaded in this format:'002' + Equivalent SE PLU (5 digits) + '00000' + DV "Please provide the command which is equivalent to LPAD in oracle.Thanks in...

View Article


Error while using if else in where clause

I am passing two variables like SDate and EDate to stored procedure and I want select data from table whereVDate is betwwen SDate and EDate if both SDate and EDate is not null .If EDate is null then I...

View Article

is business day

Hi, I would like to start a job at the end of the 10th business day of each month. That day should not be a weekend. How is this done please? Thanks

View Article


SUM named union sub queries

Hi -- I have inherited a sql statement comprising of two subqueries (WeeklyAssignment and MasterWeeklyAssignment) and a UNION join. Against our database the below query returns two rows (values 0.5 and...

View Article

Partitioning on a Table - Few Questions, Confusions

Hello All,   I've a table with around 300 Million Records. This Table has one Key Column (Auto Incremented by 1 ) and a Unique ID Field.Primary Key (Clustered Primary Key) was created on Key Column of...

View Article


Reference tables in SQL Server

Hi SQL Server Experts,Please help with expert guidelines to create reference tables in SQL Server.Thanks

View Article

Convert data into XML on row basis

Hi all,I have a table with col1 and col2 with 5 rows.now I need data in XML If I used XML Path than it return data in single row.but I need 5 rows with XML data.Row wise XML...

View Article

Import CSV or EXCEL to SQL Server without data conversion

Hello I am trying to insert CSV or Excel files to sql server tables. But keep in mind that:Each file has a different set of columns (It is not possible to know the name, type or amount of columns in...

View Article
Browsing all 23857 articles
Browse latest View live


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