Popular Posts

SQLblog.com - The SQL Server blog spot on the web

Tuesday, October 31, 2017

How to determine SQL Server database transaction log usage

SQLServerCentral.com Articles
How to determine SQL Server database transaction log usage

One crucial aspect of all databases is the transaction log. The transaction log is used to write all transactions prior to committing the data to the data file. In some circumstances the transaction logs can get quite large and not knowing what is in the transaction log or how much space is being used can become a problem. So how to you determine how much of the transaction log is being used and what portions are being used?

sqlmonitor How to fix SQL Server disk I/O bottlenecks (without a hammer)
In this new article, Simple-Talk editor Tony Davis explains step-by-step how to find and fix the root causes of disk I/O bottlenecks, including gathering data, avoiding knee-jerk fixes, and how monitoring tools can help. Read now.

http://www.healthsupplementhub.com/stackt-360-canada/

SQLServerCentral » Latest topics
http://www.healthsupplementhub.com/stackt-360-canada/
Stackt 360:this supplement encourages me to wipe out all my depletion and weariness and help me to remain dynamic and enthusiastic for the long

Does Your Work Attire Really Make a Difference?

SQLServerCentral » Latest topics
Does Your Work Attire Really Make a Difference?
Comments posted to this topic are about the item [B]Does Your Work Attire Really Make a Difference?[/B]

Need to zip files and load into Source Modified Date , Date folder.

SQLServerCentral » Latest topics
Need to zip files and load into Source Modified Date , Date folder.
Hi,

I have to zip files regularly and load them into destination, the destination folder should be in format YYYY_MM. How can I create folder in this format from source file modified date. Once I create this folder, then zip the files into this f

PASS Summit 2017 highlights on this blog!

SQLblog.com - The SQL Server blog spot on the web
PASS Summit 2017 highlights on this blog!

You can read this blog post at this link: https://jorgklein.com/2017/10/31/pass-summit-2017-highlights-on-this-blog/

This blog has moved to https://jorgklein.com There will be no further posts on sqlblog.com. Please update your feeds accordingly.

You can follow me on twitter: http://twitter.com/jorg__klein

How to find the first recurring character of a string.

SQLServerCentral » Latest topics
How to find the first recurring character of a string.
I have a query that finds the first recurring character in a string.
For eg : if @str = 'ABCCDA' then i should C as answer as it recurred first and not A(it also recurred but C recurred before it). If there are no recurring charcters then it should r

The server will drop the connection, because the client driver has sent multiple requests while the session is in single-user mode

SQLServerCentral » Latest topics
The server will drop the connection, because the client driver has sent multiple requests while the session is in single-user mode

Around 2am in the morning, certain jobs fails and report fails at the same time. Report (business objects) connects to SQL server using a generic sql account. When I look at the event log, I get the following error messages. Any idea what this means?

Halloween 2017

SQLServerCentral » Latest topics
Halloween 2017
Comments posted to this topic are about the item [B]Halloween 2017[/B]

Best DB advice - very basic and general

SQLServerCentral » Latest topics
Best DB advice - very basic and general
Hello to everyone,

I rsearched in this forum but could not find pertinent advice... which is the best DB for our needs?

I am a very IT challenged (ignorant) partner who has been tasked with the responsibility to chose and create a DB for

SSIS Package and SQL Server Agent Job Failure - Fails at Data Import control flow when trying to import from Excel.

SQLServerCentral » Latest topics
SSIS Package and SQL Server Agent Job Failure - Fails at Data Import control flow when trying to import from Excel.
Hi, we have an application that has not been changed (no new check-ins) for months. We also did not change the SQL Server Agent job.  Recently, there was a move of some databases to a different server, however, but not sure if that cou

Rank a large table

SQLServerCentral » Latest topics
Rank a large table
Hi there,
I am trying to figure out the best way to rank a table that has 600 million rows.

This is data about Company financial info from different companies.
Eg: ID=1 (there is a reference table for ID to CompanyName) ; iDate (date whe

Table partitioning with 2016 standard edition

SQLServerCentral » Latest topics
Table partitioning with 2016 standard edition
I have never partitioned any table so I am not familiar with its pros and cons but just to test it out, I have 2016 standard edition installed in one of our test server and I am thinking about creating a partition (by date range) on one of the table which

Today's Random Word!

SQLServerCentral » Latest topics
Today's Random Word!
HI When you woke up today, or logged-onto Opera Forums, you may have had a dream, a thought, a scene or a word running through your mind... Jump on that word... And. Post it here by it's thumbs! :hat: Quickly! Before it becomes a number!

Rank a large table

SQLServerCentral » Latest topics
Rank a large table
Hi there,
I am trying to figure out the best way to rank a table that has 600 million rows.

This is data about Company financial info from different companies.
Eg: ID=1 (there is a reference table for ID to CompanyName) ; iDate (date whe

Reading XML data from SQL Table

SQLServerCentral » Latest topics
Reading XML data from SQL Table
Hi Experts,

I have loaded an XML file which is 750MB in size, its created as a BLOB. Following is an  output of the XML files and I do not know how to read this into SQL table. The main confusion is how to read the nodes. I have used SSIS to

DBCC CHECKDB with Msg 8921, Msg 824

SQLServerCentral » Latest topics
DBCC CHECKDB with Msg 8921, Msg 824
my database has 20 tables.
out of which 8 tables is opening but the remaining 12 shows error
no backup has been created recently. last full backup on jan 8, 2017.

i do the 
DBCC CheckDB  against the corrup

Big Data

SQLServerCentral » Latest topics
Big Data

Dear all,

I read that SQL Server 2016 has now a tool to integrate with Big Data.

Before I understand this tool, probably it makes sense to understand the big data concept and be mastering big data (maybe certify myself).

Can

Sum case nulls and 1900-01-01 00:00:00.000

SQLServerCentral » Latest topics
Sum case nulls and 1900-01-01 00:00:00.000

Hi Guys.

I have the following as part of my statement and it counts the '1900-01-01 00:00:00.000' fine.  However, it does not also count the NULLs.  Can you help?  The column contains both NULL an

Design considerations for a tabular model

SQLServerCentral » Latest topics
Design considerations for a tabular model
I have a star schema already in existence (SQL Server fact table and numerous dimension tables). For a given tabular model I have used that as the basis of my design, grabbing a subset of the tables (the fact plus a few dimensions) and within those tables

Nearest Date value

SQLServerCentral » Latest topics
Nearest Date value

PASS 2016 Resolutions Followup

SQLblog.com - The SQL Server blog spot on the web
PASS 2016 Resolutions Followup
Wow, it's been over a year now since I made my second round of foolish promises and plans . Now I take a quick pass at saying how I did at these promises before the major annual gathering of SQL Server loving needs called the PASS Summit. Like all resolutions, you win some, you lose some. But I have stayed busy, so busy that I didn't finish this until the night before the Summit starts, at midnight Pacific Time (which is 3 hours off of normal time!) 1. Keep involved locally. I was definitely able...(read more)

Best DB advice - very basic and general

SQLServerCentral » Latest topics
Best DB advice - very basic and general
Hello to everyone,

I rsearched in this forum but could not find pertinent advice... which is the best DB for our needs?

I am a very IT challenged (ignorant) partner who has been tasked with the responsibility to chose and create a DB for

Monday, October 30, 2017

SQL Polybase Force External Push Down

SQLServerCentral » Latest topics
SQL Polybase Force External Push Down

Comic for 2017.10.31

RSSMix.com Mix ID 8239024
Comic for 2017.10.31
New Cyanide and Happiness Comic

How Redgate use SQL Clone internally to provision databases

SQLServerCentral.com Articles
How Redgate use SQL Clone internally to provision databases

A common thread behind the software Redgate develop is a problem or issue they’ve come across in the software development process. They then adopt the software themselves, which gives us a real understanding of the features that need to be developed further. To gain a deeper insight into SQL Clone, this interview was conducted with Joseph Woodhouse, Redgate's IT Manager, to find out about how it’s being used to implement a new database provisioning process at Redgate.

Send email when a field is 0

SQLServerCentral » Latest topics
Send email when a field is 0
Hi,

I query that will be part of a store procedure. the store procedure will be loading a table, after a load I want to check two fields first before I sent email.

INSERT INTO table (id, processName, isProcessed, isSuccess)
Values(1,

SQL Query (Merge Statement) Help

SQLServerCentral » Latest topics
SQL Query (Merge Statement) Help
Hi Guys,

I need help. I want to use a MERGE statement. The source and target tables are pretty big so I really want to use MERGE Statement
Here is the issue. I want to compare SOURCE VS Target table with some filters in the target table. I a

Fantasy Football 2017

SQLServerCentral » Latest topics
Fantasy Football 2017
Placeholder for the 2017 league. Congrats to the 2016 winners: Ray K - $100 SequelSurfer - $75 Steve Jones - $50 I'll do the same prizes next year. Everyone from 2016 has first crack at the league (12 teams), but if you're interested in joining, l

Exporting Data to Excel

SQLServerCentral » Latest topics
Exporting Data to Excel
Man, this place is pretty dead. Let me stir some stuff up being it's been a YEAR since I've posted here. Since then, I've been slinging Python on this forums trying to get people to use it more with the Microsoft stack because I absolutely love Python + S

Best DB advice - very basic and general

SQLServerCentral » Latest topics
Best DB advice - very basic and general
Hello to everyone,

I rsearched in this forum but could not find pertinent advice... which is the best DB for our needs?

I am a very IT challenged (ignorant) partner who has been tasked with the responsibility to chose and create a DB for

Need to zip files and load into Source Modified Date , Date folder.

SQLServerCentral » Latest topics
Need to zip files and load into Source Modified Date , Date folder.
Hi,

I have to zip files regularly and load them into destination, the destination folder should be in format YYYY_MM. How can I create folder in this format from source file modified date. Once I create this folder, then zip the files into this f

How Far are You Willing To Go To Get Something?

SQLServerCentral » Latest topics
How Far are You Willing To Go To Get Something?
Comments posted to this topic are about the item [B]How Far are You Willing To Go To Get Something?[/B]

Which is the end?

SQLServerCentral » Latest topics
Which is the end?
Comments posted to this topic are about the item [B]Which is the end?[/B]

Parse Data from a Field Containing Multiple Values using CROSS APPLY

SQLServerCentral » Latest topics
Parse Data from a Field Containing Multiple Values using CROSS APPLY
Comments posted to this topic are about the item [B]Parse Data from a Field Containing Multiple Values using CROSS APPLY[/B]

Nearest Date value

SQLServerCentral » Latest topics
Nearest Date value

Best DB advice - very basic and general

SQLServerCentral » Latest topics
Best DB advice - very basic and general
Hello to everyone,

I rsearched in this forum but could not find pertinent advice... which is the best DB for our needs?

I am a very IT challenged (ignorant) partner who has been tasked with the responsibility to chose and create a DB for

Why Learn About SQL Server Internals?

SQLblog.com - The SQL Server blog spot on the web
Why Learn About SQL Server Internals?
It's not just about performance tuning! https://www.dbbest.com/blog/learn-sql-server-internals/ Please also stop by the DB Best booth if you're at the PASS Summit this week! https://www.eventbrite.com/e/live-qa-sql-pass-2017-with-kalen-delaney-tickets-39302959209...(read more)

StartDate and EndDate in same column

SQLServerCentral » Latest topics
StartDate and EndDate in same column
I have a date column below RunDate , I want to create two column StartDate and EndDate like this StartDate = '2004-08-01'  EndDate = '2006-08-01'    second row  StartDate = '2006-08-02'  EndDate = '2007-02-15
how do I do

Nearest Date value

SQLServerCentral » Latest topics
Nearest Date value

How to find the first recurring character of a string.

SQLServerCentral » Latest topics
How to find the first recurring character of a string.
I have a query that finds the first recurring character in a string.
For eg : if @str = 'ABCCDA' then i should C as answer as it recurred first and not A(it also recurred but C recurred before it). If there are no recurring charcters then it should r

StartDate and EndDate in same column

SQLServerCentral » Latest topics
StartDate and EndDate in same column
I have a date column below RunDate , I want to create two column StartDate and EndDate like this StartDate = '2004-08-01'  EndDate = '2006-08-01'    second row  StartDate = '2006-08-02'  EndDate = '2007-02-15
how do I do

Parse Data from a Field Containing Multiple Values using CROSS APPLY

SQLServerCentral » Latest topics
Parse Data from a Field Containing Multiple Values using CROSS APPLY
Comments posted to this topic are about the item [B]Parse Data from a Field Containing Multiple Values using CROSS APPLY[/B]

Starting a TeamCity build from SSIS via the TeamCity ReST API

SQLServerCentral » Latest topics
Starting a TeamCity build from SSIS via the TeamCity ReST API
Has anyone managed to initiate a TeamCity (TC) build from an SSIS script task?
This is quite a simple task in a native C# application, using httpClient.PostAsync. But if I try to use async tasks in SSIS, things end badly, with ru

How to find the first recurring character of a string.

SQLServerCentral » Latest topics
How to find the first recurring character of a string.
I have a query that finds the first recurring character in a string.
For eg : if @str = 'ABCCDA' then i should C as answer as it recurred first and not A(it also recurred but C recurred before it). If there are no recurring charcters then it should r

DDL Triggers and Permissions

SQLServerCentral » Latest topics
DDL Triggers and Permissions
Hi, I have created a DDL trigger to fire on the ALTER LOGIN statement. I then want to collect the event data and update a table called AlterLogin in a database called IT. The problem I am facing is that potentially any user could issue the alter log

http://www.argacademy.com/

SQLServerCentral » Latest topics
http://www.argacademy.com/
Diploma in engineering course involves categories on elementary engineering ideas. it's knowledgeable course, planned in such how those student

Parse Data from a Field Containing Multiple Values using CROSS APPLY

SQLServerCentral » Latest topics
Parse Data from a Field Containing Multiple Values using CROSS APPLY
Comments posted to this topic are about the item [B]Parse Data from a Field Containing Multiple Values using CROSS APPLY[/B]

Comic for 2017.10.30

RSSMix.com Mix ID 8239024
Comic for 2017.10.30
New Cyanide and Happiness Comic

Pivot - Very challenging queries?

SQLServerCentral » Latest topics
Pivot - Very challenging queries?

Hello Experts,

I have a table with the following data:

Overview of Azure Data Lake

SQLServerCentral.com Articles
Overview of Azure Data Lake

Azure Data Lake stores petabytes of data and analyzes trillions of objects in one place with no constraints. Data Lake Store can store any type of data including massive data like high-resolution video, medical data, and data from a wide variety of industries. Data Lake Store scales throughput to support any size of analytic workload with low latency. Read on to learn more.

Sunday, October 29, 2017

How to use JSON_MODIFY to update nested JSON objects/arrays

SQLServerCentral » Latest topics
How to use JSON_MODIFY to update nested JSON objects/arrays
Hi,
I am trying to find a way to update a SQL nvarchar(max) column used to contain JSON data. So far, nothing I have tried, will successfully update a 2nd-level/nested array. I have found ways to retrieve the information at that level, but not to upda

Which is the end?

SQLServerCentral » Latest topics
Which is the end?
Comments posted to this topic are about the item [B]Which is the end?[/B]

Extended Events - sqlserver.query_memory_grant_usage

SQLServerCentral » Latest topics
Extended Events - sqlserver.query_memory_grant_usage
Hello Folks.

Bit of a strange one - or else I am missing something here (high probability).

I found some sample code to set up an Extended Event Session for Memory Grants and I am trying to run this on SQL Server Standard Editi

PURGING DATA

SQLServerCentral » Latest topics
PURGING DATA
HI All,

I have an assignment, to Purging data, with conditions:
1. Keep the full data 6 months (keep all the records from 01 May 2017 - now, else 31 October 2017 later)

2. Over 6 months, Keep only the last day of the record (ex: 30 A

Transport error encountered when SOME queries run with batch terminator. Behaviour changes depending on text of query. WEIRD!

SQLServerCentral » Latest topics
Transport error encountered when SOME queries run with batch terminator. Behaviour changes depending on text of query. WEIRD!
This is one of the weirdest issues I've ever seen. It's so unbelievable that I actually made a video to demonstrate the problem. Briefly, here's what happens:

I submit a query (create view) without including the SSMS batch terminator ("go"). The

Trying to speed up this 'GetWorkingDays' function.

SQLServerCentral » Latest topics
Trying to speed up this 'GetWorkingDays' function.

I'm trying to redesign one of our working days functions. The idea is to calculate weekends (easy enough) but holidays are trickier. The current idea is to simply embed the hard coded date values in a table expression

Where should I save stored procedures and user defined functions for use in all databases?

SQLServerCentral » Latest topics
Where should I save stored procedures and user defined functions for use in all databases?
I have some generic utility stored procedures and user defined functions that I would like to define/save once, and have available for use in all databases for this server.

After much Googling, I've come across two "schools of thought":

StartDate and EndDate in same column

SQLServerCentral » Latest topics
StartDate and EndDate in same column
I have a date column below RunDate , I want to create two column StartDate and EndDate like this StartDate = '2004-08-01'  EndDate = '2006-08-01'    second row  StartDate = '2006-08-02'  EndDate = '2007-02-15
how do I do

Distributed Computing Principles & SQL-on-Hadoop Systems

SQLServerCentral » Latest topics
Distributed Computing Principles & SQL-on-Hadoop Systems
Comments posted to this topic are about the item [B]Distributed Computing Principles & SQL-on-Hadoop Systems[/B]

Trying to speed up this 'GetWorkingDays' function.

SQLServerCentral » Latest topics
Trying to speed up this 'GetWorkingDays' function.

I'm trying to redesign one of our working days functions. The idea is to calculate weekends (easy enough) but holidays are trickier. The current idea is to simply embed the hard coded date values in a table expression

How Long Before Your Database Runs Out of Space?

SQLServerCentral » Latest topics
How Long Before Your Database Runs Out of Space?
Comments posted to this topic are about the item [B]How Long Before Your Database Runs Out of Space?[/B]

Extended Events - sqlserver.query_memory_grant_usage

SQLServerCentral » Latest topics
Extended Events - sqlserver.query_memory_grant_usage
Hello Folks.

Bit of a strange one - or else I am missing something here (high probability).

I found some sample code to set up an Extended Event Session for Memory Grants and I am trying to run this on SQL Server Standard Editi

Always On manual script

SQLServerCentral » Latest topics
Always On manual script
Hi, 

I have 3 nodes always on.

1. master
2. secondary (auto)
3. Secondary (manual).

How do i change the master to the 3rd slave manually using tsql ?

parsing variable into @query using sp_send_dbmail

SQLServerCentral » Latest topics
parsing variable into @query using sp_send_dbmail
Hi, I have a stored procedure that users sp_send_dbmail and i'm trying to pass through a variable to @query using sp_send_dbmail. But I get the error message:- Msg 22050, Level 16, State 1, Line 0 Error formatting query, probably invalid parameters Msg

Are the posted questions getting worse?

SQLServerCentral » Latest topics
Are the posted questions getting worse?
Is it me, or are the posted questions getting worse these days? I just read a post by someone apparently in charge of something who was asking how to take a database backup and restore it on another server. It seems like the general feeling of a lot

Trying to speed up this 'GetWorkingDays' function.

SQLServerCentral » Latest topics
Trying to speed up this 'GetWorkingDays' function.

I'm trying to redesign one of our working days functions. The idea is to calculate weekends (easy enough) but holidays are trickier. The current idea is to simply embed the hard coded date values in a table expression

Comic for 2017.10.29

RSSMix.com Mix ID 8239024
Comic for 2017.10.29
New Cyanide and Happiness Comic

Saturday, October 28, 2017

Extra Statistics

SQLServerCentral » Latest topics
Extra Statistics
I have a table with 50 columns, 15 indexes and 100+ statistics.  I thought statistics were for indexes.  I can't delete them as the "delete" option is dimmed on the right click menu.  Could these be slowing the read of the table down? 

none the time to get to miss eore

SQLServerCentral » Latest topics
none the time to get to miss eore
[url=https://www.eventbrite.com/e/live-foxtv-washington-state-vs-arizona-2017-game-live-stream-tickets-39361948648]Washington State vs Arizona Live Streaming[/url]

Are the posted questions getting worse?

SQLServerCentral » Latest topics
Are the posted questions getting worse?
Is it me, or are the posted questions getting worse these days? I just read a post by someone apparently in charge of something who was asking how to take a database backup and restore it on another server. It seems like the general feeling of a lot

What else can take up space in a database besides tables

SQLServerCentral » Latest topics
What else can take up space in a database besides tables
I have a database that says it's 108 GB USED - I verified with dbcc showfilestats as well as just clicking tasks-shrink file in SSMS.  however when i run the built in report to show table sizes (including indexes), they only add up to about 75 GB? &n

Perspective

SQLServerCentral » Latest topics
Perspective
Comments posted to this topic are about the item [B]Perspective[/B]

Comic for 2017.10.28

RSSMix.com Mix ID 8239024
Comic for 2017.10.28
New Cyanide and Happiness Comic

Which is the end?

SQLServerCentral » Latest topics
Which is the end?
Comments posted to this topic are about the item [B]Which is the end?[/B]

Comic for October 23, 2017

RSSMix.com Mix ID 8239024
Comic for October 23, 2017
Dilbert readers - Please visit Dilbert.com to read this feature. Due to changes with our feeds, we are now making this RSS feed a link to Dilbert.com.

Substring Question

SQLServerCentral » Latest topics
Substring Question
Hi,
I trying to extract the value from a field until a special character   eg: firstname.lastname  I only want firstname have the substring working well for the most part except when there is not Period in between it then return a blank (not

sportpersons should be able to participate in sport

SQLServerCentral » Latest topics
sportpersons should be able to participate in sport
[url=https://weheartit.com/articles/300268210-watch-online-oklahoma-state-vs-west-virginia-live-stream-free-28-oct-2017-ncaa-college-football-week-9-preview-28-oct]Oklahoma State vs West Virginia Live Streaming[/url]

Find query execution count in certain time period

SQLServerCentral » Latest topics
Find query execution count in certain time period

Hi,

Is it possible to find a query execution count in certain time period?

For example, a user executes "select *from emp where id=10" several times a day. Can I find how many times he executed the query i

Is SQL Server Replication going away?

SQLServerCentral » Latest topics
Is SQL Server Replication going away?
Does anyone know if Microsoft is thinking about doing away or not supporting database replication in the future? Do they have other ways to copy transaction changes? Thanks

sql SELECT Count(*) works on single words only

SQLServerCentral » Latest topics
sql SELECT Count(*) works on single words only
   0   down vote  

Stored Procedure

SQLServerCentral » Latest topics
Stored Procedure
Hi
  I have below Stored Procedure. I want
[code language="sql"]
USE [Test]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE Sp_Test
  @fromDate

Amount Value

SQLServerCentral » Latest topics
Amount Value
Hi
  In SSRS report i have written query select(amount) from table1 and amount of value is greater than 10 digits. It shows  #value.
Amount with <= 9 digits is showing correctly.
Thanks

Comic for 2017.10.28

RSSMix.com Mix ID 8239024
Comic for 2017.10.28
New Cyanide and Happiness Comic

Find query execution count in certain time period

SQLServerCentral » Latest topics
Find query execution count in certain time period

Hi,

Is it possible to find a query execution count in certain time period?

For example, a user executes "select *from emp where id=10" several times a day. Can I find how many times he executed the query i

Friday, October 27, 2017

App timing out, but sproc runs in 3 seconds

SQLServerCentral » Latest topics
App timing out, but sproc runs in 3 seconds
System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expi

SQL Server Query is taking high CPU

SQLServerCentral » Latest topics
SQL Server Query is taking high CPU
Hi All,

I have 2 tables. Credit Account ,Credit Account relationship.

Substring Question

SQLServerCentral » Latest topics
Substring Question
Hi,
I trying to extract the value from a field until a special character   eg: firstname.lastname  I only want firstname have the substring working well for the most part except when there is not Period in between it then return a blank (not

sql SELECT Count(*) works on single words only

SQLServerCentral » Latest topics
sql SELECT Count(*) works on single words only
   0   down vote  

Data Modelers - Alternatives to Erwin

SQLServerCentral » Latest topics
Data Modelers - Alternatives to Erwin
I have been asked to find data modeling tools to serve as an alternative to Computer Associate's Erwin. I downloaded Toad version 3 to test it, but it doesn't allow me to import .er1 model diagrams. Does anyone know of decent alternatives to Erwin whi

StartDate and EndDate in same column

SQLServerCentral » Latest topics
StartDate and EndDate in same column
I have a date column below RunDate , I want to create two column StartDate and EndDate like this StartDate = '2004-08-01'  EndDate = '2006-08-01'    second row  StartDate = '2006-08-02'  EndDate = '2007-02-15
how do I do

What is the interval between attempts to bring the cluster online

SQLServerCentral » Latest topics
What is the interval between attempts to bring the cluster online
[Note] I posted a duplicate topic, updated this one to another question

Does anyone knows the interval between attempts to bring the cluster online? e.g. how long does it wait between attempts?


I set it to max 4 times in 6 hours, an

Comic for 2017.10.27

RSSMix.com Mix ID 8239024
Comic for 2017.10.27
New Cyanide and Happiness Comic

Delete records using Minus command in sql

SQLServerCentral » Latest topics
Delete records using Minus command in sql
I have two tables and I want to delete records from one table for which there is no matching records in second table. Now the question is How to delete records

Physical or Virtual Storage

SQLServerCentral » Latest topics
Physical or Virtual Storage
Comments posted to this topic are about the item [B]Physical or Virtual Storage[/B]

StartDate and EndDate in same column

SQLServerCentral » Latest topics
StartDate and EndDate in same column
I have a date column below RunDate , I want to create two column StartDate and EndDate like this StartDate = '2004-08-01'  EndDate = '2006-08-01'    second row  StartDate = '2006-08-02'  EndDate = '2007-02-15
how do I do

Are the posted questions getting worse?

SQLServerCentral » Latest topics
Are the posted questions getting worse?
Is it me, or are the posted questions getting worse these days? I just read a post by someone apparently in charge of something who was asking how to take a database backup and restore it on another server. It seems like the general feeling of a lot

How to get percent of subtotal

SQLServerCentral » Latest topics
How to get percent of subtotal
Please see attached example. I'm trying to get the percent of subtotal onto my report. I've attached a screenshot of SSRS in design view and sample results.

SSRS: Addind a parameter to the dataset query

SQLServerCentral » Latest topics
SSRS: Addind a parameter to the dataset query
Dear all,

I have created in my dataset a parameter named @pDB 
and I have build the query below in the dataset:


[code language="sql"]
SELECT &nbs

Trying to speed up this 'GetWorkingDays' function.

SQLServerCentral » Latest topics
Trying to speed up this 'GetWorkingDays' function.

I'm trying to redesign one of our working days functions. The idea is to calculate weekends (easy enough) but holidays are trickier. The current idea is to simply embed the hard coded date values in a table expression

SQL versus program

SQLServerCentral » Latest topics
SQL versus program
Hi all,

I'm posting my question in this 2008 forum because we're running SQLServer 2008R2, but it is more a general question about SQL vs programs (in Java for me).

To briefly explain, over the years I wrote lots of queries in SP, VW and

Download SQL patch Info

SQLServerCentral » Latest topics
Download SQL patch Info
Comments posted to this topic are about the item [B]Download SQL patch Info[/B]

SQL Server Query is taking high CPU

SQLServerCentral » Latest topics
SQL Server Query is taking high CPU
Hi All,

I have 2 tables. Credit Account ,Credit Account relationship.

How to set remote location for File table directory in SQL server 2016?

SQLServerCentral » Latest topics
How to set remote location for File table directory in SQL server 2016?
Hi All,

I need a help. I want to change File table directory with different location(Remote location) on the file stream server. How to set in using script (or) through properties window. 

Thanks 
Rajan

Bulk load architecture

SQLServerCentral » Latest topics
Bulk load architecture
Hello SQL Guys,
I am working on a project where in a file location I will be getting daily files like marketing_input_1.txt, marketing_input_2.txt etc and sales_input_1.txt, sales_input_2.txt etc. The number of files can vary and that is shown as the

Building an Incremental Load Package – Level 3

SQLServerCentral » Latest topics
Building an Incremental Load Package – Level 3
Comments posted to this topic are about the item [B]Building an Incremental Load Package – Level 3[/B]

Thursday, October 26, 2017

Discover database DevOps and more at PASS Summit

SQLServerCentral.com Articles
Discover database DevOps and more at PASS Summit

PASS Summit lands in Seattle from October 31 to November 3 this year, bringing with it the latest thinking and developments in the SQL Server world. This blog post from Annabel Bradford gives the details of what Redgate willl be presenting on, when this year's Redgate Rocks party will be, and how you can get involved with the team!

Fun with Dates

SQLServerCentral » Latest topics
Fun with Dates
Comments posted to this topic are about the item [B]Fun with Dates[/B]

Parameter Sniffing In Action

SQLServerCentral » Latest topics
Parameter Sniffing In Action
Comments posted to this topic are about the item [B]Parameter Sniffing In Action[/B]

App timing out, but sproc runs in 3 seconds

SQLServerCentral » Latest topics
App timing out, but sproc runs in 3 seconds
System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expi

Update 600,000 rows in table

SQLServerCentral » Latest topics
Update 600,000 rows in table
Hi I need to update 600,000 rows in the table column with files from the file system. I see there are articles online how to update large number of rows in batches. How do I loop through SQL query and update in batches? I don't see any examples. Could yo

Transport error encountered when SOME queries run with batch terminator. Behaviour changes depending on text of query. WEIRD!

SQLServerCentral » Latest topics
Transport error encountered when SOME queries run with batch terminator. Behaviour changes depending on text of query. WEIRD!
This is one of the weirdest issues I've ever seen. It's so unbelievable that I actually made a video to demonstrate the problem. Briefly, here's what happens:

I submit a query (create view) without including the SSMS batch terminator ("go"). The

web configuration of Master Data Services SQL Server 2016

SQLServerCentral » Latest topics
web configuration of Master Data Services SQL Server 2016
I installed Master Data Services (SQL Server 2016 Developer SP1) on a Windows 10 Enterprise machine. Using Master Data Services Configuration Manager, I did the following: For the create database I entered computername\username, was successful (I used a l

Reproduce-able : Could not continue scan with NOLOCK due to data movement.

SQLServerCentral » Latest topics
Reproduce-able : Could not continue scan with NOLOCK due to data movement.
Hello SQL Server Community,
Today I ran into an issue with an error I have never seen before.  The error is "Could not continue scan with NOLOCK due to data movement."
I googled the error and all the articles I read talk about possible data c

how to take backup databaseobjects(tables scripts,storeprocedure and functions etc) in sqlserver using sql scripts

SQLServerCentral » Latest topics
how to take backup databaseobjects(tables scripts,storeprocedure and functions etc) in sqlserver using sql scripts
Hi All,
   I have one doubt in sql server .
how to take Script database objects automaticaly using sql script and keep into specificfoleder(c:\backup\)

Create monthly
tables structure( create without data),views,procedures

Send mail from stored procedure

SQLServerCentral » Latest topics
Send mail from stored procedure
I have a stored procedure that is used for a report.   I am being asked to have an email go to one person every Monday.  I wrote a stored procedure that I will run as a job in SQL Server Agent.

I am getting the following error when

Need you help on to find wait type

SQLServerCentral » Latest topics
Need you help on to find wait type
Hello All,
Need your help on TSQL Script to  find which wait type is running currently on the SQL server DB instance.

Thanks in advance!!


Best Regards,
DBA

Encrypt Incoming Connection from ColdFusion

SQLServerCentral » Latest topics
Encrypt Incoming Connection from ColdFusion
Hello,
My web developer is trying to encrypt her ColdFusion connection coming into my database server.  We do not have "force encryption" turned on.  So far, she has been unable to get the connection to work and cannot find any help to assi

database for .net application

SQLServerCentral » Latest topics
database for .net application
We have  a situation like below:

we have a .net application for students that used the SQL server database as backend, I will call it App1.  The database have some tables for the application and also import a lot of tables from our main

Are the posted questions getting worse?

SQLServerCentral » Latest topics
Are the posted questions getting worse?
Is it me, or are the posted questions getting worse these days? I just read a post by someone apparently in charge of something who was asking how to take a database backup and restore it on another server. It seems like the general feeling of a lot

Where query time between 6am and 6pm

SQLServerCentral » Latest topics
Where query time between 6am and 6pm
I am trying to modify my query so that it will only look at the data between 6am and 6pm instead of the whole 24 hours, I have tried a few things but have had no luck

Here is my current query

Update 600,000 rows in table

SQLServerCentral » Latest topics
Update 600,000 rows in table
Hi I need to update 600,000 rows in the table column with files from the file system. I see there are articles online how to update large number of rows in batches. How do I loop through SQL query and update in batches? I don't see any examples. Could yo

Getting started with Powershell

SQLServerCentral » Latest topics
Getting started with Powershell
Hi all

I'm just getting started with PowerShell and following the series by Ben Miller here.  I'm trying to do things properly and learn rather

dbcc freeproccache for Single stored procedure

SQLServerCentral » Latest topics
dbcc freeproccache for Single stored procedure
Hi Team,

please provide the query to clear the cache of single stored procedure.

THanks
Bhanu

Team Foundation Server with Git strips out connection Manager for SSIS Packages

SQLServerCentral » Latest topics
Team Foundation Server with Git strips out connection Manager for SSIS Packages
Hi there

We are using Git on Team Foundation Server for Visual Studio 2015 Community Edition.
I am able to create a branch in TFS, make changes to a SSIS package in a Visual Studio solution project.
The SSIS package has connection Ma

Need help in improving performance of a stored proc which invokes multiple scalar functions on the resultset

SQLServerCentral » Latest topics
Need help in improving performance of a stored proc which invokes multiple scalar functions on the resultset
I have stored proc which fetches a lot of data and the performance is really bad.

The problem is that this SP extensively uses Scalar functions (which does a complex calculation using while loop).
The scalar function is called on the resultse

Data integration between MYSQL and SQL Server - encrypted data

SQLServerCentral » Latest topics
Data integration between MYSQL and SQL Server - encrypted data
Hi,
I need to integrate data (ETL for a DW) from MySQL (network a)  into SQL Server (network b).  This is no problem in itself.
The problem I need to solve is that PII data coming over the wires needs to be encrypted.  This is going

SSMS 17.x and missing Utility Explorer

SQLServerCentral » Latest topics
SSMS 17.x and missing Utility Explorer
So we have a SQL 2014 instance set up on our monitoring server to run UCP. Up until now we viewed the UCP dashboards, etc, through Utility Explorer in SSMS for 2014.

Now we have installed SSMS 17.3 on our monitoring server to manage the new Sql 2

Design considerations for a tabular model

SQLServerCentral » Latest topics
Design considerations for a tabular model
I have a star schema already in existence (SQL Server fact table and numerous dimension tables). For a given tabular model I have used that as the basis of my design, grabbing a subset of the tables (the fact plus a few dimensions) and within those tables

Wednesday, October 25, 2017

Free eBook: Understanding SQL Server Concurrency

SQLServerCentral.com Articles
Free eBook: Understanding SQL Server Concurrency

When you can’t get to your data because another application has it locked, a thorough knowledge of SQL Server concurrency will give you the confidence to decide what to do.

Reading XML data from SQL Table

SQLServerCentral » Latest topics
Reading XML data from SQL Table
Hi Experts,

I have loaded an XML file which is 750MB in size, its created as a BLOB. Following is an  output of the XML files and I do not know how to read this into SQL table. The main confusion is how to read the nodes. I have used SSIS to

Compare 2 rows using tsql code

SQLServerCentral » Latest topics
Compare 2 rows using tsql code
Hi All,

A questions which is there with me a long long time. Comparing 2 rows in a table.
How can I compare 2 rows in a table and pin-point and say so and so specific column value don't match.
In my below example, i want to compare 2 r

Tell the Judge You Have No Backup

SQLServerCentral » Latest topics
Tell the Judge You Have No Backup
Comments posted to this topic are about the item [B]Tell the Judge You Have No Backup[/B]

Http://DumpsTrack.Com Shop Sell Dumps High Balance/Dumps Track 1+2/ATM UK-AU-EU-RU-USA-Taiwan... >>>>>>>>>>>>>>> WELCOME TO MY SHOP

SQLServerCentral » Latest topics
Http://DumpsTrack.Com Shop Sell Dumps High Balance/Dumps Track 1+2/ATM UK-AU-EU-RU-USA-Taiwan... >>>>>>>>>>>>>>> WELCOME TO MY SHOP <<<<<<<<<<<<<<<< https://www.youtube.com/watch?v=DjSvRWGRygU +++++ Hi all New customer +++++ -Are you realize dream enrichment by working make...
Http://DumpsTrack.Com Shop Sell Dumps High Balance/Dumps Track 1+2/ATM UK-AU-EU-RU-USA-Taiwan...

>>>>>>>>>>>>>>> WELCOME TO MY SHOP <<<<<<<<

create table in mutiple schemas

SQLServerCentral » Latest topics
create table in mutiple schemas
hi,

i need to create single table in nearly 50 schemas.
can anyone provide automation script for this

database for .net application

SQLServerCentral » Latest topics
database for .net application
We have  a situation like below:

we have a .net application for students that used the SQL server database as backend, I will call it App1.  The database have some tables for the application and also import a lot of tables from our main

Execute Process Task: How SSIS loads executable files at runtime

SQLServerCentral » Latest topics
Execute Process Task: How SSIS loads executable files at runtime
Please help me understand how SSIS loads executable files at runtime. Does it copy the file to RAM at runtime to run it? I'd like to know if many jobs running on th same schedule, running the same executable file, will potentially lock resources to this f

Parameter Sniffing In Action

SQLServerCentral » Latest topics
Parameter Sniffing In Action
Comments posted to this topic are about the item [B]Parameter Sniffing In Action[/B]

Trying to speed up this 'GetWorkingDays' function.

SQLServerCentral » Latest topics
Trying to speed up this 'GetWorkingDays' function.

I'm trying to redesign one of our working days functions. The idea is to calculate weekends (easy enough) but holidays are trickier. The current idea is to simply embed the hard coded date values in a table expression

Reading XML data from SQL Table

SQLServerCentral » Latest topics
Reading XML data from SQL Table
Hi Experts,

I have loaded an XML file which is 750MB in size, its created as a BLOB. Following is an  output of the XML files and I do not know how to read this into SQL table. The main confusion is how to read the nodes. I have used SSIS to

case when LIKE on columns from 2 different tables

SQLServerCentral » Latest topics
case when LIKE on columns from 2 different tables
hello,
need some help with the follow.
problem:   A.CITY contains a single city per row  (i.e. TORONTO),   B.CITY contains multiple cities per row  (i.e. TORONTO, TOKYO )
my statement below returns 0, when i want

Join on a Substring

SQLServerCentral » Latest topics
Join on a Substring
I have a proc that runs nightly that moves data into another table. 
The procedure joins on multiple tables one of the joins involves two columns in  tables that  have id numbers. 
I have no control of the source of these table

Postgres SQL in SSIS Execute SQL Task

SQLServerCentral » Latest topics
Postgres SQL in SSIS Execute SQL Task
Has anyone had any experience working with Postgres SQL in SSIS, specifically Amazon Redshift?  I'm able to create an ODBC connection and execute very basic code against a Redshift database - for example, this works - 

CREATE TABLE IF N

How Long Before Your Database Runs Out of Space?

SQLServerCentral » Latest topics
How Long Before Your Database Runs Out of Space?
Comments posted to this topic are about the item [B]How Long Before Your Database Runs Out of Space?[/B]

Out of memory exception

SQLServerCentral » Latest topics
Out of memory exception
If I run DBCC MEMORYSTATUS, it fails to finish and throws this error.

An error occurred while executing batch. Error message is: Exception of type 'System.OutOfMemoryException' was thrown.

The SQL Server is running this version of SQL

Execute Process Task: How SSIS loads executable files at runtime

SQLServerCentral » Latest topics
Execute Process Task: How SSIS loads executable files at runtime
Please help me understand how SSIS loads executable files at runtime. Does it copy the file to RAM at runtime to run it? I'd like to know if many jobs running on th same schedule, running the same executable file, will potentially lock resources to this f

Software Patents

SQLServerCentral » Latest topics
Software Patents
Comments posted to this topic are about the item [B]Software Patents[/B]

Nested insert statements problem

SQLServerCentral » Latest topics
Nested insert statements problem
Hello all. fairly new to SQL. but not that new.
I have 3 stored procedures.
The first one has a statement like "Insert into #TblZBKSP Exec m2maux01..sp_calcbookandshipreportreva @DateRangeFrom"
The second also has an insert statement from the

Transaction Processing When Calling Sub Stored Procedures

SQLServerCentral » Latest topics
Transaction Processing When Calling Sub Stored Procedures
Hi, 

I have come across an interesting scenario, but am not sure what the outcome would be.

If have a stored procedure in the form of:

[code language="sql"]ALTER PROCEDURE [db

Comic for 2017.10.25

RSSMix.com Mix ID 8239024
Comic for 2017.10.25
New Cyanide and Happiness Comic

Need help in improving performance of a stored proc which invokes multiple scalar functions on the resultset

SQLServerCentral » Latest topics
Need help in improving performance of a stored proc which invokes multiple scalar functions on the resultset
I have stored proc which fetches a lot of data and the performance is really bad.

The problem is that this SP extensively uses Scalar functions (which does a complex calculation using while loop).
The scalar function is called on the resultse

Are the posted questions getting worse?

SQLServerCentral » Latest topics
Are the posted questions getting worse?
Is it me, or are the posted questions getting worse these days? I just read a post by someone apparently in charge of something who was asking how to take a database backup and restore it on another server. It seems like the general feeling of a lot

Query taking long time

SQLServerCentral » Latest topics
Query taking long time
Hi,

The below query is taking around 1000 Seconds.
SELECT ar.MOVE_QTY,ar.DM12,ar.AL_OR,ar.OR_CODE,ar.CAI_CODE,ar.CAI_DESCRIPTION,ar.CST_CODE,ar.AL_NO AL_NO,ar.OPEN_QTY,ar.WH_CODE,ar.ETA_DATE,
ar.CATEGORY,ar.AL_DATE,ar.OD_CODE,
ar.SHIP

Tuesday, October 24, 2017

Key Lookups and ColumnStore Indexes

SQLServerCentral.com Articles
Key Lookups and ColumnStore Indexes

Erik figures out why SQL Server really doesn't like combining these two things in a query plan.

How to only select 11pm to 7am in DateTime (many months of data) DDM&DDL included :)

SQLServerCentral » Latest topics
How to only select 11pm to 7am in DateTime (many months of data) DDM&DDL included :)
Looking to run a report for a few years but only between 11pm and 7am.

[code language="sql"]CREATE TABLE mytable(
 i_ticket_id  INTEGER NOT NULL PRIMARY KEY
,c_grand_total MONEY(6,2)

Could not delete from specified MS access tables from SSIS execute task

SQLServerCentral » Latest topics
Could not delete from specified MS access tables from SSIS execute task
I am working in  migration project to upgrade current sql  server 2008 SSIS jobs into new SQL server 2014 in windows 2012 server.
One of my  SSIS job step using MS Access 2010 (.mdb) tables in  SQL Execute Task which deletes all th

SSIS : "The value could not be converted because of a potential loss of data.".

SQLServerCentral » Latest topics
SSIS : "The value could not be converted because of a potential loss of data.".
Dear all,

I have a data conversion task and I am getting the following error message:

while c

Set up job to convert word document to pdf with script task

SQLServerCentral » Latest topics
Set up job to convert word document to pdf with script task

How to only select 11pm to 7am in DateTime (many months of data) DDM&DDL included :)

SQLServerCentral » Latest topics
How to only select 11pm to 7am in DateTime (many months of data) DDM&DDL included :)
Looking to run a report for a few years but only between 11pm and 7am.

[code language="sql"]CREATE TABLE mytable(
 i_ticket_id  INTEGER NOT NULL PRIMARY KEY
,c_grand_total MONEY(6,2)

Best DB advice - very basic and general

SQLServerCentral » Latest topics
Best DB advice - very basic and general
Hello to everyone,

I rsearched in this forum but could not find pertinent advice... which is the best DB for our needs?

I am a very IT challenged (ignorant) partner who has been tasked with the responsibility to chose and create a DB for