Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Browsing all 3145 articles
Browse latest View live

need help with logic, solution is nearly there, but one more hump

I don't know how to solve for Rule 5.An example of correctness is: 1Z3V1F0359168993, with one tracking_number sharing the same ship_date. 

View Article


Run away logical reads on stored proc causing timeouts.

Hi,I am hoping some one maybe have any insight or suggestions.I have a stored proc that returns 10 to 200 rows max it, it is reading by the primary clustered identity key.95% of the time this runs like...

View Article


Add two columns when one is the output of a Case statement

I need to add the T.Duty Rate to the Chap_99_Rate.  Please advise.[code language="sql"]SELECT l.HTS_99_Num,    L.Ctry_Origin,    T.DutyRate,

View Article

Image may be NSFW.
Clik here to view.

Pivot multiple columns into one row

I have a temp table that looks like this:

View Article

Divide by 0 issue

I am trying to divide in SQL:[code language="sql"]Total_Duty / ([Chap 99 Rate] + DutyRate) as Entererd_Value[/code]I think is have to cast as numeric, but nothing i've tries is working.<

View Article


Image may be NSFW.
Clik here to view.

Pivot from row-level without loosing the ColNames

Hi,i need to transform this data from row-level to columnar data.Pivot with ColName and ColValueRegardsNicole

View Article

Interesting Use Case Of CEILING

I have ran into this while writing a reporting stored procedure.  I have found that CEILING will increase to the next higher integer even if the value is even.Here is the example:[code language=

View Article

Query conversion error from phantom data

Running 2014 SP1-GDR (KB4019091) in compatibility_level 100, I am getting repeated conversion errors from data that just isn't there.Our data vendor sends data for 14 distinct tables in a single...

View Article


need 3rd day of Calendar month - date precision to exclude minutes

I need query (in my case an INSERT) to run only if today's date is 3rd day of Calendar Month?how to get date precisions for to exclude minutes on right side of the IF?[code language="sql"] IF...

View Article


Hash or range-index in memory optimized table?

I have memory-optimized tables in SQL Server 2014 to handle a graph problem.  The tables can be queried concurrently for multiple sessions, for as many as 50 concurrent sessions.  A Node table contain...

View Article

SSIS connection manager crash course -

Hey there ---I have little SSIS experience but have used similar ETL tools so can work my around.Previous (disgruntled frankly) employee left. His SSIS scripts all broke the next day.I can figure edit...

View Article

fetch multiple rows with single string

Hello friends,I am having table which contains data stdentname,teachername,subjectname as below.Studentname                      Teachename            &nbs

View Article

Going from datetimeoffset to datetime

Hi All,I'm hoping to get guidance on this. I'm working on modifying a query used to pull data in an SSIS package. It consists of 3 unions, of which all the former subqueries work fine, however the last...

View Article


Changing Datatype from Int to TinyInt - How much space can be recovered?

Hi Experts,I am having two tables. 1 is Master having merely 28 records and 2nd, Transaction table, is having around 56 millions of records. Transaction table is being referenced by Master table. Maser...

View Article

Error handling - How to get job name

Hi All,I am currently implementing error handling in all the procedures in my project .Whenever an error occurs i have to make an entry in the error table with the following details.1) Job_name2)...

View Article


Suggestions on How to Improve Delete

Hi Guys, Any suggestions on how to improve this Delete? delete was causing tempdb log to grow, also would UPDATE be faster than Delete , there are around 31 million records to delete...thanksDECLARE...

View Article

Image may be NSFW.
Clik here to view.

SQL Grouping Output - Creating Ageing Data

Greeting! Input SQL Table Sample

View Article


SQL Optimization

Good afternoon all,trying to optimize a portion of my sql. I've simplified it below, but the portion that it's hang up on is the inner join to the SSICategory, specifically the 2nd part ((n.SSICatyear...

View Article

Query Performance

Hello All,Wish you a very happy new year 2019!!I had been asked to review performance of a procedure and I am producing a part of it. There are two similar queries in this procedure and both when...

View Article

Insert Faster way

Guys,I need to improve this Insert in a faster wayQuery : set identity_insert [Test].dbo.JOB ONINSERT INTO [Test].[dbo].JOB (   [JOB_ID]  ,[JOB_DEFINITION_ID]  ,[PROCESS_ID] 

View Article
Browsing all 3145 articles
Browse latest View live