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

TRY_CONVERT not recognized

Is there something I'm missing here?[code]select @@versionMicrosoft SQL Server 2014 - 12.0.4213.0 (X64) ...[/code] [code]SELECT TRY_CONVERT(datetime2, '12/31/2010') AS Result; Msg 195, Level 15, State...

View Article


SSIS 2014 Project deployment using TFS

we have started new team of datawarehouse in our company. Team started working on SQL Server 2014 and TFS . They developed packages using project deployment instead of package deployment...

View Article


Not able to Install SQL Server 2014 Express SP1 using Installshield 2014

Hi,I am not able to Install SQL Server Express 2014 SP1 using Install Shield 2014. I invoke custom action(C# code) from InstallShield to install SQL Server Express exe using ProcessStartInfo c# class.I...

View Article

Touble with query using a temp table to compare and update existing table

Let me post the code and then the problems I am having with it.[code="sql"]if object_id('dbo.namefile', 'u') is not null drop table dbo.namefilecreate table dbo.namefile( name varchar(255) not null...

View Article

Adding Values From CTE Columns into A Global Temp Table

Please point out why I am getting errors saying that my CTE columns are invalid. The following is my query.[code="sql"]with QuarterEarning as(select Top(2) Product, [Quarter One Earnings], Rank() over...

View Article


Get results from yesterday if datetime betwen 00:00:00 and 06:00:00

Hello,I'm not sure how to implement this, I have a Sybase DB 15.4 but I guess if I found the logic in SQL I will figure out it in Sybase,What I need to get its the following:I have a table with tickets...

View Article

Calculate attendance based on another table

I have table called logininfo where each employee gets on record if he is present on that day..i need ur help to calculate total working days of the month[code="sql"]CREATE TABLE logininfo(Emp_code...

View Article

Simple CLR request

I'm trying to create what I believe should be a very simple Table Valued Function CLR. Here's a T-SQL version of what I'm trying to create: [code="sql"]CREATE FUNCTION dbo.NGLoop(@string varchar(8000),...

View Article


Generate Extended Properties

I want to create a Comprehensive Data Dictionary.Is Erwin the preferred method for generating extended properties?Does anyone know of a good article on the use of Erwin to do this?Or is there a better...

View Article


Exclude result when at least one field is Y

I have a list of items in different locations. They may have different suppliers but only one supplier can be marked as primary. Below, each location has two suppliers, only one is primary. I want to...

View Article

Strange behavior with decimals

Run the following sql:DECLARE @results TABLE(r INT, d DECIMAL(38,37))DECLARE @X DECIMAL(3,2) = 1.00INSERT INTO @results(r,d) VALUES(0, @X/7)INSERT INTO @results(r,d) VALUES(1, @X/7.1);INSERT INTO...

View Article

Calculating Duration

HiI have a structure below:[quote]/****** Object: Table [dbo].[OrderDetails] Script Date: 20/06/2016 09:03:04 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOSET ANSI_PADDING ONGO --drop table...

View Article

Help me in adding dynamic pivot dates

Please help me in adding dynamic pivot dates based on @fromdate and @enddate [code="sql"]Declare @temp TABLE(shift_date1 datetime,empid1 int,shift_type VARCHAR(30))declare @fromdate datetime =...

View Article


Embedded Text Qualifier Error

When importing a flat file I receive the following error - [Flat File Source [2]] Error: The column delimiter for column "Column1" was not found.Example Record: ""First Name" "LastName""The error is...

View Article

Tables, Primary Keys and Clustered Indexes

It has always been my opinion and understanding that the best way to build a table is to start with an integer identity column and make that the primary key and also the clustered index. The logic, as...

View Article


Memory Optimized Table memory reservation?

Hi,I am thinking about using memory optimization, but my biggest worry is the system running out of memory. The part of the data that would be memory optimized would not exceed the size of my RAM, but...

View Article

problem converting date on procedure.

hello,i have have a procedure that receives a date and a name and takes data from a table, but when i tried to add the date i get an error.this is a sample table[code="sql"]create table...

View Article


How do I import text file delimited with three Pipes |||

Hi All,I am having a hard time importing a text file that was given to me that is delimited by 3 pipes.I am manually importing by right clicking on my database and choosing Tasks...Import DataWhen I...

View Article

How to perform multiple STUFF

I have nvarchar data that looks like XXXXXX-XX-XX where X can be a character or a number. The problem is getting them to sort in a meaningful manner. For example, if I have the following test...

View Article

Scalar Function - Format Numbers

HiI have this function [quote]CREATE FUNCTION [dbo].[fnFormatMobileNumber] (@phone VARCHAR(15))RETURNS VARCHAR(15)AS BEGINDECLARE @Formatted VARCHAR(15)IF (LEN(@phone) > 10) SET @Formatted = '0' +...

View Article
Browsing all 3145 articles
Browse latest View live