Quantcast
Channel: Microsoft SQL Server
Viewing all 4871 articles
Browse latest View live

MS SQL license is SPLA Web OK?

$
0
0

Hi All,

we are, for various reasons, going to be hosting our intranet with a third party hosting company. it will be accessible via the internal network (VPN) & externally *to staff only* (a valid logon is required, the only unauthenticated publicly accessible page will be the logon one) the hosting company has said that it is covered by SQL web edition terms of use.

 I'm not convinced  anyone got any links to MS docs or similar to argue this? & also when (if) we are audited by MS who would they get to carry the can for this if it isn't covered?

 (don't debate hosting it externally, making it publicly accessible, using something other than MSSQL, SQL express etc.  Those argument have been fought & lost)  


MSSQL2016 How do I allow to create/edit DB views with Windows account

$
0
0

Hey Everyone,

Been a long time since I've done anything in sql, and was wondering if I could get some guidance on allowing a Windows account user (or creating a new sql user) to create/edit views on a DB. If I remember right it has to do with setting up a schema or something like that for the user and its permission set? This is in SQL Server 2016. Any info is much appreciated!

SSIS import to one table that cascades w/o record Removals

$
0
0

I have an Excel File (.csv) that I want to source/update/refresh data in two tables. The destinations are two SQL Server tables tblSkills and tblServiceTypes. The Excel file contains both skills and ServiceTypes within one table. I need both tables to contain ALL data moving forward, old and new. I have a field ActiveYn field that *1=yes, 2=no.

Part 1 (tblSkills) I would like to have SSIS append NEW records; Existing records = no change; Removed changes the values in ActiveYn to (2).

Part 2 (tblServices) Compare DISTINCT tblSkills.ServiceType to tblServiceType; (Same rules) append NEW records; Existing records = no change; Removed change ActiveYn to (2)

I hope I painted a well enough picture of what I am looking to do. I have only used SSIS for simple processes, but this seems to push me deeper into the pool of understanding. Or am I...

Mysterious foreign key errors

$
0
0

I have a table that I am trying to import data into. It is titled Wage. It has a column field titled "occcode". It is short for occupation code. It has a foreign key relationship to OCCCODES. When I attempt to import wage, I get the usual error,

" The MERGE statement conflicted with the FOREIGN KEY constraint "FK_WAGE_OCCCODES".

In plain English, I know that this tells me that I have occcode values in dbo.wage that are not in dbo.occcodes. Simple enough or so I thought. My usual plan of action is to take the "offending" column or in this case, occcode, from the two tables and place them in excel. From there, I run a match function on the two columns and that has worked until now. However, no N/A's pop up this time. This tells me that all values of occcode that are in WAGE are also in OCCCODES. Any suggestions for a better way to find...

SSIS package never finishes

$
0
0

I've imported my SSDT package into MSDB, and use the SQL Server Agent account to start the job.  The job starts fine, but never finishes.  It stays in 'In Progress' status for the first step and never does anything.  It will sit there until a stop job command is issued.

The SQL Server Agent user is a role member of SQLAgentOperatorRole in msdb, and also db_owner and SQLAgentOperatorRole owned schemas.

The package is set to 'DontSaveSensitive' protection level in SSDT, and 'rely on server storage and roles for access control' when imported into MSDB.

If I run the package from MSDB using the 'Execute Package Utility', it completes fine.  The same from the command line using dtexec.  

Need to find out why it won't run/complete as a SQL Server Agent scheduled job.

I need date only with date data type

$
0
0

Hello all,

Let's say I have this statement I am working with:

SELECT invoice_date
FROM invoices
WHERE (NOT (invoice_date IS NULL))

The result is:

invoice_date
1992-08-08 00:00:00.000
1992-08-08 00:00:00.000
1992-08-09 00:00:00.000
1992-08-10 00:00:00.000
1992-08-10 00:00:00.000

What I need is the result to say1992-08-08 without the time but keep it in the DATETIME data type. I have tried many things like:
CAST(invoices.invoice_date AS DATE) AS invoice_date= 'Type DATE is not a defined system type'
CONVERT(varchar(10), invoices.invoice_date, 120) AS invoice_date= result desired, but output is text data type...no good
CONVERT(DATETIME, invoices.invoice_date, 120) AS invoice_date = 1992-08-08 00:00:00.000 ...no good
LEFT(CONVERT(DATETIME, invoices.invoice_date, 120), 10) AS invoice_date = Aug 8 199
DATE_FORMAT(invoices.invoice_date,'%m-%d-%y') AS...

SQL 2014 licencing on VMware.

$
0
0

One of our new SQL business applications is running on a virtual machine, on an ESXi host, SQL 2014, Windows server 2012R2. VSphere 6.5.

The SQL is a 6 month evaluation, with two months left before expiration.

There are 2 ESXi hosts and VMware is configured HA, so the VM can be switched to the other server.

The size of the SQL database backup is 13GB.

A quote has been received for a full SQL licence that would allow the VM to be moved between the two ESXi hosts.

Purchasing MS software assurance along with the SQL avoids the 90 day constraint on moving the VM.

The quote for the SQL including SA, over three years, comes to over 80,000 (yes, eighty thousand pounds). This is more than we have paid so far to build the whole VMware system.

It would not be necessary to have full SQL licence mobility. If the ESXi server failed and the VM was moved to...

Automatically Rename SQL Backup

$
0
0

I'm trying to figure out if there is a way to rename a sql .bak automatically. Basically I created a maintenance plan in sql management studio 2017 which will run the backup everyday but the file name includes data time etc. Is there anyway to specify what I want the database .bak  file to be called? Basically I need the name to just be "Database.bak". 


Orphan users in SQL

$
0
0

Hi Team,

Could you please provide script that generate logins create scripts in a particular database.

Ex: 

Database: TestDB

User: Testuser1

Login: Testuser1

User Domain\Testuser2

Login: Domain\Testuser2

Login Testuser3-- not having access on TestDB

I need script that generate logins creation as result associated to TESTDB. like

create login  Testuser1..

create login Domain\Testuser1 ..

SharePoint SQL transaction and data logs

$
0
0

Trying to figure out what I should do here. I was looking through our current Sharepoint server (SharePoint 2013, on-prem, this server is a VM and sits in our data center so it is backed up nightly full backup followed by weekly incremental. ) and found that there were no backups/maintenanceplans in place on SQL. One of the database transaction logs is insanelyhuge. A sharepoint_config transaction log is currently 634 GB. The database itself is only 1.4 GB. I don't know what the last people were doing when configuring this, but I want to fix this database as well as a few others that are over 150 GB each (those are actual data files, not transactionlogs). I have been reading up on how to truncate/shrink, but I am a bit confused on what to do. Obviously,the log should not be that big. I think I need to do either a full backup and then a...

SSRS Can I "Reverse Deploy"?

$
0
0

I've got my Visual Studio (2013 that came with our SQL 2012) setup so I can right-click and deploy a report, and boom, over it goes.  

Is there a way to pull current reports from the reporting server so I know I'm using the most current version?  

Right now I go and download the current RDL to the project folder.  It seems if it can put the file out there though, that it should be able to pull it as well.

Conditional Join of tables based on joined table condition

$
0
0

I have 2 tables to join

Sales

Customer

Sales table has customer id, customer billing id and product/sale price/qty etc info.

Customer table has customer id, customer billing id and buying group info

What I want to do is return sales summary by customer billing info unless the billing account is marked as a buying group - then I want it by customer ID

so something like

Select customer code, customer name, sum(sales)

 from sales

  left join customer on sales.billing id = customer id unless customer buying group = 1 then make the join sales customer id = customer id

I can't quite get my head around how to do that (it is friday afternoon and it's hot.)

How to replicate recent data only in SQL publication?

$
0
0

Sorry if this question has been addressed earlier. I could not find it. Anyhooo, I'm a systems administrator with some experience managing SQL databases, but by no means would I call myself a DBA. My experience has been limited to installing, configuring, backing up, and the occasional query for a specific issue. So, when we were tasked with some replication requests, I went to work on researching and had a few issues with limiting articles.

The goal is to only snapshot and distribute data within a specific time-frame. Let's give an example of 1 year. However, during Publication setup, selecting articles doesn't seem to allow any limitations (BTW I'm using GUI in management studio, not crafting a T-SQL script). There are scrips you can use per-table to limit what data is replicated within each table, but I'm looking to grab all data...

Generating PDF files from a SQL run

$
0
0

Is there a way to create PDF files from a SQL to an push them to a folder?

SQL Server 2016 Enterprise -- Cores licensed for this install

$
0
0

I evidently have an odd question because I have been unable to find the answer. I should've come here first because the Spiceworks Community has some pretty outstanding users that have come through for us on multiple occasions. OK, here's the question...

SQL Server 2016 Enterprise has been installed on a physical server. We know how many cores we need the license to cover. What we do not know is how many cores the install is covering. We want to ensure we are in compliance, but how can we tell? Can a person run a query to see how many cores the license is good for?


Can I change the user SQL services are running on?

$
0
0

Hello Spice! (as in - hello world!)

After googling for a moment and not finding a satisfactory answer here we are.

I have an instance of SQL Express that I need to encrypt. Yeah, I know, it's bad already. :-)

Due to lack of proper encryption mechanisms in this simple database, I thought of encrypting the containing folders with EFS, so that the database would be both encrypted and the encryption transparent to the DB operations.

For this to work without data loss and/or corruption, I would need all the SQL services running on a single (domain) user, so that only a single user is accessing and manipulating the data.

SQL Express seems to be having its services running on a mixture of users, some virtual sql users like NT Service\MSSQL$, some as Network Service, some as Local Service.

Would it make a difference to the DB if I changed all of the...

IIS Server not communicating with SQL server. Please help.

$
0
0

Hello,

Today at 2:00 AM the IIS stop connecting to the SQL server. The IIS is running Windows Server 2012 R2 and the SQL is running on a Windows server 2008 R2 and the SQL is SQL 2008 SP4.

This is what I get from Chrome:

On both servers the event viewer is flooded with schannel errors:

Here are the Protocols in use and cipher suite on the IIS:

Connection to the database with SQL Management studio can be established without problems. The DB user and the password has not change. There are no new updateds installed.

Can you please provided some help?

SQL Login Disabled

$
0
0

Hi Team,

One of SQL login was disabled causing , report generation got failed from user end. We enabled the login and make it works.

But users asking why login was disabled, So just need to provide them how and who disabled the SQL login. 

Is there a way to identify why and who disabled it..?

Account for SSMS?

$
0
0

We just got an updated DB box and I'm working on trying to restore a database from a backup (was a SQL 2008 DB) We are using SQL 2017 and the problem I'm running into is when I go into SSMS 17 to restore the database it doesn't have access to the locations I'm trying to place the data and log files unless ServerName\Users group has access to it , I'd rather not give all the users access to those locations. (the old server was set up that way and we figured now is a good time to fix that).

Is there a specific account that SSMS runs under that I can give permission to? (I'm assuming it's running under a different account because my user account already has permission)



Upgrading Server 2008 R2 Std to Server 2012 R2 Std

$
0
0

We are planning to upgrade one of our Server that runs as our SQL Server 2012. Currently it has Server 2008 R2 Std as the operating system and we wanted to do an in-place upgrade to Server 2012 R2 Std. 

One of the question I do have is when I do the in-place upgrade, do I need to un-join that server to our Domain then do the in-place upgrade then re-join it to the domain?

Will there be any issues doing an in-place upgrade for an SQL server?

Viewing all 4871 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>