sql-server's questions - Chinese 1answer

23.088 sql-server questions.

I've started a new job and it involves looking at a bunch of big numbers. Is there an easy way to add commas to an int or decimal field to make it readable? For example, SQL Server outputs the column ...

I am writing a Table Value Function, calling the function takes 10x as long as directly running the code. I traced this to a call to a multi-line scalar function inside the TVF. The call to the ...

Recreate log file

1 answers, 8 views sql-server
Taken database to offline and deleted the log file. While take back database online will recreate log file automatically But in my case it is not. Please suggest way to create primary log file at this ...

Is there a way to a set trigger that will activate once a new table is created and will get the new tables name? I was able to come up with the query below but it only gets the first query by ...

I need to be able to read files from a UNC path in TSQL and am getting an access denied error. I've read I must change the user SQL Server logs in as to a domain user, it's currently running as NT ...

I'm running into the "Invalid length parameter passed to the LEFT or SUBSTRING function" error, but it goes away and the query works when I include the column I'm passing into those functions, any ...

So we're a Dynamics GP house, running on top of SQL 2014. When our vendor does a software update, they run a special Microsoft Dexterity procedure called Table_CreateIndexes(), which drops the keys ...

I have a server which runs third party software (called Visualcut) to email Crystal Reports to our users. When I log onto the Visualcut Server, I can open the software and then preview a report. This ...

I need to join an Oracle linked server table (with 1 billion rows) with an SQL Server table (with 100 rows) on multiple keys: SELECT * FROM OPENQUERY(EDW, 'SELECT * FROM ORACLE_TABLE') A INNER JOIN ...

I am editing my previous question to be more precise as i am still unable to get the logic behind the log shipping restore job. May be there is something i am missing to explain but will try my best. ...

We have an OrderLines table with columns: Quantity int not null QtyCancelled int not null QtyBackorder int not null QtyPicking int not null QtyPacking int not null QtyShiped int not null with ...

I'm having a tough time to connect to a local SQL Server instance within a C# app. I can connect to external databases on other servers, but I need to be able to use my own local database. The ...

SQL Server 2012 and 2016 Standard: If I put if-else logic in a stored procedure to execute one of two branches of code, depending on the value of a parameter, does the engine cache the latest version?...

We've faced such a problem after migrating from SQL Server 2008 to SQL Server 2016: there's a merge replication implemented and it takes up to 2 hours (!) to generate a snapshot, instead of 5 minutes ...

I am tasked with implementing auditing of data changes on our database. I am aware that there are commercial products for this, but I wanted to know which design would be better. For any given row ...

I'm trying to build a query to show rows in a Customer table that match rows exactly in 2 columns (Address 1 and Address 2) but then show only if a 3rd column is not matching. Customer ID Status ...

Can I force a user's queries to always run with the hint NOLOCK? e.g. they type select * from customer But what is executed on the server is select * from customer with (nolock) This question is ...

Does anyone know what this view is for? Its obviously system generated and I have found it in 2 of my replicated databases but not in others.

So I have a few tables that I have to query to get a bunch of information. The problem I seem to be having is that there is only 1 thing joining them together and because some of them have a many-to-...

There is a group of rows which have the losscode and service odom. The contractnumber and service odometer are used to group the rows. Please, may you help me to find the way to select only the row ...

I have 2 tables: Customer and Billing, Customer contains generic details (name, address, you get the idea) and Billing contains items that are billed. The end date of when the item gets billed to is ...

In my current environment, I have many instances of stored procedures, just like the one shown below, where a bunch of parameters are passed to the procedure, and then within the procedure a select ...

I'm running a 15GB database on SQL Server 12.0.5207. Server is a virtualized Windows Server 2012 R2 with 16GB RAM and 4 CPUs. Yesterday, we set ALLOW_SNAPSHOT_ISOLATION to ON, to check if it would ...

I am trying to add a traceflag as a startup parameter to a distant SQL Server 2016, installed on a Windows 2016 core server and I am following these instructions At this point in the document: ...

I am running an instance on ECS (AlibabaCloud) and want to connect Java in ApsaraDB for RDS SQL Server. I read the guide from alibabaCloud and found the code: String userName = “user”; //Default ...

I have a question about what would be the best way to set up SQL Server 2017 as a service. I have clients that buy a SQL Server database as a service, as if it were an Azure or AWS instance, where ...

Experiencing this intermittent issue on a few servers running MSDTC. 19/09/2018 10:54:38 a.m. -- A timeout (30000 milliseconds) was reached while waiting for a transaction response from the MSDTC$...

The log.trc file is missing on the server, but there are archived trace files like (log_15.trc, log_16.trc, log_17.trc, log_18.trc, and log_19.trc). Is this something to be concerned about? Is ...

SQL Server version is 2014 Developer SP1. Trace Flags 272, 610, 1118, 1206, 1222, 8048, 9481 are globally turned on. We had to turn on flag 9481 since the new cardinality estimator badly effected ...

I have a remote SQL Server: myremotedb.myremotedomain.gbl. I could connect to it from another server myserver.myareadomain (not in the same domain) using SQL Server Management Studio without problem. ...

We have the 2 databases. Reporting HR There are some users who want to extract data from HR database. But we don't want to give direct access to that HR database. So, we created the special views ...

I'm trying to model a database that will be used for management and execution of SSIS packages. The entities are Client, Job and Package. A Job is the managed unit that references Client and Package. ...

This execution plan has the following memory fractions: Memory fraction input:1, Memory Fraction Output:1. it is a very simple query: SELECT [a].[activityId], ...

First off I apologize for asking a question I'm sure is well answered, however I cannot quite understand what I'm reading. I have an existing table with an xml column. I have a second table with the ...

I've been trying to figure out this linked server problem for about a week now with no luck. The set up I have is a linked server from an instance of SQL SERVER 2016 to an instance of SQL SERVER 2016 ...

When we migrated from an older all flash array, to a newer all flash array (different, but well established vendor), we started seeing increased waits in SQL Sentry during checkpoints. Version: ...

We are designing a database to store the X,Y graph data of electronic devices apart from other entities. Business domain description We have a collection of objects A, each object A has a collection ...

I have a table with just one (nvarchar) column for tracking IDs that have been used, to ensure they aren’t duplicated. Should I use Clustered or Non-clustered Index for this? The only two operations ...

Background We have a data warehouse process that calls the following code: exec sp_executesql N'EXEC maintenance.sp_fk_statements @P1,@P2,@P3', N'@P1 varchar(3), @P2 varchar(9), @P3 ...

Recently, and on more than one occasion now, we have attempted to connect from one of our SQL Server instances to another using SSMS only to be greeted with the following error: A severe error ...

My database log is growing out of control, I recently removed the database from an availability group by when I look at the log reuse wait description it shows "AVAILABILITY_REPLICA" I have tried to ...

Is it possible to install service pack 3 to an existing instance of MS SQL Server 2012 Express? The only install files I found are: MS SQL Server 2012 and Service Pack 3 for MS SQL Server 2012 not ...

I have written a server which keeps on receiving concurrent requests from 30K-40K different clients concurrently. Now I need to dump all those individual requests into a database. The database right ...

I have been working on this deadlock issue for quite a few days now and no matter what I do, it persists in one way or another. First, the general premise: We have Visits with VisitItems in a one to ...

I need to pull some data from an earlier backup of a current prod database, so I'm using the SSMS Restore Wizard to run a point in time restore and put it into a temporary restore database (for ...

After changing the sa password of SQL server 2012, the automatic backup doesn't run any more. Please see the log history:

Have seen a couple of posts similar to my scenario, but nothing that actually resolves my issue. Scenario: Routine index rebuild happens, once a week, 2 AM Saturday morning. Log file grows about 15x ...

Firstly, I apologize - I couldn't create an example SQL Fiddle, because the site doesn't seem to be working right now. Now, onto the problem... I'm getting an inconsistent sort order on SQL Server ...

I'm using SQL Server Management Studio 17 and I'm trying to list all the users for auditing in an organized way with mentioning their database name. I tried the query below but it's showing the ...

I have a table similar to the following that holds hierarchies from difference sources (SourceId). CREATE TABLE dbo.Hierarchies ( SourceID INTEGER NOT NULL, NodeHierarchyId HierarchyId NOT ...

Related tags

Hot questions

Language

Popular Tags