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

Extended Event sqlserver.file_read_completed

$
0
0

I am profiling the I/O activity using the events sqlserver.file_read_completed and sqlserver.file_write_completed. Both of these events have a mode attribute that is either "Scatter/Gather" or "Contiguous". Where do I find documentation that describes what these modes are and how to use this information when examining I/O issues?


SQLSRV_Query Syntax Help

$
0
0

Hello, I'm trying to create a web program that'll allow users to select multiple items, pick a date range, and then download a csv with the data that matches one of the selected reasons and falls within the date range. However, no matter what I try, I get "Incorrect syntax near $array" for the SQLSRV_Query.
Any help is appreciated

$array = $_POST['ubreasons'];
// Adding single quotes and comma separated into array
$array = implode(" ',' ", $array);
$array = " ' ".$array." ' ";

$searchQuery = sqlsrv_query($cxn, "SELECT Account, First_Name, Last_Name, SUM(ClaimLineBalance) AS CashValue
FROM v_UnBilledClaims_Report
WHERE UBReason IN ('$array') //Here is where the problem is
GROUP BY Account, First_Name, Last_Name
ORDER BY CashValue DESC");

Applications Cannot Connect After Migrating Databases with Powershell dbatools

$
0
0

I'm attempting to decommission an old SQL 2008r2 server by migrating databases to an existing SQL 2012 server in my environment. I used dbatools in powershell (Start-DbaMigration -Source OLD-SQL -Destination NEW-SQL -DetachAttach -SetSourceReadonly -Force). The process completes and the properties of the databases on the new server appear to be the same as on the old server but my applications cannot connect to it.

I tried setting up a SQL alias using cliconfg.exe (both 32bit & 64bit) on the servers running those applications (Sharepoint 2010 and a homebrew application created years ago) but they still cannot connect. With the alias in place I'm able to view the databases on the new SQL server by opening a .udl file to the old server's name and the connection tests fine.

I don't care too much about Sharepoint but the developer for the...

SSMS Tiny mouse pointer

$
0
0

This is driving me nuts; has anyone else seen this?

In SQL Server Management Studio, I right click on a database table and select "SELECT Top 1000 Rows" (this is v17.7). That opens the table up to the right with the SQL query on top. The bottom pane is the "results" pane. You can click-and-drag at the top of the results pane to expand or contract it.

Everyone still with me? Good.

When you move your mouse to the top of the results pane, the mouse cursor changes to indicate you can click-and-drag. What is wrong with that cursor?? It's tiny and slightly malformed and just Not Right. I can't figure out how to adjust it, and changing mouse cursors in Windows doesn't affect it. It's not tied to DPI, because the same thing happens when I move SSMS to my other screen at a different DPi. Like I said, this is driving me nuts, even if I don't use it...

Database File Locations

$
0
0

I am creating a few databases on one SQL Server, and I am curious if it is possible to change the location of logs and data for EACH database. I know you can change the server wide settings, but I have multiple drives I would like for each database to push it's info onto.

Moving Database from one server to another

$
0
0

I am currently trying to move our production software (Shipping, ERP, WMS, etc) over to the new onsite server we have.

I am first trying to move the Shipworks DBS over, just as a test (it's the smallest DBS). I have yet to get a method to work.

First, the Backup and Restore method has yet to work, because it gives me an error saying "a file activation error occurred" I'm assuming this is because the new server can't reach the data and log files of the original server. But it does make me curious, when restoring any SQL DBS, do you need access to the Data and Log files. Seems to me that if you lose those, you're just screwed if you only have a .bak.

I am going to try to restore using the .bak file, and share the data and log files to the new server so it can access it and see if that will work.

If anyone has any recommendations, they would...

Performance Monitor - Data Collection

$
0
0

Hello all

I just wanted to get some IT professionals opinions about running Performance Monitor on a server.

Long story short, I would like to set up performance monitor to collect 24 hours worth of data. I will be using 7 different counters whilst doing this.

My question is, how much will this impact server and sql server performance? I have read that the footprint is minimal as long as you don’t use too many counters.
However, as I need to run this on several production servers, I just thought I would get some additional opinions about this from people that have probably had experience of doing this. Many thanks

How do I monitor the sql query for single select

$
0
0

Hi,

I have a database with Audit enable but I would like to monitor single user and get an alert when the example query specific tables, records etc.

What tool can I use for this?


Dynamic table name SQL

$
0
0

Hi,

I'm new in SQL,

I have tables like follows:

xxxx_2018_01

xxxx_2018_02

xxxx_2018_03

xxxx_2018_03

I want to select from all table where the name start by xxxx, any help please.

Thx.

SQL Permissions

$
0
0

I have an SQL Server with multiple databases on it.

I have one database that I want users to access, with these permissions required by the vendor of the software it is for:
EXECUTE, SELECT, UPDATE, INSERT, DELETE and VIEW CHANGE TRACKING(on all tables)

I need help doing this, what I have currently done is created a role, and schema using this:

CREATE ROLE db_user
GRANT EXECUTE ON SCHEMA::shipworks TO db_user
exec sp_addrolemember 'db_user', 'DOMAIN\user.name'

The execute is just to get it started, but when I navigate to the schema to change permissions, or even view them, I get an error saying:

Cannot execute as the database principal because the principal "db_user" does not exist.

The role applies to my domain user, under Membership in the user, and the permissions I want show up in the role, but don't actually grant the permissions to the...

SQL Graph database and query

$
0
0

Team, I am looking for a output as stated below :

Required output :
Roshan Mitran Romba Gopal
Roshan Gopal Sada Mrithu Kumar Vadi Gokul
Roshan Gopal Sada Mrithu Indigo
Roshan Romba Jag Naresh
Roshan Mitran Kumar
Roshan Mitran Surabh
Roshan Mitran Akala
Roshan Mitran Dhoni
Roshan Mitran Watson
Below are a sample graph database created for example. You can run this query in SQL Server 2017 and create the base table, node table and edge table. Also you can load data using below queries. I need help in getting output as stated in Required output : above. I am seeking SQL query from the forum to get the above output. Advanced thanks to all of you.
DROP TABLE IF EXISTS Kids;
CREATE TABLE Kids (RoomNo NUMERIC(8) not null, RoomName VARCHAR(20) NOT NULL, RoomLink NUMERIC(8), )
INSERT INTO Kids values...

Sql server agent on windows 10

$
0
0

Hi  Everyone,

I am facing problem on my windows 10 SQL server agent is not starting.

Giving error SQL server agent(SQL express) service on local computer started and stopped some services stopped automatically if they are not used by other services or programs.

Please, can someone help me?

Is it Possible to Add Data Rules for a Column ?

$
0
0

Hi, I have one table and there is one column(nvarchar) in it. For that column I have inserted some records. All records have one key like, #KEY#.

I just want to replace that word #KEY# with another value (I will get runtime from other table).

Is it possible to add such rule, that whenever someone retrieve those data, #KEY# will be replaced by other text.

HTML table column

$
0
0

Hi,

Can we format a table column to HTML in SQL?

Thanks in advance for your reply.

Sql.2014 to TFS 2017?

$
0
0

I want to move data from an old development server  Sql.2014 to TFS 2017 and use original IP and name and login info.......Is this possible?


Application won't connect to SQL database

$
0
0

I recently took over a small manufacturing facility as IT Manager, aka, the only IT guy. They have an application that was custom developed by a small software development company that is no longer in business in the early 00s. This application runs and monitors a paint booth that paints the parts they produce. This app is running on a Win XP machine and has worked without incident till this past weekend when it failed to open after a reboot. It gets the attached message where it can't connect to it's database. I've checked the ODBC settings and tested all of the connection, they are able to connect to the databases. Is there an app or method to trace what's happened when you try to run an app to see what resources it's trying to connect to? The only issue I have noticed over the weekend is the SQL server is not able to be pinged via...

Question on mounting a test database.

$
0
0

So this is my first go at adding a test company for my ERP in SQL.

So I restored the database to a backup folder, and renamed it from the live database name, both the MDF and LDF have a matching name.  

Since I have no confidence at my first go around, is it as simple as it looks?  I go into SQL studio, click to attach my now, renamed database.  Point to the MDF (and LDF if prompted), and that's it?  (in my ERP I know how to select another database so that's not in question).

Likely the simplest question of the day!  But needed to ask!

Skype for Business 2015 Front End services won’t start.

$
0
0

Hello folks! I am trying to set up Skype for business on a Server 2016 VM. I've gotten as far as starting the services when I run into problems. The "Call Park", "Front-End", and "Response Group" services will not start. When I try to run

Powershell
start-cspool-poolfqdn<PoolFQDN-verbose

it says:

Powershell
StatusoftheServers:ServerStatusStageDetails----------------------------<PoolFQDNN/AN/AFailedtogetstatusdata!StatusoftheServers:ServerStatusStageDetails----------------------------<PoolFQDNFailedToConnectToBackEndFinalNoneWARNING:Couldnotconnecttoanyserverinthepool<PoolFQDNtoretrieverouting...<<<
<

SQL server 80-100% CPU

$
0
0

Hi,

I was wondering if someone could give me hand, For the past month it was working well the SQL database but recently users complaining how slow its been, After checking this week the CPU stays at 80-100% always. We contacted the programmer to give it a look and he does not know either, he disabled all his services and still no luck. the DB is really small 3.1gigs. I was looking around google to find what consumes the highest CPU usage but i dont know if its a windows issue or a SQL issue.

The real question how do i troubleshoot this or where should i start looking?

Thank you

Can merge replication filter based on VIEW?

$
0
0

Hello,

we have 2 SQL instances (A) and (B) both on SQL2016 in merge replication.

we have recently added a new table on A (publisher) and we have requirement for anonymize data.

we want fews columns from an article coming from A to be anonymized based on conditions (where) before getting applied on B.

or 

is it possible merge replication can filter data based on VIEW created with anonymised data?

is it possible to achieve it? 

thank you

Viewing all 4871 articles
Browse latest View live


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