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

SSRS Query with joined subquery High CPU using date parameter in query

$
0
0

I'll try to sum this up as best I can...

I first create a SQL query in SSMS (SQL Management studio) and it works and runs in mere seconds (2-7 seconds usually) So I then take the query and put it into an SSRS report using SQL Report Builder (3.0 for SQL 2016). I've done this many times and never had an issue.

On this query when running it from SSRS it causes the CPU on the SQL server to max out 99 to 100%

but only when I include date parameter variables in the dataset query. So the Where clause in the query says something like where date between @BeginDate and @EndDate

Then I set the parameters up in the SSRS options to prompt user for those values (or I set default values like Today() etc...)

I've brought the entire query down to a very minimal set of data to test it out and once I put in the date filter in the where clause then it breaks...


Returning a NULL Value when query returns nothing

$
0
0

I know that in theory, the query should return nothing. However, I am wanting to copy and paste the results into an excel spreadsheet. Inevitably, there are going to be queries that do not return a value. Below is an example.

select m1,m2,m3
from dbo.industry
where area='000003' and code='21' and ownership='50'
union all
select m1,m2,m3
from dbo.industry
where area='000003' and code='211' and ownership='50'

This is shortened down, the greater query that this comes from has 25 codes. So, for example, lets say that the code section above returns nothing, In this case, the result would be 25 rows (25 codes) but with some showing up as below

NULL NULL NULL

Is there a simple snippet that I can add to each section to have this result produced or do I have to redesign it altogether?

IIS 6.0 Sites Inaccessible

$
0
0

Guys

Any suggestions as to why all of a sudden, you'd be unable to access the Sites page in IIS as IIS is hanging?  This has happened twice in the past week since we replaced the GC DC.

Only a complete reboot of the server seems to resolve the issue and event logs are not offering much in the way of assistance?

Server is the latest DL385 G10 HPE with SSD's R1+0 so a good spec.

TIA for any assistance....

Website Search Functionality For 2 Million Products

$
0
0

I have an Ecommerce/Online Shopping site with around 2 million items(MS SQL Server DB). It has various products and i want to implement a search functionality for it. The search could be anything like "White shirt" , "Black Shoes", "Leather Belt" so on.

How do i implement the search mechanism ? The site is expected to grow in years.

I know solutions like SQL free-text, Full-text search.

but which one would be appropriate for the scenario. You know people search weird things ?

CURRENT PROBLEM: If a user search "White Shirt" than I search this item from database 5 to 6 times. First search will load the results in website products list. Other searches will get the item count for different search filters.

1. First search will get the item for website search body.
2. Second search will get the counts for discount filter like 5%, 10% or 50%...

ASP.NET core 2.1 application on Linux connecting to MSSQL problems

$
0
0

I am currently working on a project that requires me to setup and run ASP.NET core applications that require connecting to a MSSQL instance running on server 2008R2. The applications are intended to be served across an intranet using nginx and ubuntu server 18.04. The short version of my problem is I cannot get the application to connect to MSSQL from within Linux. Here is what I have done so far in trouble shooting.

It should be noted that all connections are targeted by ip address, and SQL authentication is made with a sql account.

  • Within Windows:Verified that the application can be ran as a stand alone (dotnet application.dll) from the command line and verified that connecting to localhost:5000/app loads and can access data.
  • Within Linux: Verified that the application can be ran as a stand alone (dotnet application.dll) from the...

Granting local Windows account access to single SSRS shared data source?

$
0
0

We have a multi-tenant SSRS 2016 system which most customers don't have access to so from the frontend we will create folders, reports, data sources etc. We have one customer who is trying to use report builder and needs to be able to assign an existing data source to the report for it to run correctly. The problem is that we don't want this user to see all of the other data sources.

I have tried granting content manager to this user account in the folder they don't have access to.

I tried creating another data source in the folder they have access to but that didn't work either. When I go to change the data source on the report it says "The permission granted to use USERNAME are insufficient for performing this operation."

Can anyone advise on how to grant her access to this shared data source or create a new one so they can access...

Mimimum reasonable specs for a VM (ESX) to run SQL Server Enterprise

$
0
0

This is not a question about licensing - I have that covered - SQL Server Enterprise is a core based licensing with a minimum of four cores.

My question is what are reasonable minimum guest OS specs for SQL Server Enterprise running a single database (~100GB of data) that's being used primarily for report development?  There will be some other usage as time goes on and I should be able to add memory and disk space but initially it will be for reports (SSRS) development.

Moving Data Between tables

$
0
0

I have database that has a table in it that is over 55 million rows. It is by far the largest table in the database. I am looking at the size of this table and how long it would take to restore if I had to. The total database size at this time is 162GB. I have moved 5 Million records from this table/Database to a Archive database to help with this issue. I was actually thinking maybe I would move this one table completely to the Archive database. This way if I had to do a restore I could restore the main database quickly and get people up and running and they would lose the one piece of functionality that this table is concerned with.

Just a few questions.

Is this a good idea? Can I still keep the foreign key relationships? Also up to this point I have been moving files over by date so they have been in groups of 250,000 or so but now I...


Not able to configure VSS-Aware backup for SQL.

$
0
0

Hello,

I am trying to configure a backup set of VSS-aware for SQL, installed DS-Client in same server for which need to configure and machine is of Windows 2008 R2, I am getting error"The network path was not found" and "no writer or component found on the selected computer for backup" after enter the credentials for configure and using Administrator logins for configure. I am able to configure file system and non-vss backup set.

Performed Troubleshooting:

  • Volume shadow copy services is enable.
  • All writers are stable.
  • Network discovery is on.
  • $ sharing is enable.
  • Volume shadow copy for drive is enable.
  • Administrator has sysadmin role for DB.
  • UAC is disabled.

Regards,

Akash


SQL login failed for user

$
0
0

Dear All,

We do have a SQL issue lately, we are using a internal software which needs a SQL server connection.

Persist Security Info=True;; Fout;"system.Data.sqlclient.SQLException (0x80131904): login failed for user "username"

we are very sure of the password we use for the connection

Server is 2008R2

SQL 2008

Can someone please advies how to fix this ? is this a password issue ? can we create a new user and allow the user to connect using this database ?

SQL
PersistSecurityInfo=True;;Fout;"system.Data.sqlclient.SQLException (0x80131904): login failed for user "username"

How do I put quotes around a SQL select statement that returns XML value?

$
0
0

I am having trouble putting quotes around the following string value select statement in sql. How do I do it?

Convert(Xml, OM.Body).value('(//DocumentResponseMessage/ecf:Document/ecf:DocumentMetadata/d:RegisterActionDescriptionText)[1]','varchar(250)') AS 'CaseEventDescription',


The reason I need to do that is because the value has a comma in it and when I put the output in Excel, it is not fitting in one column. So putting quotes will help but I don't know exactly how to do it.
Kindly help.

Can you run MS SQL 2016 Standard for 2 cores on an 8 core server?

$
0
0

I am trying to find out if I can run MS SQL Standard edition for 2 cores on a server with 2 Xeon E5620 @2.4Ghz processors.  

Server generating TMP files (Unknown scheduled task)

$
0
0

I have an AWS server, running an ERP DBS, on SQL 2008, Server 2008.

Though, in the User > AppData > Local > Temp folder, it is flooded with SQL TMP files.

"AWS_SQL_DBs-date.tmp"

The issue is, they all are generated at the same time of day, every day (3:00AM). But I don't have any tasks in either SQL agent, or Task Scheduler for that time. This server was configured before I got into it, so there's lots of tasks, but none of them use the location of the files, or the time. I'm pretty new with SQL Agent and Task Scheduler, so it's probably an easy fix.

SQL 2016 Reefernce Book

$
0
0

I am looking for a reference book for MS SQL 2016, there are so many out there it's difficult to know which one is good.

Does anyone have any suggestions ?

Hyper-V & MS SQL 2016

$
0
0

We are going to be re-using an old server as a development SQL server, and are considering our options for disk layout.

The server has 2 SSD drives which we will use for the OS, but it also has 13 300GB 15K drives.

Do we format the RAID to be RAID-10 with a Hot Spare, or do we format the RAID to be something else and then install out 2 guests (1 being a SQL 2016 Server).

Also I have been asked (and having a senior moment), could we create a drive on the RAID and share it between the 2 guests, a bit like a Virtual SAN.


TCP/IP base SQL server access issue

$
0
0

Not able to access SQL server using IP.

TCP/IP, Named Pipe is enabled.

Port 1433 is open between both server.

As per our observation, after rebooting windows server, we are able to access SQL server for few hours and then again we got below mention error :

A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The semaphore timeout period has expired.) (Microsoft SQL Server, Error: 121)

Could you please provide suggestion?

SSRS 2017 only shows first page of report after migration from SSRS 2008

$
0
0

I recently migrated SSRS from 2008 R2 to 2017. I seem to have a problem with at reports displaying only the first page, e.g. where the query returns over 8000 rows but only 1 page of data is displayed. Clicking on Next Page ( > ) does nothing and it shows pages 0 our of 0. If I export the report to Excel it exports all 8000 rows.

When I open Report Builder and I run the report, Report Builder displays more rows as I scroll down to the end of page. But this does not happen in IE, Edge, Chrome or Firefox. Interestingly enough, I get an error on Firefox after it loads the initial page stating that 'a script on this page may be busy or it may have stopped responding...." I am assuming, that this is whats causing the issue but have no idea on how to fix it.


setup permissions so that certain users can always login in SQL

$
0
0

We use a program (Foundation) for ERP and accounting, ordering, work flow, basically everything.  We have 20 licenses for users but are experiencing the "can't login, no licenses available".  It doesn't happen often but enough that they get me involved to kick users off so they can access it.  Is there a way to set priority for 2-3 users who always need access to log off another user who does not need all the time access?

I know the best thing is to purchase more licenses but if there is a band-aid fix for now I welcome it.

SQL 2014 Full

Query will not return blank results only a null or 0 value

$
0
0

I need to return blank results when there is not a value entered into the table but have only been able to get either a null or 0 value.

CASE

    WHEN PAE.SEX = 'F' THEN 1
    WHEN PAE.SEX = 'M' THEN 0
    WHEN PAE.SEX = NULL THEN ''
    END AS SEX,

this returns a null value

CASE

    WHEN PAE.SEX = 'F' THEN 1
    WHEN PAE.SEX = 'M' THEN 0
    ELSE ''
    END AS SEX,

this returns a 0 value

sql

$
0
0

Hi

I have a sql issue.

In my database table I have one column with data formatted like (CRK-1075-220-002344). I want to find if its 10th digit/character is 2 then returns all (regardless any other digits/characters).

It would be very thankful if you can help me with this?

Many Thanks

Shenal


Viewing all 4871 articles
Browse latest View live