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

Query to display unique comments based on certain conditions

TABLE DEFINITIONColumn Name CommentsCustomerID INTSequenceNo INTComments VARCHAR(MAX)CUSTOMER TABLECustomerID SequenceNo Comments1 1 ABC D1 2 CDE1 3 ABC1 4 ABC D1 5 CDE1 6 abc2 7 ABC DEF2 8 2 9 ABC...

View Article


cross-database function call

i have 2 databases on the same serverOne has a function, the other has the tables and viewsusing dbaselect dbo.function(t.column) as x from dbb.dbo.table as tgives m an invalid object name of...

View Article


Importing xml file from data profiling task into SQL Server Tables

I just used the SSIS data profiling task and exported data into an xml file. How does once get that data that has been exported into an xml file into database table(s)? Regards,Jonathan

View Article

Unique constraint and Foreign key

Just wondering.....One of our developers just steped into our office and asked why it is not possible to create a Foreign key to a Unique constraint ??Explanation on this;Table A has column 1 holding a...

View Article

Operand type clash: int is incompatible with date

Hello, i have been trying to solve this for sometime but i cant get around it. hopefully somebody can help me out here.this is a piece of my code: SELECT TOP 1000 *... case when Rownum<=...

View Article


Unblocking stored procedure (template)

[i]The other day I was asked to build a SQL Server process to terminate blocking sessions that could be safely destroyed in order not to drain necessary instance resources. The solution is made of...

View Article

Replace Rows with other in same table

I have the below table :ID Name Date_Start Date_End Time_Start Time_End9 xxxxx@gmail.com 13/06/2015 NULL 23:00.0 NULL10 xxxxx@gmail.com NULL 14/06/2015 NULL 00:00.011 xxxxx@gmail.com 15/06/2015 NULL...

View Article

How Do I ? Batching the data

Hi There,I need to group up the records randomly into ‘n’ number of batches. That can be done by NTILE, but I want group up similar records in single group.Say for example, following is the list of...

View Article


How to partition and add sequence/rownumber using CTE or Row_number()

Hi there, I have the following table struction, lets call it table A.bookid startdate endate 2001 2000-01-01 2000-01-053001 2001-01-01 2001-01-024001 2002-01-01 2002-01-04and i want the end result to...

View Article


huge number of rows in table spool

Hi All: I have a CTE query against a table with 32K rows that runs fine in 2008R2. I am running it in 2014 Std Ed. against the same data and it runs very slowly. Looking at the execution plan I think I...

View Article

Performance Issues using DELETE

Hi I have a table dbo.CustomerServices with over 10 Million RowsI have none unique Indexes on CustomerID and ServiceIDI've also created a unique Index across both columns.My delete statement is as...

View Article

Is there a reason for the ISO behaviour of ANSI_NULL?

I overheard someone helping a user fix their query where they had used = NULL instead of IS NULL. Of course we know that, but I'm curious why the standard didn't alias them together so that it could be...

View Article

Help with a job step (calling an exe)

Hi everyone, I have inherited a job that is calling a maintenance plan. The maintenace plan makes a back-up of various databases. I have to add a step to add to encrypt the backup. I have the exe...

View Article


How to insert data from localdb to amazon redshift?

Hi, I have a populated table on my local machine, I have created the linked server and connection is working fine.I have also created the same table on redshift cluster and i want to insert all the...

View Article

DB corruption, some peer review please.

for the second time this week, on a SQL 2014 instance, Getting some corruption ; i'm assuming the error is unrepairable/restore from backup .My question is really leaning as to why i might be getting...

View Article


Stored proc Timing out halfway through - rolling back without transaction

Hi,We have a high volume database with 1000's of users and 1000's of procs. Our application enforces a 20 second timeout on all connections. We can't adjust the 20 seconds - this is a business rule.It...

View Article

Rebuilding large database tables and indexes

I have come across a database system which isn't designed to work optimally. It is fairly large (~400GB) and performance of loading and querying is degrading (improper data types, fragmented indexes,...

View Article


C# sql clr procedure

wondering if anyone has come across a good C# CLR to run as a sql stored procedure to extract a table contents to a file?

View Article

Call for a database backup for a database on another (linked) server

I have a sproc that will generate a dynamic call (and this must be done in a stored procedure),... Anyway the dynamic call I am having problems with is that I needto dynamically create a statement to...

View Article

SID Makes Query Slow in Clustered Column store? Execution Plan increased...

Posted details herehttp://www.sqlservercentral.com/Forums/Topic1701303-360-1.aspx

View Article
Browsing all 3145 articles
Browse latest View live