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

SQL Server

$
0
0

Hi everyone I am really new to SQL server and need some assistance with something. We have a SQL 2014 and the CPU seems to be getting maxed out at 90% not sure why and don't even know where to look for it.  One question I do have is this server that SQL is running on has about 40GB of RAM. I noticed some memory settings in the "Server Properites" in which I am going to post a screen shot of. One thing I noticed is a Maximum of 6024 couldn't this be more since I have 40GB of memory? Pleases let me know your thoughts on this. 



SQL Server remote backup failed, need help.

$
0
0

During month end, I usually run a full backup of our ERP database before I finish any other tasks. I went in a my manual backup failed with the error:

Cannot open backup device. Operating system error 1326 (Logon failure: unknown user name or bad password.)

I start looking into it and I notice that our hourly transactional backups stopped running around 3PM with the same error message.

Here's our setup.
SQL Server:
SQL Server 2012 R2 running on Windows Server 2012

Backup/Storage:
FreeNAS 9.1
The storage is shared as a SMB share

I can manually navigate to the share on the server. I went in to SQL Server configuration thinking it's a SQL Agent issue. I noticed here that it's running as Local System account (not on a domain account). I don't believe this has changed, though, I think that's the way it's been set up for a while.

So far I've tried...

Different SQL/ODBC versions connecting to SQL

$
0
0

Hi guys;

We've got an in-house SQL 2008 database, and our users connect to that database a few different ways. Most of our users connect via a 2008 SQL Native Client (v. 10), some connect through the 2012 SQL Native Client (v. 11), and some connect through the Microsoft ODBC Driver 13 for SQL Server. I've been told by a consultant that this isn't a best practice--that all clients should be running the same version of the native client and/or ODBC driver, as it will "slow the SQL Server down for all users" if there are different client connections.

This doesn't make much sense to me--it's like saying that a hosted website will be slower for everyone if clients connect to it using different browsers. But I can't find *any* information on the accuracy of the consultant's recommendation.

Is the consultant correct? Do I need to ensure that all...

Filtering on multiple values

$
0
0

I'm trying to create some generic stored procedures that can be used for multiple outputs.

The key table is quite simple - it's a sales invoice line table with date, sales rep, customer, product code, quantity, price and some other fields. It has ~1million records

I'm trying to work out the most efficient way of filtering by product and or customer code or codes which are passed in on a single variable.
Variables passed in should match the beginning of the field they're filtering on.

ie Product code is 8 digits eg:

11123456 or 11145678 or 11256789 or 11251112 or 11312345

pass in 111 in a product code variable and it should match 11123456 and 11145678 - but I want to be able to pass in 111 and 112 and have it match all except the code starting 113

Similarly with the customer code.

I'm contemplating doing it with a split function - as I can...

SQL to Excel Data Connection with Mirroring

$
0
0

I've got a spreadsheet that pulls fine and dandy from the ServerA when it is the principal in a 2-server mirror setup, but as soon as ServerB becomes the principal, Excel no longer is able to retrieve data.

There are two setups I've tried:

  1. With the database I am querying as the initial catalog in the Excel data connection, in which case I get "Cannot open database XXXXX" requested by the login. The login failed." when refreshing data
  2. With master as the initial catalog, in which case I get the error "Database 'XXXXX' cannot be opened. It is in the middle of a restore." when refreshing data

My connection string is as follows:

Text
Provider=SQLOLEDB.1;Persist Security Info=True;User ID=XXXXXX;Initial Catalog=master;Data Source=ServerA;Extended Properties="Failover Partner=ServerB";Use Procedure for Prepare=1;Auto Translate=True;Packet...

SQL Server database in "restoring" status

$
0
0

Hi everyone,

One of the DB on my SQL Server went into "restoring" status without any reason. 

After checking SQL error log, i only found one small thing.

Setting database option SINGLE_USER to ON for database.

Could this be the reason and how can i track down this problem?

SQL Server - Using Asian Character Sets

$
0
0

We have a requirement to start populating certain tables within our databases with Asian Characters / Data.

We currently have mostly SQL Server 2014 Standard SP2, with a few older instances of 2008 STD.

The languages which will be importing will be Chinese, Japanese and Korean. 

Now after a bit of research into this, It looks like the datatypes of the columns will need to be NVARCHAR as opposed to anything else. After a bit of testing, this would appear to ring true. 

I just wanted to ask the very clever people on here for their opinions with using Asian character sets within SQL Server. Has anyone got any further advice on this?

Many thanks

Moving database schemas from SQL 2005 to SQL 2016

$
0
0

Hey I need help transferring, moving data schema from SQL 2005 to SQL 2016.

Moving data from MA3000 software

Any help or tips. looking for help on this to get it done ??


Windows Firewall blocking ODBC

$
0
0

I have an issue where if I disable Windows Firewall on the Host machine I can create an ODBC to the SQL database on that machine. However when I re-enable Windows Firewall, it prevents me from creating any ODBC connections.

I have created an inbound and outbound rule for the port I am using.

pad a number set in SQL query

$
0
0

I have a set of employee numbers ranging from 3-5 characters and need to pad them starting with a 1 and fill in the remaining space with zeros so they are 6 characters long. Ive used

SELECT LEFT('100'+ CONVERT(VARCHAR,EMPLOYEE),6) AS NUM FROM ls_apps.EMPLOYEE

which works fine until the numbers have 4 or more characters already. 

When configuring AG In SQL AlwaysOn - DB recovery state

$
0
0

the db is required to configure 'full recovery model' of course . . .

But is it possible to configure the db by accident in 'simple mode' 

(I understand that its wrong and fail-over etc won't work)

I'm trying to understand if its possible to do it and the configuration will be apply.

Thanks :)

Business case for adding more RAM to Microsoft SQL Server 2012

$
0
0

Hello,

The company I work for are currently having intermittent timeout issues on our main database server which has been occurring for the past few months. The server runs off a VSphere 5.5 host and the specification of the server is:

·Windows Server 2012 Standard

·2 x Intel Xeon E5-2667-v4 (2 x 4 cores)

·256GB RAM

·10K RPM HDDs for OS / SQL / Logs

There are two SQL server instances which run off the same box. The database sizes in total are around 360GB but only half of this is used regularly. On average we see roughly 5700 concurrent connections during the busiest part of our working day.

I've been monitoring the CPU and RAM on the box for the past two weeks and we constantly use 95 - 97% of RAM. We've also noticed that the CPU usage sits between 60 - 90% for SQL. Very often we see this spike to 100% CPU utilization...

Additional delimiters in detail section - Sql , T-sql

$
0
0

Hello every one i have a code which is written using union function ,

So in the output its creating additional delimitersin detail section rows ..

ATTACHED A NOTEPAD FILE HOW IT LOOKS

PLEASE SEE BELOW AND HELP ME HOW TO TAKE OF THOSE DELIMITERS

beRecordType|ClientCode|SequenceNumber|AccountNumber|MedicalRecordNumber|PatientFirstName|PatientLastName|GuarantorFirstName|GuarantorLastName|GuarantorAddress1|GuarantorAddress2|GuarantorCity|GuarantorState|GuarantorZip|StatementDate|AdmitDate|DischargeDate|AccountBalance|TotalCharges|TotalInsurancePayments|TotalInsuranceAdjustments|TotalPatientPayments|TotalPatientAdjustments|EstimatedInsuranceDue|StatementMessage|StatementAmountDue|StatementDueDate
STMT HEADER|BDA|1|E00087654321|MR0001234|ALEX|Nath|Alex|Nath|93562 BRHAMA RIDGE...

sql server 2008 r2 - error when trying to install on windows 7 OS

$
0
0

TITLE: SQL Server Setup failure.
------------------------------

SQL Server Setup has encountered the following error:

Unable to generate a temporary class (result=1).
error CS1567: Error generating Win32 resource: The process cannot access the file because it is being used by another process.


Error code 0x84B10001.

SQL - HEX Code to JPEG or BITMAP

$
0
0

Dear All,

Our SQL Database stores images in the following format...

...


How to perform LOOKUPS in SQL

$
0
0

Pardon the naive and possibly confusing title.

At the moment, I produce a directory called X. It has 22 fields. Two of which are 'translated" by the website. These two fields are sizeclass and industry code. the others are left alone and transcribed directly. Currently, I upload them as numeric values and the website translates them into a description or title. For intance, size class of 4 equals "10 to 19 employees". For reasons I will leave out, I do not have control over the website

What I am attempting to do is produce this same result in SQL. I want to transform the numeric values of size class and industry code into their values. 

Can I send email notifications when a record is changed in SQL Server 2014

$
0
0

I have tried searching for an application or a way within SQL Server and I am not having much luck. In our MIS (SQL Database) there is a check box our accounting team clicks off that acknowledges we have received a deposit on an order. They then manually compose an email to the sales rep, client service rep and a production team email address. Unfortunately the MIS can not generate an email based on this record change.

If it could be done through SQL that would be great, or if it was a third party app that would be ok too. Essentially I need to send an email to the variable email address of the CSR and Sales person (whose email is associated with the order) and a fixed/hardcoded email address for the production team. The content of the email is static, with just the customer name and order # as variable.

Any thoughts or suggestions?

...

Why does my app does not failover to the server with configure for FailCluster?

$
0
0

Hello Guys,

I am new to Failover Clustering and availabilty groups. I have set up 3 servers on a lab environment. 1 for active directory to have DNS for the availablity group and also hosts my application. the 2 other servers Win 2012 with 2014 SQL servers set up for availability group (one database each that replicates to one another). All looks green, set to auto failover. So as a test, while the app is up, I turned off the secondary replica server and app is still up. Turned back on the secondary and turned off the primary (I was assuming the app would just failover to the secondary) The app gives out an error that the app lost connection to the database. Can you guys give me some tips on possibly what I am missing? Currently the fail over system we have for a database is database merge replication and if either one sql server fails,...

ODBC SQL Server 2017 connection failed

$
0
0

Trying to setup ODBC connection to SQL 2017 server for Dynamis NAV.
Which SQL Server Native Client  should I use.

Keep getting error sqlstate 08S01

Needing Database Help

$
0
0

I have been given the task of building an app in Microsoft's PowerApps, this app will be used by our users to request items, the app will give the users a list of items for them to choose from and add quantities to. The app then will compile this info in to a form and email it to 2 different departments.

Example: User fills in a the following details: Work Order#, Name, Date, Address, Delivery then selects "Save & Continue" then are taken to the Items screen and chooses "nails" Galvanized Steel 16 penny 2 1/2" Qty: 100. They need to be able to choose multiple items then add notes if necessary then submit it.

The "connections" I'm using is SQL through Azure.
Then I am attempting to create the database then figure out how to attach it. Create the form that the app fills in and sends

I cannot find any resources that explain how the...

Viewing all 4871 articles
Browse latest View live