Popular Posts

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

Saturday, September 30, 2017

Object Dependency

SQLServerCentral » Latest topics
Object Dependency
Hi All,
I am using SQL below to get the object dependency.
select Obj.name,dep.referenced_entity_name from sys.sql_modules as Module,sys.objects AS Obj ,sys.sql_expression_dependencies
as Dep ,sys.objects as DepObj
where obj.object_id=

Comic for 2017.09.30

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

Sales Order vs Warehouse Inventory Stock FIFO

SQLServerCentral » Latest topics
Sales Order vs Warehouse Inventory Stock FIFO
Dear All,

Table  1 is the sales order that received in each different day for inventory ID 1225 and 1496.  Table 2 is the warehouse store that available for each document. 

permission to write to output file by non-sa domain service account job owner

SQLServerCentral » Latest topics
permission to write to output file by non-sa domain service account job owner

page for review by the government is a gross

SQLServerCentral » Latest topics
page for review by the government is a gross
[url=https://livestream.com/ispot/events/7762481]Oregon vs California Live Stream[/url]

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!

How can this query be rewitten?

SQLServerCentral » Latest topics
How can this query be rewitten?
Hi Experts,

I have written a query based on our requirement using co-related sub-query.

Checking if this can re-written using a JOIN instead of co-related subquery? Mainly, 5th column in the SELECT list. How can we implement using a jo

Naming Conventions - Table and Column Names

SQLServerCentral » Latest topics
Naming Conventions - Table and Column Names
I'm pretty old school and I've always created tables and columns following a specified naming conventions that doesn't include spaces or underscores and uses camel case.  As I set out to design a new data mart that will be used primarily by non-tech

Adventure Five 1000pm

SQLServerCentral » Latest topics
Adventure Five 1000pm
[url=https://livestream.com/ispot/events/7761297]Notre Dame vs Miami (OH) Live Streaming[/url]

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!

Setting Containment

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

Delightful Database Diversion

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

Since looping is bad, how should I accomplish what I am trying to do?

SQLServerCentral » Latest topics
Since looping is bad, how should I accomplish what I am trying to do?

In order to widen participation, and reduce

SQLServerCentral » Latest topics
In order to widen participation, and reduce
[url=https://sanangelolive.com/community/classifieds/ausa-wallabies-vs-springboks-live-stream-rugby-online-preview-30-sept-2017]Wallabies vs Springboks Live Streaming[/url]

Best Practice to Write a View for 3rd Parties

SQLServerCentral » Latest topics
Best Practice to Write a View for 3rd Parties
We have a fees table, which we shall now share with other departments, meaning they should only be able to query the fees.

Until recently I would simply write
CREATE VIEW fees_view
AS
SELECT fees_Id, fees_Description
FROM myFees

deleting duplicate rows based on a condition

SQLServerCentral » Latest topics
deleting duplicate rows based on a condition
I've cobbled together other answers from similar posts but can't quite get over the finish line.
I'm trying to remove duplicate records. With the definition of "duplicate" being all fields except for one particular field.
The duplicate rows to del

Return parents for children with certain condition

SQLServerCentral » Latest topics
Return parents for children with certain condition
Ok, so here is my sample data I am testing against...

declare @t table (
  Id  int ,
  Section int,
  DateOccured DATE,
    Missed int
);

insert into @t values

Sales Order vs Warehouse Inventory Stock FIFO

SQLServerCentral » Latest topics
Sales Order vs Warehouse Inventory Stock FIFO
Dear All,

Table  1 is the sales order that received in each different day for inventory ID 1225 and 1496.  Table 2 is the warehouse store that available for each document. 

SharePoint permissions for DBA

SQLServerCentral » Latest topics
SharePoint permissions for DBA
Does anyone have any guidelines or best practices regarding SharePoint admins access level to the SQL Server? I looking at more individual admin not SharePoint service accounts.

The Worms-eye View

SQLServerCentral » Latest topics
The Worms-eye View
Comments posted to this topic are about the item [B]The Worms-eye View[/B]

Friday, September 29, 2017

Since looping is bad, how should I accomplish what I am trying to do?

SQLServerCentral » Latest topics
Since looping is bad, how should I accomplish what I am trying to do?

http://www.healthyprovenow.com/garcinia-cambogia-bioactive/

SQLServerCentral » Latest topics
http://www.healthyprovenow.com/garcinia-cambogia-bioactive/
Garcinia Cambogia Bioactive is noodzakelijk om de meeste van je calorieën te herinneren in de vroegere elementen van je dag dus

Naming Conventions - Table and Column Names

SQLServerCentral » Latest topics
Naming Conventions - Table and Column Names
I'm pretty old school and I've always created tables and columns following a specified naming conventions that doesn't include spaces or underscores and uses camel case.  As I set out to design a new data mart that will be used primarily by non-tech

3 Things I Wish I Knew When I Started Using Entity Framework

SQLServerCentral » Latest topics
3 Things I Wish I Knew When I Started Using Entity Framework
Comments posted to this topic are about the item [B]3 Things I Wish I Knew When I Started Using Entity Framework[/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!

Naming Conventions - Table and Column Names

SQLServerCentral » Latest topics
Naming Conventions - Table and Column Names
I'm pretty old school and I've always created tables and columns following a specified naming conventions that doesn't include spaces or underscores and uses camel case.  As I set out to design a new data mart that will be used primarily by non-tech

Large SQL server under utilizing memory

SQLServerCentral » Latest topics
Large SQL server under utilizing memory
We have a large SQL cluster that is in use but not performing well. I am not a DBA, but I am trying to get some insight into what the problems might be. The server is a Clustered Cisco C-Series, with 256GB of Ram and is connected to All Flash SAN for stor

Code-first vs database-first, any new developments?

SQLServerCentral » Latest topics
Code-first vs database-first, any new developments?
I'm discussing this topic with a developer, and I'm also performing due diligence and looking for other opinions on the internet. I'm finding quite a bit of information, and it's tough to tell how much more mature Code First (using the Entity Fr

SSMS for Linux

SQLServerCentral » Latest topics
SSMS for Linux
I can't find information on the Web about whether Microsoft plans to develop an SSMS for Linux.  Do you have information about it ?

New Servicing Model for SQL Server

SQLblog.com - The SQL Server blog spot on the web
New Servicing Model for SQL Server
  Microsoft just announced a new serving model for SQL Server starting with SQL 2017. The link below goes into much more detail so I won’t duplicate that here. However in a nutshell this means that there will be no more service packs, only CU’s (Cumulative Updates) and GDR’s (General Distribution Release).  A GDR contains only security fixes where as a CU has has all the goodies to keep SQL Server up to date in terms of features, bug fixes and security. What I like about it is that for...(read more)

Since looping is bad, how should I accomplish what I am trying to do?

SQLServerCentral » Latest topics
Since looping is bad, how should I accomplish what I am trying to do?

Run password changes on multiple servers within central management server

SQLServerCentral » Latest topics
Run password changes on multiple servers within central management server
Hi 

I have a large sql instance estate with all instances registered withing a central management server.

I would like to update a coupe of hundred passwords for different sql logins on different sql instances.  

Apar

?? on Finding records with caharacters before and after in a string??

SQLServerCentral » Latest topics
?? on Finding records with caharacters before and after in a string??
Hi

Looking to find record that contain characters berfore and after and ignore the ones in the middle.

For example

Here are two records
 looking to pickup anything that contains '1NNNNNN202'
where I only want to loo

Logical Query Processing Filters

SQLServerCentral » Latest topics
Logical Query Processing Filters
Comments posted to this topic are about the item [B]Logical Query Processing Filters[/B]

Alter Table....Add Column

SQLServerCentral » Latest topics
Alter Table....Add Column

Hey  Folks,
Question about alter table. When we add a column(with/without some default values) to an existing table , does SQL accommodate the space in the last available pages of the database or does it cause page splits and fill them im

A New New World

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

Memory Optimization advisor (Next button is greyed out)

SQLServerCentral » Latest topics
Memory Optimization advisor (Next button is greyed out)


Cre

Visual Studio Data Tools 2017 - TFS lock icons missing and other issues

SQLServerCentral » Latest topics
Visual Studio Data Tools 2017 - TFS lock icons missing and other issues
Hi all

We've just installed a test instance of Microsoft SQL Server Data Tools for Visual Studio 2017 (Version 15.3.5) and come across a few bugs.
I've had a Google and I can't see a solution as yet.

Hoping someone on here can shed s

Database get faster after restart sql service

SQLServerCentral » Latest topics
Database get faster after restart sql service
any reason for this? After restart it take 1 day for used all memory that fixed (128GB)
every query running very fast about 1 week and then becoming slow with the same routine of database working and more slower for each day (higher waiting time to w

Comic for 2017.09.29

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

Thursday, September 28, 2017

Free eBook: SQL Server Execution Plans, Second Edition

SQLServerCentral.com Articles
Free eBook: SQL Server Execution Plans, Second Edition

Every day, out in the various online forums devoted to SQL Server, and on Twitter, the same types of questions come up repeatedly: Why is this query running slowly? Why is SQL Server ignoring my index? Why does this query run quickly sometimes and slowly at others? My response is the same in each case: have you looked at the execution plan?

Window Function Lag() - No previous Value when 1 row.

SQLServerCentral » Latest topics
Window Function Lag() - No previous Value when 1 row.
Hi,

LAG function gives us value which was encountered in previous line.
There is no lag value available for 1 row, and 0 (zero) is returned. Is it possible/Is there a way to return the current value (instead of previous) in this case?

A New New World

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

We Have a Date

SQLServerCentral » Latest topics
We Have a Date
Comments posted to this topic are about the item [B]We Have a Date[/B]

How to get a "Cumulative" weely report?

SQLServerCentral » Latest topics
How to get a "Cumulative" weely report?
My task is to get a cumulative weekly status report, for a period of time, i.e. last 12-month. The source data looks like below:
ProductId    Status    UpdatedOn
264525    Initiated 

Logical Query Processing Filters

SQLServerCentral » Latest topics
Logical Query Processing Filters
Comments posted to this topic are about the item [B]Logical Query Processing Filters[/B]

SSAS Tabular Filtering displayed recordset

SQLServerCentral » Latest topics
SSAS Tabular Filtering displayed recordset

I'm working with a tabular model in SSDT, just wanting to filter a currency column > $0

The only filter options I have are "is equal to" or "is not equal to".  I can choose other options in the drop down, but I only actually get these

We Have a Date

SQLServerCentral » Latest topics
We Have a Date
Comments posted to this topic are about the item [B]We Have a Date[/B]

Large SQL server under utilizing memory

SQLServerCentral » Latest topics
Large SQL server under utilizing memory
We have a large SQL cluster that is in use but not performing well. I am not a DBA, but I am trying to get some insight into what the problems might be. The server is a Clustered Cisco C-Series, with 256GB of Ram and is connected to All Flash SAN for stor

SQL Server 2017

SQLServerCentral » Latest topics
SQL Server 2017

Have SQL server 2017 officially released or not?
From Microsoft site, I can see there is SQL server 2017, but not sure if it is officially realeased or not?
Any way I can know that?


Thanks

Hash index on memory-optimized table

SQLServerCentral » Latest topics
Hash index on memory-optimized table
I have a memory optimized table where I currently have a hash index on two columns.  Most of my queries have in the join or where clause the two columns and only the two columns.  I have a few queries where there's a third column in the join cla

We Have a Date

SQLServerCentral » Latest topics
We Have a Date
Comments posted to this topic are about the item [B]We Have a Date[/B]

Comic for 2017.09.27

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

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

saving variable from a stored proc

SQLServerCentral » Latest topics
saving variable from a stored proc
Is it possible to replicate this code from a stored procedure in a SSRS dataset?

exec @dtEffective = dbo.selUpdEnv 'PrevBusDt','=',@cdUser,'N'

What I'm trying to do is save the effective date in a variable and display the date in a textb

Comic for September 23, 2017

RSSMix.com Mix ID 8239024
Comic for September 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.

We Have a Date

SQLServerCentral » Latest topics
We Have a Date
Comments posted to this topic are about the item [B]We Have a Date[/B]

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

An exercise in query optimisation.....

SQLServerCentral » Latest topics
An exercise in query optimisation.....
Hi all,

I am starting to work in an environment where database DevOps plays a very important role and I am boning up on a few things to prepare myself.

Does anyone know of any sites with prepared "bad" queries (intentionally bad or other

Restore database from BLOB Storage failure - Operating System Error 13

SQLServerCentral » Latest topics
Restore database from BLOB Storage failure - Operating System Error 13
Hi All,

I am trying to restore a database from BLOB storage and getting the below error,

From: Application Logs
SQLVDI: Loc=TriggerAbort. Desc=invoked. ErrorCode=(0). Process=1972. Thread=3344. Server. Instance=MSSQLSERVER. VD=Global

Flat File Connection Manager

SQLServerCentral » Latest topics
Flat File Connection Manager
Hi,

I have a file directory path were I get a csv file per day, with current date. I have set up Flat File Connection manager that uses expression to access that location. When I execute I get an error that it cannot open datafile.

The p

Dynamically create table with full structure

SQLServerCentral » Latest topics
Dynamically create table with full structure
Hello All,
I have a large table "LARGETable" and till now my developers created a job that run every 2 minutes and delete records if the date is older than 2 months.
Of course it  cause many locks.

Thus, I renamed the table name

XML Element Attribute Data Issues

SQLServerCentral » Latest topics
XML Element Attribute Data Issues
Greetings,
I have an XML document I am trying to parse and load into my SQL 2012 database that is generated by another product. There are some elements that have what looks like HTML code bits inside the double quotes.
Example:

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

Help from Cortana

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

Naming Conventions - Table and Column Names

SQLServerCentral » Latest topics
Naming Conventions - Table and Column Names
I'm pretty old school and I've always created tables and columns following a specified naming conventions that doesn't include spaces or underscores and uses camel case.  As I set out to design a new data mart that will be used primarily by non-tech

Wednesday, September 27, 2017

Moving beyond principal components analysis

SQLServerCentral.com Articles
Moving beyond principal components analysis

Principal components analysis is a standard, but usually terrible, technique for visualising complex data. We're using network diagrams to solve this problem.

The Problems with Gods

SQLServerCentral » Latest topics
The Problems with Gods
Comments posted to this topic are about the item [B]The Problems with Gods[/B]

The Instance ID MSSQLSERVER Is Already In Use

SQLServerCentral » Latest topics
The Instance ID MSSQLSERVER Is Already In Use
Comments posted to this topic are about the item [B]The Instance ID MSSQLSERVER Is Already In Use[/B]

Is CDC - Change Data capture has any retention limit ? Can we setup for long period?

SQLServerCentral » Latest topics
Is CDC - Change Data capture has any retention limit ? Can we setup for long period?
SQL SERVER 2012 - Change Data Capture feature has any limitation on Retention limit. Please suggest the good article to understand more on these features...

Regards,
Ram

Always Encrypted Permissions

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

We Have a Date

SQLServerCentral » Latest topics
We Have a Date
Comments posted to this topic are about the item [B]We Have a Date[/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!

I'm Leaving on a Jet Plane

SQLblog.com - The SQL Server blog spot on the web
I'm Leaving on a Jet Plane
I'm taking off tomorrow for Holland, UK, Denmark, Germany and Israel: https://www.dbbest.com/blog/im-leaving-jet-plane/#more-11622 You can read the post from DB Best, linked to above, or follow individual links to my public events from here: September 30: SQL Saturday Holland October 5: Getting the most out of the SQL Server Engine on Prem and in the Cloud Reading, UK This is a free, full day workshop on some of the new features of SQL Server 2016 and 2016. The workshop includes hands-on labs and...(read more)

Reset SA password

SQLServerCentral » Latest topics
Reset SA password
Hi,

I have RDP access to windows server but i doesn't have access to SQL instance.
I doesn't have SA password.
How to connect to sql instance(SSMS) ?
How to reset the SA pasword ?

Thank you !!

Naming Conventions - Table and Column Names

SQLServerCentral » Latest topics
Naming Conventions - Table and Column Names
I'm pretty old school and I've always created tables and columns following a specified naming conventions that doesn't include spaces or underscores and uses camel case.  As I set out to design a new data mart that will be used primarily by non-tech

Hash index on memory-optimized table

SQLServerCentral » Latest topics
Hash index on memory-optimized table
I have a memory optimized table where I currently have a hash index on two columns.  Most of my queries have in the join or where clause the two columns and only the two columns.  I have a few queries where there's a third column in the join cla

How to delete clear space on the drive that DB's and Cubes are being backuped up to?

SQLServerCentral » Latest topics
How to delete clear space on the drive that DB's and Cubes are being backuped up to?
Hello, Is there something in SSMS that I can use to clean up the backup directories? Like the way I can use Management in SSMS to clear our lag files? Its the drive that hold the DB and SSAS backups that overfull, and I dont want to delete with File Explo

Import question

SQLServerCentral » Latest topics
Import question
I am importing data from a 3rd party system into a DB that I am going to use for reporting.  I want to import the UserID from the user column, and populate the record with the Date of the column with a date (into the Date field) in the row contains a

Insert fails when trying to create a table.

SQLServerCentral » Latest topics
Insert fails when trying to create a table.
[code language="sql"]

Script to Clean up Trace Files?

SQLServerCentral » Latest topics
Script to Clean up Trace Files?
Does anybody have an already packaged method to clean up trace files that have reached a size threshold?  I have a trace set to use 2 roll over files and do a max of 500 megs per file.  However, once the files fill up, the trace is turning itsel

Naming Conventions - Table and Column Names

SQLServerCentral » Latest topics
Naming Conventions - Table and Column Names
I'm pretty old school and I've always created tables and columns following a specified naming conventions that doesn't include spaces or underscores and uses camel case.  As I set out to design a new data mart that will be used primarily by non-tech

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

XP_CMDSHELL fails execution

SQLServerCentral » Latest topics
XP_CMDSHELL fails execution
Hi All, Got a SQL Server 2005 problem whereby we get the following error: ExecuteDTS (X import):[Microsoft] [ODBC SQL Server Driver] [SQL Server] An error occurred during the execution of xp_cmdshell. A call to 'LogonUserW' failed with error code:

Stairway to Advanced T-SQL Level 9: Compare, Modify, Derive and Validate Date and Time Values

SQLServerCentral » Latest topics
Stairway to Advanced T-SQL Level 9: Compare, Modify, Derive and Validate Date and Time Values

Automate Table Field Names In Query

SQLServerCentral » Latest topics
Automate Table Field Names In Query

Not sure if this is possible.  I have

How to find the year to date value for a given date

SQLServerCentral » Latest topics
How to find the year to date value for a given date
I want to write a query to calculate the year to date value for a given date:
Example: If the given orderdate is 9/18/2015,
I want the year to date range to be between 1/1/15 - 9/18/15. 
I am writing a query where it is filtered by OrderD

How to add a COUNT value against unique name returns

SQLServerCentral » Latest topics
How to add a COUNT value against unique name returns
Hi all,

My first post in this forum and I am hoping someone here can help!

I am trying to write in a calculation into a script that has the total count of Employees in a Store in a separate column, but have that counted number appe

MCSA 2016 Database Administration

SQLServerCentral » Latest topics
MCSA 2016 Database Administration
Apparently, the MCSA 2016 Database Administration certification does NOT have a "Querying Data with Transact-SQL" (Exam 761) exam as a requirement ?  That is unlike the MCSA 2012/2014 which did have a "Querying SQL Server" (Exam 461) requirement.

Trim off trailing letters

SQLServerCentral » Latest topics
Trim off trailing letters
Hi all,

I need to trim off whichever letters are at the end of a reference number.

Example: If the reference number is ABC/12345A or ABC/12345ABBBBC or ABC/12345WRBV , it should be left with only ABC/12345.
Thank you in advance!

Comic for 2017.09.27

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

Using Code Snippets in SSMS

SQLServerCentral » Latest topics
Using Code Snippets in SSMS
Comments posted to this topic are about the item [B]Using Code Snippets in SSMS[/B]

Tuesday, September 26, 2017

My favorite sql database

SQLServerCentral » Latest topics
My favorite sql database
Our small company uses SQL Server 2008 during some years. Only some days ago we stumbled on a serious issue. Our general sql databases stopped showing data or information disappeared. We tried to apply backup, but

How to Drop All Your Indexes – Fast

SQLServerCentral.com Articles
How to Drop All Your Indexes – Fast

You probably shouldn't be doing this, but if you need to, Brent Ozar has a script for that.

SSIS Variable Expressions

SQLServerCentral » Latest topics
SSIS Variable Expressions
I created a transfer database task...I want to use a variable I created "InDatabase" as the database name for my source database. How do I link the variable to the property for SOURCEDATABASENAME? I entered User::Indatabase, but when I ran the job I got a

Trim off trailing letters

SQLServerCentral » Latest topics
Trim off trailing letters
Hi all,

I need to trim off whichever letters are at the end of a reference number.

Example: If the reference number is ABC/12345A or ABC/12345ABBBBC or ABC/12345WRBV , it should be left with only ABC/12345.
Thank you in advance!

Delightful Database Diversion

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

How the rowversion datatype works when adding and deleting columns

SQLblog.com - The SQL Server blog spot on the web
How the rowversion datatype works when adding and deleting columns
For years, I had thought (and was probably taught in SQL.AlongTimeAgoInAPlaceFarFarAway) that the timestamp column (well before rowversion was a thing,) was not guaranteed to be an ever increasing value. But this is not the case. In BOL ( https://docs.microsoft.com/en-us/sql/t-sql/data-types/rowversion-transact-sql )  it states:       "The rowversion data type is just an incrementing number..." This makes it useful for determining rows that have changed,...(read more)

Reading a CSV

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

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

Faster way to release the Unused Space back to Disk

SQLServerCentral » Latest topics
Faster way to release the Unused Space back to Disk
Hi, I have few databases that have 8 data files allocated with 300 GB each and used only 110 - 120 GB each. So, I wanted to release the unused space back to the disk so that other databases can use the space. I'm using DBCC Shrinkfile option and its

SQL Server Audit - How to track sysadmin activity involving SQL Agent and SQL Agent jobs?

SQLServerCentral » Latest topics
SQL Server Audit - How to track sysadmin activity involving SQL Agent and SQL Agent jobs?

Recursive Function to remove rows from Parent and Child Tables

SQLServerCentral » Latest topics
Recursive Function to remove rows from Parent and Child Tables
I have a database that needs to have inactive companies removed along with all of the related child records that relate.
I have identified all of the Parent/Child relationships that are involved, but was wondering if anyone had a function/script
t

SSIS package shows successful but not working

SQLServerCentral » Latest topics
SSIS package shows successful but not working
I have an SSIS package that was executing successfully for some time but last week started erroring.  The error on the SQL Agent Job was "Access to the path is denied."  Nothing has changed to any folder permissions.  I opened the package t

SSIS - scripts get deleted by deploy process

SQLServerCentral » Latest topics
SSIS - scripts get deleted by deploy process
Hi there

I'm pulling my hair out with SSIS deploy problems! The problem is as follows: If I deploy a SSIS package containing C# scripts, the scripts get deployed as blank script templates and none of my C# code exists on the server.  The scr

Comic for 2017.09.26

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

My favorite sql database

SQLServerCentral » Latest topics
My favorite sql database
Our small company uses SQL Server 2008 during some years. Only some days ago we stumbled on a serious issue. Our general sql databases stopped showing data or information disappeared. We tried to apply backup, but

Compressing Integers

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

Comic for September 21, 2017

RSSMix.com Mix ID 8239024
Comic for September 21, 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.

Restore log file fails 3117

SQLServerCentral » Latest topics
Restore log file fails 3117
Thanks to GilaMonster I was able to recover a database thought lost. The method of hack attaching the database worked.

I am now trying to restore the log file (trn) and am getting a 3117 error:

Msg 3117, Level 16, State 1, Line 1
The

SSIS - scripts get deleted by deploy process

SQLServerCentral » Latest topics
SSIS - scripts get deleted by deploy process
Hi there

I'm pulling my hair out with SSIS deploy problems! The problem is as follows: If I deploy a SSIS package containing C# scripts, the scripts get deployed as blank script templates and none of my C# code exists on the server.  The scr

Azure Data Factory and SSIS better together with ADF V2 Preview

SQLblog.com - The SQL Server blog spot on the web
Azure Data Factory and SSIS better together with ADF V2 Preview

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

Restore database from BLOB Storage failure - Operating System Error 13

SQLServerCentral » Latest topics
Restore database from BLOB Storage failure - Operating System Error 13
Hi All,

I am trying to restore a database from BLOB storage and getting the below error,

From: Application Logs
SQLVDI: Loc=TriggerAbort. Desc=invoked. ErrorCode=(0). Process=1972. Thread=3344. Server. Instance=MSSQLSERVER. VD=Global

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!

sleeping SPIDs consume CPU and memory ?

SQLServerCentral » Latest topics
sleeping SPIDs consume CPU and memory ?
Good Morning Experts,
Do the sleeping SPIDs consume CPU and memory while they are in sleeping state?

Memory Optimization advisor (Next button is greyed out)

SQLServerCentral » Latest topics
Memory Optimization advisor (Next button is greyed out)


Cre

Comic for 2017.09.26

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

Error 2812 : Unable to create new login or resest login password

SQLServerCentral » Latest topics
Error 2812 : Unable to create new login or resest login password
Hello Experts,

I physically moved My M.S. SQL Server 2000 from one location to another location (like Delhi to Chandigarh) and also changed IP. Now my application is working fine in my local or remote network with existing users and their passwor

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

Entire Database Encryption

SQLServerCentral » Latest topics
Entire Database Encryption
Dear Experts,

My requirement is to encrypt entire database.
Even DBA does not view data from the database(Not talking about column level encryption). Use private key from HSM to view data from database.
Only application can access data w

Monday, September 25, 2017

SQL Server R Services: Digging into the R Language

SQLServerCentral.com Articles
SQL Server R Services: Digging into the R Language

It is not just the analytic power of R that you get from using SQL Server R Services, but also the great range of packages that can be run in R that provide a daunting range of graphing and plotting facilities. Robert Sheldon shows how you can take data held in SQL Server and, via SQL Server R Services, use an R package called ggPlot that offers a powerful graphics language for creating elegant and complex plots.

Compressing Integers

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

Log Shipment Alert

SQLServerCentral » Latest topics
Log Shipment Alert
Hi There,

Can someone guide me on creating a consolidated Alert job or alert messages in which the process of Log shipment like (Copy and Restore to the Secondary Server from Primary Server) to the concern stakeholders.?

Regards
Adil

SSIS - scripts get deleted by deploy process

SQLServerCentral » Latest topics
SSIS - scripts get deleted by deploy process
Hi there

I'm pulling my hair out with SSIS deploy problems! The problem is as follows: If I deploy a SSIS package containing C# scripts, the scripts get deployed as blank script templates and none of my C# code exists on the server.  The scr

Powershell to get Results and Messages in SSMS inquiry

SQLServerCentral » Latest topics
Powershell to get Results and Messages in SSMS inquiry
I have a powershell script that will execute a query on a database that has Replication.

[code language="c#"]$QueryPath = "C:\Replication\RepAsPub.sql"
$OutputF

The Problems with Gods

SQLServerCentral » Latest topics
The Problems with Gods
Comments posted to this topic are about the item [B]The Problems with Gods[/B]

Comic for 2017.09.25

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

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!

Log Shipping LSN in backup too recent to apply

SQLServerCentral » Latest topics
Log Shipping LSN in backup too recent to apply
Hi Log shipping had been working fine.  Now on all DBs I have a similar error after power outage. Message: *** Error: The log in this backup set begins at LSN 193489000090302900001, which is too recent to apply to the database. An earlier log backup

son Rod and The Wrath

SQLServerCentral » Latest topics
son Rod and The Wrath
[url=https://www.facebook.com/events/282376098945998/]Cowboys vs Cardinals Live Stream[/url]

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

RESOURCE_SEMAPHORE_QUERY_COMPILE Waits

SQLServerCentral » Latest topics
RESOURCE_SEMAPHORE_QUERY_COMPILE Waits

Hi All :),

I wonder if anyone can shed some light on the following issue I experienced earlier today.

All users reported the applications were either slow, unresponsi

How to encrypt Credit Card numbers?

SQLServerCentral » Latest topics
How to encrypt Credit Card numbers?
We have now finally moved all our customers to SQL 2014 from old or very old SQL versions and I have been given a task to enquire how to encrypt credit card numbers in the database.
Before I will start Google, thought to ask first people here what are

Occasional mysterious time outs on SQL Server db table

SQLServerCentral » Latest topics
Occasional mysterious time outs on SQL Server db table
Hi there,

We have users in the field who use a mobile web GIS application (using Java) which use forms to edit/update spatial data.
There is one particular table that occasionally locks up for hours and nobody can edit or insert eit

Hierarchy in a Fact table - Referring to itself

SQLServerCentral » Latest topics
Hierarchy in a Fact table - Referring to itself
Hello,

Using SQL Server 2016, VS2015

I have a very complex hierarchy in a Fact.
My client is managing investment funds and lot of different instrument types.
So, each instrument in the fact can be related to multiple parents, and

Query running slow across linked server

SQLServerCentral » Latest topics
Query running slow across linked server
Hi all

Firstly, apologies for the lengthy post, but I'm trying to get everything in I thought would be useful.

I've got a query and I need to use a linked server to get the data I need.

The query looks like this:-

sp_send_dbmail HTML with status update

SQLServerCentral » Latest topics
sp_send_dbmail HTML with status update
Hi I'm working on a project that involves sending mails to people to update them about progress made.
The thing is that I have to do it with like arrow sign posts progress bar, something like on the picture bellow

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!

TSQL Query help plz..

SQLServerCentral » Latest topics
TSQL Query help plz..
Hi All,

Need tsql help please. Below is the sample schema/tables and description is written at the end(my requirement).

use master
go
create database banking
go

use banking
go

create table BankBran

Replication job error once server rebootes

SQLServerCentral » Latest topics
Replication job error once server rebootes
Hello
I am facing an issue after rebooting the replication server while executing the job of replication i.e 

Started: 10:23:00 AM
Error: 2017-09-25 10:23:14.84
 Code: 0xC0202009
 Source: Replicate cdr_main Inserti

Installing SQL Server 2016 Fail-over Cluster

SQLServerCentral » Latest topics
Installing SQL Server 2016 Fail-over Cluster

Hi,

We have 2 node fail-over cluster of SQL Server 2012 in our production environment.  

Now we need to install 2 node fail-over cluster of SQL Server 2016.

In 2012 fail-over cluster we needed

Run password changes on multiple servers within central management server

SQLServerCentral » Latest topics
Run password changes on multiple servers within central management server
Hi 

I have a large sql instance estate with all instances registered withing a central management server.

I would like to update a coupe of hundred passwords for different sql logins on different sql instances.  

Apar

Can't Shrink TEMPDB

SQLServerCentral » Latest topics
Can't Shrink TEMPDB
Hi All,

I am getting an odd error when trying to shrink tempdb a little bit

DBCC SHRINKFILE: Page 7:2275824 could not be moved because it is a work table page.

I;ve  isolated the table and dropped it, and instantly the erro

Sunday, September 24, 2017

sp_AllNightLog: Creating Jobs Like I’m The President

SQLServerCentral.com Articles
sp_AllNightLog: Creating Jobs Like I’m The President

Erik Darling explains why sp_AllNightLog creates so many jobs by default.

The permissions granted to user IIS APPPOOLAmazonWorld are insufficient for performing this operation

SQLServerCentral » Latest topics
The permissions granted to user IIS APPPOOLAmazonWorld are insufficient for performing this operation
Dear All,

I have created a webapplication where I needed to run some report. I have created my reports successfully on SSRS and now I want to run them
in my application. But, when I created C# code and then tried to run these reports the sys

When sp_HelpText is not so helpful!

SQLServerCentral » Latest topics
When sp_HelpText is not so helpful!
Comments posted to this topic are about the item [B]When sp_HelpText is not so helpful![/B]

Comic for 2017.09.24

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

IP adrsss for my SQL server

SQLServerCentral » Latest topics
IP adrsss for my SQL server
Hi all!

I have tried both Google and seach on this page first...

I have a  SQL 2012 server, where one of the DB'a are  used for a  web server.

I have a static IP adress 'Outside' on my netgear Router.

Now

Washington Redskins vs. Oakland Raiders odds: Picks from expert with 5 straight Redskins wins

SQLServerCentral » Latest topics
Washington Redskins vs. Oakland Raiders odds: Picks from expert with 5 straight Redskins wins
[url=https://www.worldsupporter.org/nl/node/53474/] Raiders vs Redskins Live Streaming[/url]

Multiple Calendars Using Kimball Outrigger Technique

SQLServerCentral » Latest topics
Multiple Calendars Using Kimball Outrigger Technique
Has anyone successfully used Kimball's outrigger technique for multiple corporate calendars in SSAS?  If so, can you share the technical details of how this was accomplished?  I've been trying to implement this multiple ways now but can't get th

The Randomness of Analog

SQLServerCentral » Latest topics
The Randomness of Analog
Comments posted to this topic are about the item [B]The Randomness of Analog[/B]

Discovery was delayed AGAIN

SQLServerCentral » Latest topics
Discovery was delayed AGAIN
[url=https://www.facebook.com/events/186976895180633/]Raiders vs Redskins Live Stream[/url]

satisfy their desire to win, or in order to achieve

SQLServerCentral » Latest topics
satisfy their desire to win, or in order to achieve
[url=https://www.worldsupporter.org/en/node/52216]Bengals vs Packers Live Streaming[/url]

previously directed episodes

SQLServerCentral » Latest topics
previously directed episodes
[url=https://livestream.com/ispot/events/7746006]Packers vs Bengals Live Streaming[/url]

Transfer Database Data

SQLServerCentral » Latest topics
Transfer Database Data
hello community.
i have two databases. one is old version and other is new version ..

in new version i have some new fields in all the tables old version doesn't has those fields.

no

Incremental loads wiothout Change Tracking ?

SQLServerCentral » Latest topics
Incremental loads wiothout Change Tracking ?
Hello All,

We currently are using Change Tracking for our current customers. It is working well. However, we are about to take on another EHR application that has a compatibility level of SQL 2000.  How can we capture incremental changes wit

shake off the space dust

SQLServerCentral » Latest topics
shake off the space dust
[url=https://livestream.com/ispot/events/7745392]Patriots vs Texans Live Streaming[/url]

Recover data from encrypted log file

SQLServerCentral » Latest topics
Recover data from encrypted log file
I have a 2008 R2 database encrypted using TDE that crashed. The MDF was lost, but the LDF survived.

I was able to restore an old backup copy of the database. The data updated since the last backup should/may be on the LDF that survived the crash.

Transfer Database Data

SQLServerCentral » Latest topics
Transfer Database Data
hello community.
i have two databases. one is old version and other is new version ..

in new version i have some new fields in all the tables old version doesn't has those fields.

no

Powershell to get Results and Messages in SSMS inquiry

SQLServerCentral » Latest topics
Powershell to get Results and Messages in SSMS inquiry
Is there a powershell script that will show both output Results and Messages. 

For example:
Select @@servername

It should show on the powershell output
Result - Server/InstanceName
Messages- (1 row(s) affected

The order of TRUNCATE and DROP / DISABLE NONCLUSTERED INDEXES

SQLServerCentral » Latest topics
The order of TRUNCATE and DROP / DISABLE NONCLUSTERED INDEXES
Hi folks... I'm hoping for some guidance on TRUNCATE and NONCLUSTERED INDEXES.  I've been told conflicting information from a couple different DBAs.  Here's the scenario:

I have a table with ~250M records.  Right now it's a daily f

Catalonia to be an independent country

SQLServerCentral » Latest topics
Catalonia to be an independent country
[url=https://www.facebook.com/events/830918617069086/]Broncos vs Bills Live Stream[/url]

IP adrsss for my SQL server

SQLServerCentral » Latest topics
IP adrsss for my SQL server
Hi all!

I have tried both Google and seach on this page first...

I have a  SQL 2012 server, where one of the DB'a are  used for a  web server.

I have a static IP adress 'Outside' on my netgear Router.

Now

Saturday, September 23, 2017

Running total challenge - SORT OF

SQLServerCentral » Latest topics
Running total challenge - SORT OF
Hello ladies and gents!

I have a task that has boggled me for a few days now. What the client needs is a Yearly/Quarterly summation of their overall square footage (SF) over all their stores. BUT they want to know their SF at the beginning of eac

Get the year and Qtr

SQLServerCentral » Latest topics
Get the year and Qtr
Ia am trying to get the year and Qtr from my date column which has values like- YYYY-MM (2017-02). I want the Year and Qtr as -2017 Q1

I tried below- select CONVERT(datetime, '2017-02',104) as Col1

it gives me Conversion failed when conv