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

MERGE code works but not when called via stored procedure

Hello, I have a stored procedure that is only doing 1 thing - a MERGE command. When I run the code in the stored procedure, it is successful, as soon as I put the "CREATE PROCEDURE" around it and try...

View Article


How to create blocking in SQL

Hi,I would like to test my SP which can capture the blocking. But how I can create a blocking scenario via SQL script?Thanks

View Article


sql server 2014 Analytical data

I have data as belowData is as shown below where every 4 row gets repeatedID ValueAA ABB BCC CAA DBB ECC FAA GBB HCC II need data as per below formatID Value1 Value2 Value3AA A D GBB B E HCC C F...

View Article

Trying to use the HASHBYTES of a nvarcar(Max)

When I try to make a calculated field [File HASH] using hashbytes('MD5',[ASCII File]) the calculation I get the resultant field [File HASH] as a nvarchar(max)I want the field [File HASH] to be...

View Article

Reading from JSON

Hi Experts,We have a column which stores JSON , how can I query a single property in that column(ex:property:car)Thanks

View Article


Strange performance of simple query: sometimes fast, sometimes slow

I've run into a weird situation with a query that sometimes runs blazing fast (<1ms) but at other times can take around 500ms. For a less frequently executed query this wouldn't be such a problem...

View Article

Insertig failed records into a different table than good records.

I've been building an SSIS package in SQL 2014. I am running a query and inserting the returned data into a staging table before I create three separate CSV files from three separate queries of the...

View Article

YYYY-MM-ddTHH:mm:ssZ Format Error

Hi,I'm trying to insert a date with the YYYY-MM-ddTHH:mm:ssZ format into a field with the type datetime but I'm getting an error: Conversion failed when converting date and/or time from character...

View Article


DATEDIFF format

Hi,I use the below code, I can get the duration as hh:mm:ss.0000000. [code="sql"]CONVERT(TIME, DATEADD(SECOND, DATEDIFF(SECOND, last_request_end_time, GETDATE()), 0), 114) AS Duration[/code]But how I...

View Article


Time Zones

Good morning :-)I have a table that if you dont add the date, by defult it will add the date.[code="sql"]create table Raw_Data( ID int identity primary key,DateCreated datetime NOT NULL...

View Article

bai file electronic cash management

Our bank is sending us daily files in regard to bank postings. The files are in a standard banking format called BAI. We would like to load the BAI files into sql server for analysis and reporting.I'm...

View Article

Show millisecond value

Hi,I have the below SQL statement[code="sql"]select CONVERT(TIME, DATEADD(SECOND, DATEDIFF(SECOND, last_request_start_time, GETDATE()), 0), 114) AS Duration, * from sys.dm_exec_sessions where (status...

View Article

Synonyms

I think the answer is 'no', but I'll ask it anyway. I have two databases on different servers referenced through linked server. Is it possible to create a synonym that encompass the linked server name,...

View Article


How to enable/disable Alert by script

Hi,If I set up an alert, is there any SQL script I can enable/disable it?Regards,

View Article

SQL stored procedure help

I have a stored procedure that I inherited. The goal is for the data in the temp table: #multi_nominees_uf to be joined with the data in #temp_reviewers_UF and assign #temp_reviewers_UF.uf_rev_id to...

View Article


In-Line TVF Split Function JOIN to Base Tables Optimization

I have a specific question about JOINing results of an in-line split function to base tablesI am using an in-line TVF and joining to base tables. Sample code below.The problem is the optimizer does not...

View Article

Msg 9420, Level 16, State 1, Line 6 XML parsing: line 2, character 33,...

Hi,When I run an SQL query, sometimes I got the error,[quote]Msg 9420, Level 16, State 1, Line 6XML parsing: line 2, character 33, illegal xml character[/quote]and sometimes is okay. What would be the...

View Article


Clr procedure to load dll assembly using Reflection

Hi,I'm trying to load an assembly in order to instantiate a class and execute a method that returns a data table.Assembly file (*.dll) resides on a local drive (d:\temp\my.dll)I managed to load the...

View Article

Issue with slow find and replace function code from a lookup table can I do...

I have some dim tables for find and replace for colours and sizes as I have multiple columns in a table that could hold the value see below,FilterColour = CASE WHEN (SELECT lc.ReturnString FROM...

View Article

Count the occurrence of word in a Resume Table

I have a table called Resume with columns in Text, Word and PDF format. I enabled Full Text Search on the table and able to search the keyword through three columns and also able to rank the profile...

View Article
Browsing all 3145 articles
Browse latest View live