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

inserting incremental records in table ?

Hello I want to copy records from another database table  to my  Employee table  i am using below quey to insert records. I have 4k records to insert to destination table but m EMPKEY is giving...

View Article


Column data stores in variable

Hi everyone,I want to column level data store in one variable. like below example.

View Article


Has anyone written a Faceted Search like the ElasticUI interface ... all in SQL?

If you go to dubdubdub elasticui dotcom and look at the bottom-most screenshot, I need to do the equivalent, all in a t-SQL stored proc (addt'l support functions acceptable), and needs to be reasonable...

View Article

issue casting as dollars, etc.

I would like this to output as 1. With Dollar signs2. Thousand separators3. Whole dollars amount with no decimals.Thanks [code language="sql"]cast(L.HTS_Value as money) as [O

View Article

Datepart (week) not playing nice

Hi all,I have a datepart issue I can't fix..

View Article


will this SQL trigger recursive

I am new on writing and testing trigger.  I am trying to write a trigger to monitor ta colume wih the table.  Wether it is insert or update, if that column has a period there, the trigger will remove...

View Article

Query Tuning

Hi,Can you please suggest what can be done to tune the following query ?SELECT A.accounting_program_code ACCT_PGM_CD,

View Article

SQL Query Help - Separate Column

Hi All:Need help with SQL Query. I have a column named Participants with Names and email addresses in one single column. I want to separate the once with email address in separate column.Participants:G

View Article


Checking Fulfillment of Prerequisites That Can Contain Elaborate AND/OR...

I am working with a system in which I can query prerequisites for course enrollment in a query like this:[code language="sql"]SELECT [td].[PEOPLE_CODE_ID]&n

View Article


Change formatting of SSMS generated code

Hi all,    not exactly the most pressing query ever, but after all these years I've finally cracked.   Is there any way to alter the munged up monstrosity that is the SSMS generated code from the likes...

View Article

Friday Fun - Excel Formula to SQL Functions

I recently found a nifty Excel Formula that worked out if a datetime was UTC or BST (British Summer time) and adjusted the input accordingly to output UTCHere's the formula, where C3 contains the date...

View Article

Ways of tuning queries on columnstore index (in SQL Server 2014)

Hello,After migrating to SQL Server 2014, I turned one of our large fact tables (2bn rows) into a columnstore index. This has been brilliant - saved loads of disk space, and significantly increased the...

View Article

How to create relationship

When I try to create a relationship between modeloptionID in the modeloptions  table and "name" in the model table I get the error THE ALTER TABLE statement conficted with the FOREIGN KEY constraint...

View Article


Hopefully an intriguing 'Update' question, for a data cleanse

HI all,I'm cleaning a table with about 2k rows of false data.  Basically I have 3 columns as follows:[code language="sql"]CREATE TABLE [dbo].[logs]( [id] [int] NOT NULL, [pro

View Article

SQL Query Help: Joining on where IN

Easier to demo than explain. Excuse the format, this is my first post.Is it possible to join on a partial match? See below. If i join on like '% + i.equipmentid + %' then i get I could join on 1234567...

View Article


by what size will nvarchar(max) column get stored in LOB_DATA allocation unit?

I have a table defined as follows:[code language="sql"]CREATE TABLETABLE [TestTable] [TestTable]((

View Article

ROWS_PER_BATCH - How does it work in SQL OPENROWSET

Hi,I am using SQL Openrowset to read the file and load the data into a table. The file contains about 150 million records worth data. When I try to load the data the transaction log bloats because of...

View Article


For XML Path Returning amp when '&' symbol used in text

Hello there, I've attempted to find some information on the XML path and after a few modifications I still wasn't able to adjust this subselect statement to print the '&' symbol instead of the in

View Article

Aggregate Performance Question

Which approach should I generally take? In this example, I'm keeping it simple, but imagine 20 calculated columns in which I keep summing the same values repeatedly, just in different combinations.  Or...

View Article

Group by not working as desired...

View Article
Browsing all 3145 articles
Browse latest View live