Popular Posts

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

Thursday, November 30, 2017

Indexes for Memory-Optimized Tables

SQLServerCentral » Latest topics
Indexes for Memory-Optimized Tables
Comments posted to this topic are about the item [B]Indexes for Memory-Optimized Tables[/B]

Error Setting Up SSISDB

SQLServerCentral » Latest topics
Error Setting Up SSISDB
I started the wizard to create the Integration Services Catalog and entered a password that was too short for our Windows policy. Corrected that and now get an error indicating. "String or binary data would be truncated.  Invalid object name 'sys.tru

Parallel Stored Procedures using CLR - Performance

SQLServerCentral » Latest topics
Parallel Stored Procedures using CLR - Performance
We have a main analytics SP that calls 100 other sub SPs, all of which act upon the same set of data (Claims), check it for some business rules, and output discrepancies.

The SPs need not all be run sequentially, they can be broken out into secti

Not Useless Features

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

Force execution plan in a view

SQLServerCentral » Latest topics
Force execution plan in a view
I'm having an issue right now. We removed an identity column that is mostly irrelevant to a table. However, this identity is used by grids on the UI. To replicate it, I used a ROW_NUMBER to create an ID on the fly for the grid to use.
The view is some

SQLServerAgent could not be started (reason: Error creating a new session).

SQLServerCentral » Latest topics
SQLServerAgent could not be started (reason: Error creating a new session).
I can't start the SQL Server Agent Service on a new installation. During the install I chose not to start the service. When I attempt to start the service it failed to start. I checked the application event log and following error occurred: [q

We Need DevOps for Performance

SQLServerCentral » Latest topics
We Need DevOps for Performance
Comments posted to this topic are about the item [B]We Need DevOps for Performance[/B]

restore-sqldatabase dynamic relocate files

SQLServerCentral » Latest topics
restore-sqldatabase dynamic relocate files
I'd like to use restore-sqldatabase to automate a nightly refresh and am trying to dynamically pass values for the RelocateFile parameter by building an array:


[code language="sql"]#Find the appropria

Calendar table to transaction table join performance

SQLServerCentral » Latest topics
Calendar table to transaction table join performance
Greetings, SQL Experts,
I encountered a performance issue that caught me by surprise. I'm joining two tables. One is calendar table with one row per day, and an indexed datetime type DateKey column. The other is  a transaction table with a Transa

Trggier not working with insert

SQLServerCentral » Latest topics
Trggier not working with insert
Hi,
I have an insert command saved to a table in a database "after insert" the trigger take the insert command and execute it. when the trigger

Add Column to Staging table

SQLServerCentral » Latest topics
Add Column to Staging table
Hi,

The code below used to work fine.
It is part of a stored procedure which bulk inserts data from a csv file.
Suddenly, after editing, I keep on getting an error stating that RowNr does not exis

in the time to go to miss here

SQLServerCentral » Latest topics
in the time to go to miss here
[url=https://cowboysvsredskins.ca/]Cowboys vs Redskins[/url]
[url=https://cowboysvsredskins.ca/]Cowboys vs Redskins Live[/url]
[url=https://cowboysvsredskins.ca/]Cowboys vs Redskins L.i.v.e S.t.r.e.a.m[/url]

Stairway to DAX and Power BI - Level 12: Function / Iterator Function Pairs: The DAX CountA() and CountAX() Functions

SQLServerCentral » Latest topics
Stairway to DAX and Power BI - Level 12: Function / Iterator Function Pairs: The DAX CountA() and CountAX() Functions

Using CSS to control formatting in dbmail

SQLServerCentral » Latest topics
Using CSS to control formatting in dbmail
I have written a query and currently have a job that runs and sends an email using sp_send_dbmail in a formatted table if certain conditions are met. I use style sheets to control the format and this works fine for all columns returned using the style for

The Difference Between Rollup and Cube

SQLServerCentral » Latest topics
The Difference Between Rollup and Cube
Comments posted to this topic are about the item [B]The Difference Between Rollup and Cube[/B]

Find all triggers that contain FACTS in trigger name

SQLServerCentral » Latest topics
Find all triggers that contain FACTS in trigger name
i cant seem to write a query to find all triggers in a database that contain the word FACTS in it

We Need DevOps for Performance

SQLServerCentral » Latest topics
We Need DevOps for Performance
Comments posted to this topic are about the item [B]We Need DevOps for Performance[/B]

Extended Properties

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

Executing Stored Procedure against a linked server

SQLServerCentral » Latest topics
Executing Stored Procedure against a linked server
Is it possible to run a stored procedure against Server B if the stored procedure only exists on Server  A?

I know it is possible if the stored procedure is setup on Server B but I am wondering is it possible if the stored procedure only exi

SQL server 2008 R2 frequent transaction log full and my database is a mirrored one.

SQLServerCentral » Latest topics
SQL server 2008 R2 frequent transaction log full and my database is a mirrored one.
I have 1 pair of identical server with SQL server 2008 R2 is installed.I have 2 databases in it which are mirrored.
Frequently I am facing disk full issue as the transaction logs gets full frequently. (with in 5 days it becomes 260 GB for 1 database).

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]

insert if record does not exists or if exists and column is not null criteria

SQLServerCentral » Latest topics
insert if record does not exists or if exists and column is not null criteria
I have a need to only insert Emp_Info into Emptbl if the Emp_Info doesn't already exist, or if the Emp_Info does exist AND has a value in the Emp_His column. I used below merge statement, but I get an error "An action of type 'INSERT' is not allowed in t

Certifying Schools

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

Automating Email Addresses

SQLServerCentral » Latest topics
Automating Email Addresses
Is there a way to automatically pull in Email addresses into SSRS instead of manually entering them in for each subscription?    IF not, does anyone know of another tool that will allow custom reporting and charting along with the ability to aut

Wednesday, November 29, 2017

Free eBook: Fundamentals of SQL Server 2012 Replication

SQLServerCentral.com Articles
Free eBook: Fundamentals of SQL Server 2012 Replication

Fundamentals of SQL Server 2012 Replication provides a hands-on introduction to SQL Server replication. The book introduces you to the technologies that make up replication, and then walks you through setting up different replication scenarios. When you've finished reading, you should be able to implement your own multi-server replication setup while following the principle of least privilege.

The Difference Between Rollup and Cube

SQLServerCentral » Latest topics
The Difference Between Rollup and Cube
Comments posted to this topic are about the item [B]The Difference Between Rollup and Cube[/B]

Certifying Schools

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

A User Database As A TempDB

SQLServerCentral » Latest topics
A User Database As A TempDB
I have a situation where a user database is being used as a psuedo tempdb, the database can be dropped and recreate without issue - it is used during imports of data in an ETL .

Two questions:
Similar to the actual temp db, would I benefit b

Unzip in ForEach loop

SQLServerCentral » Latest topics
Unzip in ForEach loop
Hi
I'm having problems parsing the correct expression for a Process Task

I'm attempting to use a ForEach loop to process a directory of zip files.

The aim is to extract the first zip file with 7zip, upload the contents into a db, pr

Comic for 2017.11.29

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

Question re: replication & initializing from backup

SQLServerCentral » Latest topics
Question re: replication & initializing from backup
So I had to rebuild a server that was subscriber using pull replication.  Currently I'm restoring the database on the subscriber form backup and it's a big one.  I know from previous recovery test that this will take about 5 hours.  Now I'm

Sharepoint online excel file

SQLServerCentral » Latest topics
Sharepoint online excel file
Hi,

1) I have an excel file that I have to read from and dump data into a sql server table (only the yellow highlighted portion) and get rid of the ones in blue.
How do I get only the information I am looking for ?

2) How to automati

Query Optimization Advice

SQLServerCentral » Latest topics
Query Optimization Advice

Hi All,

So I'm faced with the need to optimize a pretty hefty query, as it'

Add Column to Staging table

SQLServerCentral » Latest topics
Add Column to Staging table
Hi,

The code below used to work fine.
It is part of a stored procedure which bulk inserts data from a csv file.
Suddenly, after editing, I keep on getting an error stating that RowNr does not exis

Logon Trigger suddenly caused spike in query time

SQLServerCentral » Latest topics
Logon Trigger suddenly caused spike in query time
We have a logon trigger that has been on our server for a couple months now with no issue. It blocks login attempts from application accounts that are not from certain web servers using the host_name field in dm_exec_sessions. 

Yesterday aft

CheckDB error after DB restore

SQLServerCentral » Latest topics
CheckDB error after DB restore
Hi,

I got a strange problem, I am moving DBs from old test server(SQL Server 2008 R2 SP2) to new test server (SQL Server 2016 SP1-CU5), whereas no DB errors, found when I am running DBCC CHECKDB(Mydb) WITH PHYSICAL_ONLY, but after backup and rest

Choosing the Birthday of a Customer by month?

SQLServerCentral » Latest topics
Choosing the Birthday of a Customer by month?
[code language="sql"]CREATE TABLE birthdays(
 cust_id  INTEGER NOT NULL PRIMARY KEY
,cust_fname NVARCHAR(50) NOT NULL
,cust_lname NVARCHAR(50) NOT NULL
,cust_dob DATETIME NOT

SQL can't start . Please kindly help

SQLServerCentral » Latest topics
SQL can't start . Please kindly help
Hi All

I have a problem with my server , SQL can't start up.
when I check into error log :

2017-11-29 18:56:15.03 Server  SQL Server is starting at normal priority base (=7). This is an informational message only. No user a

Executing Stored Procedure against a linked server

SQLServerCentral » Latest topics
Executing Stored Procedure against a linked server
Is it possible to run a stored procedure against Server B if the stored procedure only exists on Server  A?

I know it is possible if the stored procedure is setup on Server B but I am wondering is it possible if the stored procedure only exi

SSIS Database with lots of space

SQLServerCentral » Latest topics
SSIS Database with lots of space

Dear all,

I have a SSIS DB in my SQL Server. This database currently uses more than 10 GB of data and I do not understand why. ^$

I think that we are not keeping a lot of history in SSIS and have the minimum logging level. For example

PASS SQL Saturday #687 Slovenia 2017 Last Call

SQLblog.com - The SQL Server blog spot on the web
PASS SQL Saturday #687 Slovenia 2017 Last Call

If you want to join the event and you are not registered yet, this is the time to register. We are nearly full, opening the wait list soon. You can find the link to the registration at the end of this post.

If you are already registered, one last appeal for you. If you already know that you will not be able to attend: please unregister and make room for those who would like to attend, but are on the waiting list. Use the Register Now button (direct link bellow), and if you are already registered, you should get an option to unregister.

(Un)Register

DBAs and the ITIL Framework, Part II: Asset Management

SQLServerCentral.com Articles
DBAs and the ITIL Framework, Part II: Asset Management

See how the ITIL Framework's Asset Management standards make the DBA's job easier. Use the CMDB and DML to keep your data assets under tight control.

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.

Tuesday, November 28, 2017

SSMS breakpoint won't add

SQLServerCentral » Latest topics
SSMS breakpoint won't add
I'm having an issue in SSMS 2014 where I'm trying to debug a sql script and everytime I try to add a breakpoint ssms becomes unresponsive and won't add the breakpoint. I then have to close ssms via  the task manager. Any recommendations on what could

http://www.argacademy.com/

SQLServerCentral » Latest topics
http://www.argacademy.com/
Ph.D Course In Guragon could be a Latin term that stands for ‘Philosophy Doctor’,&nb

http://www.espanasuplementos.es/votofel-force-espana/

SQLServerCentral » Latest topics
http://www.espanasuplementos.es/votofel-force-espana/
Votofel force:Mi concentración y nivel de fijación se actualizan y obtuve los orgasmos fortificados. Es la estrategia progresiva y nueva absolut

DMO Word Scramble

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

Transaction Isolation Level when Querying a View

SQLServerCentral » Latest topics
Transaction Isolation Level when Querying a View

I was hoping to get some confirmation on specific details regarding how SQL Server deals with queries involving a view which targets a different database (on the same instance of the server), with respect to transaction isolation level.

I have

Query taking more time

SQLServerCentral » Latest topics
Query taking more time
I have a Master table.This table contains two fields

Listings(Master Table)--------

TableID   EntityID
30047     100
30047     101
30047     102

Comic for 2017.11.28

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

Webinar 2.6 - Fragmentation

SQLblog.com - The SQL Server blog spot on the web
Webinar 2.6 - Fragmentation
Slides and scripts are now up from today's webinar. https://www.dbbest.com/blog/webinar-2-6-followup-episode-9-fragmentation/ Thanks to all who attended!...(read more)

Unzip in ForEach loop

SQLServerCentral » Latest topics
Unzip in ForEach loop
Hi
I'm having problems parsing the correct expression for a Process Task

I'm attempting to use a ForEach loop to process a directory of zip files.

The aim is to extract the first zip file with 7zip, upload the contents into a db, pr

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

MSSQL Schema Export Only

SQLServerCentral » Latest topics
MSSQL Schema Export Only
Is there an easy way to do schema only exports in mssql

Table Design

SQLServerCentral » Latest topics
Table Design

Dear Experts ,
Please share if there are any standard guidelines for designing the table objects , apart from Normalization , and Column domain values/ranges the data can accommodate max , the type of the column etc and yes the infrastructure  

The Most Wanted Upgrade

SQLServerCentral » Latest topics
The Most Wanted Upgrade
Comments posted to this topic are about the item [B]The Most Wanted Upgrade[/B]

Subquery vs join

SQLServerCentral » Latest topics
Subquery vs join
Hi All, 

We have a new junior developer who insists on looking up descriptions using Subqueries rather than joins.. 
Simple Example below... 

JOIN
SELECT a.AccountName, d.Amount, d.EntryDate, d.Tra

CheckDB error after DB restore

SQLServerCentral » Latest topics
CheckDB error after DB restore
Hi,

I got a strange problem, I am moving DBs from old test server(SQL Server 2008 R2 SP2) to new test server (SQL Server 2016 SP1-CU5), whereas no DB errors, found when I am running DBCC CHECKDB(Mydb) WITH PHYSICAL_ONLY, but after backup and rest

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

Strange Month number value in table of Dates

SQLServerCentral » Latest topics
Strange Month number value in table of Dates
I've been tasked with writing a script to populate a Dates table.  This contains a row for every date in the year, along with derived or implied data such as MonthNumber, MonthName, IsWorkingDay, WeekNumber etc.

All this is fine apart from o

How to create a dynamic project file connection

SQLServerCentral » Latest topics
How to create a dynamic project file connection
Hi,

I am creating a SSIS project that will consist of a parent package with a number of child packages.  The basic flow is this:
The parent package will use a for each loop to identify the name of t

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

Inserting hascode from QlikView into Table

SQLServerCentral » Latest topics
Inserting hascode from QlikView into Table
Hi,

i have hashcode in QlikView in txt file like:

[quote]A'--$Q>F7+O/"ZC.T(3#U,;[/quote]

I am trying insert this into table:


[c

Slow query - client or server issue

SQLServerCentral » Latest topics
Slow query - client or server issue
If seeing a client make a regular query that uses the same plan but completes in radically different times on alternate occasions.   Is there are a way to determine if the cause is from the server or client?
We see nothing on the SQL Server

Convert Date to Julian Date

SQLServerCentral » Latest topics
Convert Date to Julian Date
I need to convert a date type (2017-11-27 for example) to a Julian date.

I have seen several examples where the conversion goes in reverse....or solutions that do not match the Navy's conversion site

Check for existense of database master key in "all" databases

SQLServerCentral » Latest topics
Check for existense of database master key in "all" databases
Hi there,

I'm struggling with a little query here. I'm much more a DB admin than programmer, so I really got lots of stuff I do not know regarding building my own querys - sorry for that ;)
I got the appointment of checking several instances

The Nonsensical Count

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

Monday, November 27, 2017

The real origins of the Agile Manifesto

SQLServerCentral.com Articles
The real origins of the Agile Manifesto

Many people think the Agile Manifesto was born in in February 2001, when 17 people met at the Snowbird ski resort in Utah. But there’s a problem, a big problem - in fact, one about the size of the USA’s first ever jet fighter. In this blog post, Matt Hilbert looks back to 20th century aircraft design, and finds some very familiar ideas.

Choosing the Birthday of a Customer by month?

SQLServerCentral » Latest topics
Choosing the Birthday of a Customer by month?
[code language="sql"]CREATE TABLE birthdays(
 cust_id  INTEGER NOT NULL PRIMARY KEY
,cust_fname NVARCHAR(50) NOT NULL
,cust_lname NVARCHAR(50) NOT NULL
,cust_dob DATETIME NOT

The Nonsensical Count

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

We Need DevOps for Performance

SQLServerCentral » Latest topics
We Need DevOps for Performance
Comments posted to this topic are about the item [B]We Need DevOps for Performance[/B]

Slow running stored procedure

SQLServerCentral » Latest topics
Slow running stored procedure
I am using SQL server R2.
I have stored procedure which takes too much time to execute.
I have posted estimated plane here,
https://www.brentozar.com/pastetheplan/?id=rk6Z6MKxf

How to search songs_words table for songs that contain a group of words?

SQLServerCentral » Latest topics
How to search songs_words table for songs that contain a group of words?

Hello,  

I have an SQL database of of songs with a table that consists of 8 columns of information on words of a song. each row represents a single word from the songs lyrics:  

1. `son

Shrinking Transaction Log Files

SQLServerCentral » Latest topics
Shrinking Transaction Log Files
Hello Everyone,

My transaction log file grew extremely large and is taking up almost of the disk space. I am new to SQL and never have performed a shrink of the log file. Based on the image below can I just execute this withou

Convert Date to Julian Date

SQLServerCentral » Latest topics
Convert Date to Julian Date
I need to convert a date type (2017-11-27 for example) to a Julian date.

I have seen several examples where the conversion goes in reverse....or solutions that do not match the Navy's conversion site

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

FT should never run as a domain account?

SQLServerCentral » Latest topics
FT should never run as a domain account?
Hi:
Is there any restriction like why the Full Text Search should need to run using "NT Service\MSSQLFDLauncher" and not preferred to run using SQL Service accounts?







Sincere Request: Those

Comic for 2017.11.27

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

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

Start Fixing Your DB with Better Code

SQLServerCentral » Latest topics
Start Fixing Your DB with Better Code
Comments posted to this topic are about the item [B]Start Fixing Your DB with Better Code[/B]

Current Quarter

SQLServerCentral » Latest topics
Current Quarter
Hi Guys,
I am using the below which does the following.  Show the data for the current month  unless today's date is the 1st, then show last months data,  Is there a way to change this to do something similar but for the current and pre

Practice Until You Don't Get It Wrong

SQLServerCentral » Latest topics
Practice Until You Don't Get It Wrong
Comments posted to this topic are about the item [B]Practice Until You Don't Get It Wrong[/B]

The Most Wanted Upgrade

SQLServerCentral » Latest topics
The Most Wanted Upgrade
Comments posted to this topic are about the item [B]The Most Wanted Upgrade[/B]

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!

pass table param

SQLServerCentral » Latest topics
pass table param
How do you pass a table like this?
[code language="sql"];WITH TestTbl AS
(
    SELECT * FROM myTable
)

CREATE FUNCTION Ex( TestTbl TableType READONLY)
RETURNS VARCHA

Help with code to Grouping the text in multiple lines

SQLServerCentral » Latest topics
Help with code to Grouping the text in multiple lines
Hello everyone

I am a newcomer to the world of TSQL and was wondering if someone can help me with the following:

I have a simple code as below
[code language="sql"]
select *
from line

Sunday, November 26, 2017

SQL Clone Quick Tip: Offloading DBCC checks

SQLServerCentral.com Articles
SQL Clone Quick Tip: Offloading DBCC checks

If corruption creeps into a database it can and will derail the best-laid disaster recovery plans. To be certain that a database is corruption-free, you need to run regular DBCC CHECKDB checks on that database. Unfortunately this is a resource-intensive task, but SQL Clone can help.

The Most Wanted Upgrade

SQLServerCentral » Latest topics
The Most Wanted Upgrade
Comments posted to this topic are about the item [B]The Most Wanted Upgrade[/B]

SQL Jobs output file

SQLServerCentral » Latest topics
SQL Jobs output file
I have a schedule SQL jobs that run daily at 2 AM, i want the output file to be save individually with name and date example "File name 25-11-2017" on a daily basis meaning i want one file per day to be save in the folder. There are 2 option could be sele

http://www.buysupplementcanada.ca/bioderm-rx-canada/

SQLServerCentral » Latest topics
http://www.buysupplementcanada.ca/bioderm-rx-canada/
Bioderm rx:The second step is the Age Defy Cream that decreases wrinkles while reestablishing the face's splendor. Eye Renew is the stage 3 item,

The Most Wanted Upgrade

SQLServerCentral » Latest topics
The Most Wanted Upgrade
Comments posted to this topic are about the item [B]The Most Wanted Upgrade[/B]

Comic for 2017.11.26

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

monitor data changes

SQLServerCentral » Latest topics
monitor data changes
How do you return all the data changes made to a table (inserts, updates, deletes) the past 2 weeks including datetime and who made the changes?

Table Design

SQLServerCentral » Latest topics
Table Design

Dear Experts ,
Please share if there are any standard guidelines for designing the table objects , apart from Normalization , and Column domain values/ranges the data can accommodate max , the type of the column etc and yes the infrastructure  

Speed up query execution. Can we add an index or rewrite the query

SQLServerCentral » Latest topics
Speed up query execution. Can we add an index or rewrite the query
I've been working on this query handed to me by a developer who wanted to reduce the query execution time even further. Currently, it takes almost around 40 secs and outputs 262K records. Based on the actual execution the query cost is more towards the cl

Read TXT File - problem with importing from flat file source ssis

SQLServerCentral » Latest topics
Read TXT File - problem with importing from flat file source ssis
hi Guys,

I have txt file where i have 14 million rows from Qlikview and SAP exported.
Now i want to import in into SQL Server Database.

How to trace [256] Invalid query error

SQLServerCentral » Latest topics
How to trace [256] Invalid query error
Hell experts,

A developer is seeing an error like the following, and can't seem to pinpoint the errors in order to stop them.

I am having trouble creating a trace that captures either the error culprit itself, the error message being sen

Advice for starting up a new database consulting business?

SQLServerCentral » Latest topics
Advice for starting up a new database consulting business?
Hi all,

I'm in the process of putting together a business plan for a new database consulting business I want to start up with a friend of mine. Our goal is to help companies solve database-related problems. I've a fairly good amount of experience

Help with code to Grouping the text in multiple lines

SQLServerCentral » Latest topics
Help with code to Grouping the text in multiple lines
Hello everyone

I am a newcomer to the world of TSQL and was wondering if someone can help me with the following:

I have a simple code as below
[code language="sql"]
select *
from line

Practice Until You Don't Get It Wrong

SQLServerCentral » Latest topics
Practice Until You Don't Get It Wrong
Comments posted to this topic are about the item [B]Practice Until You Don't Get It Wrong[/B]

create a hierarchy table to remove records in one table which don't exist in another table

SQLServerCentral » Latest topics
create a hierarchy table to remove records in one table which don't exist in another table
CRM developer wants to create a hierarchy table to remove records in Service table that don't exist in Problem table (using column FKCase to detect this). That hierarchy table will then be available for BI developer to get the data from and inse

Unusually Expensive Deletes

SQLServerCentral » Latest topics
Unusually Expensive Deletes
Hi all,

I have a scenario on a few of our servers that I can't quite explain that I'm hoping someone can help me with. We have a Dynamics CRM system that we routinely need to delete single records out of. The problem is, deleting a single record

Search with Date Range

SQLServerCentral » Latest topics
Search with Date Range
Hello,

I have

[code language="sql"]create table #test_table ([Date] datetime, [KW] nvarchar(255),[PP] float, [PM] nvarchar(255), [CP] float,[Δ T] float, URL nvarchar(255) )


INSERT IN

Saturday, November 25, 2017

Start Fixing Your DB with Better Code

SQLServerCentral » Latest topics
Start Fixing Your DB with Better Code
Comments posted to this topic are about the item [B]Start Fixing Your DB with Better Code[/B]

VM Drive formatting

SQLServerCentral » Latest topics
VM Drive formatting
Hi ,
Is formatting a data drive to 64K cluster size still relevant in the virtual world?
Does it make any difference to performance?

I'm using sql 2016 on win 2012r2.
I have full rights on my VMWare SQL Guests, but currently no visibi

Speed up query execution. Can we add an index or rewrite the query

SQLServerCentral » Latest topics
Speed up query execution. Can we add an index or rewrite the query
I've been working on this query handed to me by a developer who wanted to reduce the query execution time even further. Currently, it takes almost around 40 secs and outputs 262K records. Based on the actual execution the query cost is more towards the cl

Availability Groups with Only Primary Replica

SQLServerCentral » Latest topics
Availability Groups with Only Primary Replica
Evening Guys,

We have availability groups in production. However on dev we have just single instance and single copies of the DB's. They can be rebuilt from scripts and backups and HA is not necessary in that environment.

However they ar

Unusually Expensive Deletes

SQLServerCentral » Latest topics
Unusually Expensive Deletes
Hi all,

I have a scenario on a few of our servers that I can't quite explain that I'm hoping someone can help me with. We have a Dynamics CRM system that we routinely need to delete single records out of. The problem is, deleting a single record

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

Start Fixing Your DB with Better Code

SQLServerCentral » Latest topics
Start Fixing Your DB with Better Code
Comments posted to this topic are about the item [B]Start Fixing Your DB with Better Code[/B]

MDS Database with 9GB

SQLServerCentral » Latest topics
MDS Database with 9GB
Dear All,

I have MDS configurated in our work environment. We have just some tables (50 tables) each with less that 50 records but the database keeps growing and it has now 9GB in size which does not make sense in terms of data that is realy stor

Show only records where a NULL exists across columns...

SQLServerCentral » Latest topics
Show only records where a NULL exists across columns...
Hi Team,

I'm struggling with the syntax of a WHERE statement to return only the records where a NULL exist within any column in my table.

Example below:

The Most Wanted Upgrade

SQLServerCentral » Latest topics
The Most Wanted Upgrade
Comments posted to this topic are about the item [B]The Most Wanted Upgrade[/B]

Speed up query execution. Can we add an index or rewrite the query

SQLServerCentral » Latest topics
Speed up query execution. Can we add an index or rewrite the query
I've been working on this query handed to me by a developer who wanted to reduce the query execution time even further. Currently, it takes almost around 40 secs and outputs 262K records. Based on the actual execution the query cost is more towards the cl

SQL Jobs output file

SQLServerCentral » Latest topics
SQL Jobs output file
I have a schedule SQL jobs that run daily at 2 AM, i want the output file to be save individually with name and date example "File name 25-11-2017" on a daily basis meaning i want one file per day to be save in the folder. There are 2 option could be sele

Friday, November 24, 2017

Comic for 2017.11.25

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

Read TXT File - problem with importing from flat file source ssis

SQLServerCentral » Latest topics
Read TXT File - problem with importing from flat file source ssis
hi Guys,

I have txt file where i have 14 million rows from Qlikview and SAP exported.
Now i want to import in into SQL Server Database.

SQL and XML

SQLServerCentral » Latest topics
SQL and XML
Hi everyone,
I'm a NooB at SQL XML creation so hoping you can help me out here.

I have a query like this:
[code language="sql"]
SET @AcuteCare = (       &nbs

A well-earned break from the database

SQLServerCentral » Latest topics
A well-earned break from the database
Comments posted to this topic are about the item [B]A well-earned break from the database[/B]

SQL Server Architecture in Azure

SQLServerCentral » Latest topics
SQL Server Architecture in Azure
Is it common to put all/ majority of SQL Servers in a resource group or have separate resource groups for each SQL Server.  (SQL Server on VM) 

I'm trying to determine if  Web/App servers should be in their own RG and the DB server

SQL Server 2016 Cumulative Updates (November 2017)

SQLblog.com - The SQL Server blog spot on the web
SQL Server 2016 Cumulative Updates (November 2017)

Microsoft has released the following Cumulative Updates for SQL Server 2016 (RTM and SP1).

Cumulative Update 9 for SQL Server 2016 RTM

KB 4037357 Download Build number: 13.0.2216.0 SQL Release Services Blog Post

Cumulative Update 6 for SQL Server 2016 SP1

KB 4037354 Download Build number: 13.0.4457.0 SQL Release Services Blog Post

Check for existense of database master key in "all" databases

SQLServerCentral » Latest topics
Check for existense of database master key in "all" databases
Hi there,

I'm struggling with a little query here. I'm much more a DB admin than programmer, so I really got lots of stuff I do not know regarding building my own querys - sorry for that ;)
I got the appointment of checking several instances

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

Choosing the Birthday of a Customer by month?

SQLServerCentral » Latest topics
Choosing the Birthday of a Customer by month?
[code language="sql"]CREATE TABLE birthdays(
 cust_id  INTEGER NOT NULL PRIMARY KEY
,cust_fname NVARCHAR(50) NOT NULL
,cust_lname NVARCHAR(50) NOT NULL
,cust_dob DATETIME NOT

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!

Read TXT File - problem with importing from flat file source ssis

SQLServerCentral » Latest topics
Read TXT File - problem with importing from flat file source ssis
hi Guys,

I have txt file where i have 14 million rows from Qlikview and SAP exported.
Now i want to import in into SQL Server Database.

Multiple Mid functions

SQLServerCentral » Latest topics
Multiple Mid functions
Hi,

Apologies is this query is too specific for this forum, please point me in the right direction if that's the case.

Below is an expression I am using to pull out the forename from a user ID i.e."text\[forename] [Surname]", at the mome

Does anyone use views in this way?

SQLServerCentral » Latest topics
Does anyone use views in this way?
Hi,

I know there are several cases where we as database developers need reference tables to help us with our querying (e.g., Tally tables, Calendar tables, etc.). Occasionally, I find myself needing other types of reference tables, sometimes ones

What entry should be in sys.servers for an AlwaysOn AG?

SQLServerCentral » Latest topics
What entry should be in sys.servers for an AlwaysOn AG?
Hi,

I've set up a test AlwaysOn AG environment.
I have 2 SQL Servers, SQL-PRI and SQL-SEC, and I have a listener name of SQL-LSNR

everything seems to work fine. I can manually failover the databases from one node to the other and bac

Index operations with max degree of parallelism value

SQLServerCentral » Latest topics
Index operations with max degree of parallelism value
Comments posted to this topic are about the item [B]Index operations with max degree of parallelism value[/B]

Comic for 2017.11.24

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

Thursday, November 23, 2017

Cleanly Uninstalling Stubborn SQL Server Components

SQLServerCentral.com Articles
Cleanly Uninstalling Stubborn SQL Server Components

There is a built-in command called msiexec which has an uninstall parameter (-x). This command can be used to remove stubborn programs through brute force. First, though, you need to get an inventory of the GUIDs that represent the programs you need to remove.

Good to have Multiple Data Warehouses?

SQLServerCentral » Latest topics
Good to have Multiple Data Warehouses?
Interesting debate came up on data warehousing. Is it good to have multiple data warehouses or just one? To add some context to avoid the ever, "it depends" answer. Let's say you have a data warehouse already built that supports a number of products th

Scheduling jobs in Azure SQL database - Azure automation or Elastic jobs for EXPORT and IMPORT of a table?

SQLServerCentral » Latest topics
Scheduling jobs in Azure SQL database - Azure automation or Elastic jobs for EXPORT and IMPORT of a table?
Have recently created a database in Azure SQL database and I'm quiet new to it. 

Requirement - Have to export a table from on premises server and import it on the virtual database hosted in Azure SQL database and automate th

The Most Wanted Upgrade

SQLServerCentral » Latest topics
The Most Wanted Upgrade
Comments posted to this topic are about the item [B]The Most Wanted Upgrade[/B]

The Pressure to Perform

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

Table Design

SQLServerCentral » Latest topics
Table Design

Dear Experts ,
Please share if there are any standard guidelines for designing the table objects , apart from Normalization , and Column domain values/ranges the data can accommodate max , the type of the column etc and yes the infrastructure  

AG Listener not working with OLAP Cubes \ Tabular Cubes \ Linked Server Connections

SQLServerCentral » Latest topics
AG Listener not working with OLAP Cubes \ Tabular Cubes \ Linked Server Connections
Greetings,

My team and I have been working for some time to establish Always-On Availability Groups in our production warehouse environments. We've successfully setup a 4 node WSFC with an Azure Witness Disk across our two physical data centers a

Visual Studio 2017 - Display Data Flow Rows

SQLServerCentral » Latest topics
Visual Studio 2017 - Display Data Flow Rows
Hi All,

Sorry if this is the wrong forum I'm nor sure where to post it. I am using Visual Studio 2013 Premium edition. In VS 2010 I used to be able see the number of rows the data flow task was using in each pipe. But VS2013 doesn't seem to do th

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

SQL server 2016 - Backup definition

SQLServerCentral » Latest topics
SQL server 2016 - Backup definition
Hello.

I have SQL server 2016 over a Windows server 2016 on Amazon web service,
I need to set up backup´s from all the database and the server.
For the database i use native backups but i need to define what kind of backup im going to do

Databases in Azure… Where to begin? Create a Database and log in!

SQLServerCentral » Latest topics
Databases in Azure… Where to begin? Create a Database and log in!
Comments posted to this topic are about the item [B]Databases in Azure… Where to begin? Create a Database and log in![/B]

Table Design

SQLServerCentral » Latest topics
Table Design

Dear Experts ,
Please share if there are any standard guidelines for designing the table objects , apart from Normalization , and Column domain values/ranges the data can accommodate max , the type of the column etc and yes the infrastructure  

SQL Server memory consumption is more

SQLServerCentral » Latest topics
SQL Server memory consumption is more
OBJECTSTORE_LOCK_MANGER is consuming more memory.  Any idea how to fix this? I have attached image for reference

Windows server Mmemory 32 GB
SQL Server Max Memory 28GB
Sql server is consuming 29 GB

Column Length

SQLServerCentral » Latest topics
Column Length

Dear All,
Question regarding the length of a column . As its understandable it has to be in accordance with the data that occupies the location ... does it have any impact on performance ? Since a table has to be read into the memory, does it

How to get Qty value?

SQLServerCentral » Latest topics
How to get Qty value?
Hi Friends,

I have table  two tables

desc table1
company_no varchar(10)
invoice_no varchar(20)
locn_no varchar(10)
model_ref varchar(20)
item_type  char(10)
item_code varchar(10)
QTY  varhcar(2

SSAS in Azure - process a "table"

SQLServerCentral » Latest topics
SSAS in Azure - process a "table"

Hi All,

For testing, we have created an SSAS tabular model and deployed it to SSAS in azure.

We have marked the model as

[Database Mirror] Client cannot be redirected to new principal db.

SQLServerCentral » Latest topics
[Database Mirror] Client cannot be redirected to new principal db.
Hi Experts

I have 3 sql servers in the architecture of database mirror(with a witness server). When I test failover, sql server works fine but
client (c#) cannot be redirected to new principal server after execut

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

ICQ No. : 722403840 Sell Cvv Good Fresh Sell Cvv Good Fresh Sell CVV all country us,uk,ca,au,eu,asia...Fresh=> Price cheap Hi everycustomer, i have shop CVV and site tool shop. i work prestige, professional If you need CVV please contact me for ICQ No. : 722403840 Gmail :...

SQLServerCentral » Latest topics
ICQ No. : 722403840 Sell Cvv Good Fresh Sell Cvv Good Fresh Sell CVV all country us,uk,ca,au,eu,asia...Fresh=> Price cheap Hi everycustomer, i have shop CVV and site tool shop. i work prestige, professional If you need CVV please contact me for ICQ No. : 722403840 Gmail :...
ICQ No. : 722403840 Sell Cvv Good Fresh
Sell Cvv Good Fresh
Sell CVV all country us,uk,ca,au,eu,asia...Fresh=> Price cheap
Hi everycustomer, i have shop CVV and site
tool shop.
i work prestige, professional
If you need CVV pleas

Wednesday, November 22, 2017

Free eBook: Inside the SQL Server Query Optimizer

SQLServerCentral.com Articles
Free eBook: Inside the SQL Server Query Optimizer

This free eBook from Redgate Software will take you from the fundamentals of Statistics, Cost Estimation, Index Selection, and the Execution Engine, and guide you through the inner workings of the Query Optimization process, and throws in a pragmatic look at Parameterization and Hints along the way.

Choosing the Birthday of a Customer by month?

SQLServerCentral » Latest topics
Choosing the Birthday of a Customer by month?
[code language="sql"]CREATE TABLE birthdays(
 cust_id  INTEGER NOT NULL PRIMARY KEY
,cust_fname NVARCHAR(50) NOT NULL
,cust_lname NVARCHAR(50) NOT NULL
,cust_dob DATETIME NOT

Game Day Planning

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

"Invalid column type from bcp client for colid xx."

SQLServerCentral » Latest topics
"Invalid column type from bcp client for colid xx."
Hello,

I have an issue with transferring some data from prod to uat, the two tables are identical. I first thought this might have something to do with a view that used the table, but having taken that out of the equation, I am still facing the s

Trggier not working with insert

SQLServerCentral » Latest topics
Trggier not working with insert
Hi,
I have an insert command saved to a table in a database "after insert" the trigger take the insert command and execute it. when the trigger

Table Design

SQLServerCentral » Latest topics
Table Design

Dear Experts ,
Please share if there are any standard guidelines for designing the table objects , apart from Normalization , and Column domain values/ranges the data can accommodate max , the type of the column etc and yes the infrastructure  

Better TSQL Performance

SQLServerCentral » Latest topics
Better TSQL Performance
Hi everyone, 

I am trying to improve query performance, I have encapsulated the following query into a stored procedure and have made some structural changes, added indices, etc (I an inherited a poorly designed db), but I feel I can do more

Backing up multiple SQL instance and databases using 3rd party software - Any recommendations

SQLServerCentral » Latest topics
Backing up multiple SQL instance and databases using 3rd party software - Any recommendations
Hello,

We are looking to have a centralized software management tool for backing up SQL Server databases that can also provide us with better backup and faster restore times  as compared to native SQL. Kindly, let me know if you have any rec

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

Choosing the Birthday of a Customer by month?

SQLServerCentral » Latest topics
Choosing the Birthday of a Customer by month?
[code language="sql"]CREATE TABLE birthdays(
 cust_id  INTEGER NOT NULL PRIMARY KEY
,cust_fname NVARCHAR(50) NOT NULL
,cust_lname NVARCHAR(50) NOT NULL
,cust_dob DATETIME NOT