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

SQL Server Merge Command On Match update and insert together

Hi All,There has to be a way to use the Merge Command. Use: When it finds a matching record checks a column in record that has changedExample when matched and T.EmployID <> S.EmployID...

View Article


Sorting by a column when the name is derived via a CASE statement

Hi everyoneI have created the following SQL statement which works fine. However, it would definitely be beneficial if I could include [current age] in the WHERE part of the script.If I simply add this...

View Article


Convert int field into date and format issue

Hi All,I'm hoping to get your advice on this. I'm trying to take an int field, AccountingPeriod, value, convert it to a date and then format it to populate a date field, but it's not getting the...

View Article

Casting one datetime as date converts other datetime fields

I have a table with two DateTime fields. When I select them and cast one of them as date, it returns them both as date. For example:select orderdatefrom tableAwould return results in datetime format....

View Article

Merge Ouput producing duplicate records from inserted and deleted tables in...

Hi All,This is a continuation of another thread. I am attempting to use the Merge statement to perform these activity.I am just doing an insert for new columns and updating existing records.The update...

View Article


SSRS Header image changes

Hi,I have a purchase order report that has an image in the header which is retrieved from the database.  Depending on a specific field then the image that is sent to the report in the query can be...

View Article

SET Options issue on SQL Server 2014

Hello, I am creating a table which has a persisted computed HashByte column. After the table is created when I try to insert data from CSV to that table it complains: INSERT failed because the...

View Article

Item category details

I have a below tables and want to get the result as per updated price of items in a query.CREATE TABLE [dbo].[Sales]([Icode] [varchar](10) ,    [Ccode] [varchar](13),    [qty] [numeric](18,

View Article


SPROC that queries another DB permissions issue

We provide web based software to companies and host the software on our servers.   Each client has it's own database.  However there are 2 system databases that I query from other sites from time to...

View Article


Display 'blank' cell when it is null.

The data type of the column is decimal(9,2). I wanted an empty cell to be displayed when the output is NULL. COALESCE(column, '') would display empty cell, shouldn't data type conversion be required. Howe

View Article

Strategy advice for storing Personal Identifiable Information

Hello,  I am looking to understand best practices on how to store Personal Identifiable Information.  This project has not started yet and all looking to do my due diligence.  The high level is that...

View Article

Loop Thru XML Tags with Cursor and Insert Parent/Child data into a table.

So, here's the XML.. I am relying on order of presence in file.<?xml version="1.0"?><ROOT>    <Policy>        <PolicyNumber>HO00000001</PolicyN

View Article

Inserting from temp table to linked server

Hi All,I've been having a painful time with this scenario: building an SSIS package, but to verify results, I've been asked to pull from production copy data sources, which are on another server. After...

View Article


string to DATE failing when appending to a table.

Hi All, I ran and import from a flat file with a string date format 'dd/mm/yy', and converted to 'Date' type duing the import, and it ran fine while creating a new table. When i tried to 'append' the...

View Article

I need to combine two unrelated queries to produce needed results

I have two queries that I need to combine to get results togetherThe first query returns 3000 customer ID'sThe second query returns 12 part  ID's and a percentage field.I would like my results to be...

View Article


SSIS package assistance, importing files from folder

I'm trying to create a package to import SQL Audit files to a table on my server, to make searching them easier when I'm trying to track down something.  I've got a package that works, mostly.  I've...

View Article

TRANSACTION effects and considerations

Hi all....   I've got some code that I'm going to need to place into a transaction so that something like the Agent Job that runs the stored procedure, being cancelled due to other considerations...

View Article


TRIGGER for INSERT/ UPDATE from table source for table destination

I have a database with normalized tables and another application with non-normalized table. So I need to create a trigger for when I insert / update a register in the source table (normalized) I can...

View Article

Encryption and data length limitations

I'm having an issue in encrypting large documents. I know that previous editions ENCRYPTBYKEY had a maximum size of 8,000 byte limitation. Does SQL Server 2014 have any new features that overcomes this...

View Article

XML path and XML format

I have raw data as below in a table AgentID               code                &

View Article
Browsing all 3145 articles
Browse latest View live