Questions tagged [sql-server-2012]

SQL Server 2012 (major build version 11.00.xxxx). Please also tag sql-server.

Filter by
Sorted by
Tagged with
-3
votes
0answers
22 views

Vertical and Horizotal data comparizon

I have 2 tables.staffcategory and StaffcatMaster. staffcategory StaffCat_Serno StaffCat 1 1. Nurse 2 2. Nurse technician 3 3. Nurse ...
-3
votes
0answers
42 views

LIGHTEST weight relational database for node [closed]

I know that SQLite is lightweight but I wonder how much of the ram it takes up. I am trying to set up a personal POC in a aws micro (.5GB ram) and I am trying to max the efficiency at the knitty ...
0
votes
0answers
39 views

Microsoft SQL Server - Recovery MASTER Database

I have backuped "master" database from 1 server and need to recovery it to another server. In "master" database or in another database - not matter. Just i need access data. When i ...
0
votes
1answer
61 views

SQL Install Fail - 2012 on Win11

Cannot use file 'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\Template Data\master.mdf' because it was originally formatted with sector size 4096 and is now on a volume with sector ...
0
votes
0answers
28 views

How to get first row group by partid and compliance typeid and document type?

I work on SQL server 2014 I face issue I can't get only one row based on part id and compliance type id and document type . so if have part id as 3581935 and compliance type id 1 and document type Web ...
0
votes
1answer
81 views

SQL Server RAM usage - how to find out where it is going?

Short Version SQL Server is using 34 GB of RAM. But when query the Memory Consumption Report, the buffer pool size, and the ad-hoc query size, it only adds up to around 2 GB. What is the other 32 GB ...
0
votes
0answers
38 views

Multiple Date rows into One single Date row(date range)

An employee was sick during different period of time, when there is not a single day difference between the multiple dates range, or the date is continuous then it should be shown in one row covering ...
0
votes
1answer
47 views

How can I improve the run time of a query that groups / display same date data in one row?

I currently have a view that contains about 1k rows of user information. currently i have a query that groups all the same user information by date into one row. Currently this query takes between 20 ...
-1
votes
2answers
149 views

WHEN run query on SQL Server, it is very slow. How to solve execution plan issues?

I work with SQL Server and face an issue that a query is very slow. INSERT INTO [ExtractReports].[dbo].[TradeCodesDelete] (PartID, Code, ...
0
votes
1answer
29 views

Scheduling Next Run date for weekly agent jobs

On SQL Server I used maintenance plan wizard to create three jobs: Job Schedule Job 1 Every 3 week on Sunday Job 2 Every 3 week on Sunday Job 3 Every 3 week on Sunday I want the three jobs to run ...
10
votes
2answers
2k views

SQL Server is using a lot more RAM than it should

I have a SQL Server 2012 instance using more RAM that it should. The SQL Server process is using about 22.5GB RAM: The instance is configured to use a maximum of 10GB: Which is way more then ...
0
votes
1answer
34 views

Insert taking less than 1 second to run, but it keeps looping in the same SPID

I'm looking for a behaviour that I'm not sure how to explain. Using sp_whoisactive, I can see an insert going on for hours: But each time , it takes less than 1 second but it's still using the same ...
0
votes
2answers
70 views

SQL Server Try_Cast returns Null value

Related Questions ,TRY_CAST(Question_Text AS xml).value('(/p/text())[1]','nvarchar(1000)') AS Question_Text2 With the help of CharlieFace on my previous post I discovered the use of Try_Cast ...
0
votes
0answers
46 views

Select Max record from last 6 hours from the table

I have multiple records for sample locationId for Same date. But createDate and time different. I need to take the max record from the last 6 hours. If the same locationId has record which is time is ...
0
votes
1answer
39 views

Help with Replacing characters with text string chops of last character of string

I need assistance with fixing a replace statement that truncates the last character of the string. The original string (Question_Text) contains HTML characters and other erroneous characters that ...
0
votes
0answers
16 views

FT CRAWL on SQL Server 2012 holds up too many connections

We are facing an issue with Full-Text service on our SQL Server 2012, it seems that it's behind crawling several dbs and once it's running it holds up too many connections, I can confirm that with ...
1
vote
2answers
50 views

Execution time/cost of function in assembly

I have a query calling XmlTransform from Microsoft.MasterDataServices.DataQuality on about 1000 rows or so and it takes 30s to do the whole set (the XSL is in a fixed variable), is there any way to ...
2
votes
0answers
35 views

Extended Event Failing To Capture Intent Locks

I have a SQL server with many unused databases and followed the linked article to set up an extended event to track intent locks and identify which DB's are actively being used, and which aren't and ...
0
votes
1answer
37 views

TSQL to Extract Time Value and Reformat while excluding non numbers eg 'Apr 2 2018 12:36PM' to '1236'

I have an nvarchar field which contains Date and Time data in the format 'Apr 2 2018 12:36PM' I need to extract the value as '1236'. While I have used combinations of substring and right I still need ...
0
votes
0answers
37 views

Accounting Program Loses Connection to SQL Server Database

We have an accounting system that uses SQL Server 2012 and every now and then we lose connection to the SQL Server and can not access our accounting system. On the surface there appears to be no ...
0
votes
1answer
30 views

How can I group / display same date data in one row?

I have a table that gets inserted into every night that is a snapshot of the data. At any point in time, the data might change in the columns (AccountNo stays the same, RunKey is incremented by 1, and ...
1
vote
1answer
13 views

Publication Properties window in SSMS hung when attempting to update

We have a SQL 2012 Database that is mirrored. It also has one publication with 3 subscribers. After a problem occurred (a view that couldn't replicate) during a snapshot push to one of the ...
1
vote
0answers
83 views

SQL Server full text indexing shows considerable increase in logical IO after upgrade from 2008 R2 to 2012

Summary I have two vanilla SQL Server instances running on identical (Win2012) VMs, one is SQL Server 2008 R2, the other is SQL Server 2012. I run the same DDL script on each to create a single DB ...
2
votes
2answers
33 views

Microsoft SQL Standard 2012 DB recovery without .BAK file?

Morning, I'm posting for some guidance on an issue we're up against. We had a server crash and don't have .BAK file for our SQL DB (the backup/images failed). Anyhow, we DO have a file level backup of ...
3
votes
1answer
147 views

How to reverse only English words?

I've an nvarchar column with English and Hebrew letters in some fields. In the fields where the English and Hebrew are together, the English letters are in reverse order (this is how the ERP program ...
0
votes
1answer
36 views

I want to pull a report from multiple sql servers, where the Database owner and job owner is not SA

I want to pull a report from multiple sql servers, where the Database owner and job owner is not SA. I need a report from a Central monitoring server, if the database owner and job owner is not SA, I ...
0
votes
1answer
40 views

If Primary Data Centre DC1 goes down how to activate secondary DC2

We are planning to activate our secondary DC2 site and bring down our primary Data Centre DC1. We have three node cluster with AG's ON. Two nodes SQL07P & SQL08P which are in automatic failover (...
0
votes
0answers
14 views

3 select and collate the result of the query or organize (order by) by fields of the tables

I have 3 tables and each one with different structure and number of different columns, but the first 4 columns are the same in all tables. For instance Table 1 Type id1 id2 Period FirstName LastName ...
-1
votes
1answer
35 views

How to rewrite slow proc with deletes

How should this be re-written/optimized to speed up? On avg deletes 80 million rows. No FK references. Cannot use move data to another table and truncate methods. SQL Server 2012 Stnd CPU 8 Cores ...
0
votes
1answer
48 views

Use trigger on DELETE to retrieve original SQL command and user who did it

I'm trying to create an audit log to store all delete commands on some tables, on MSSQL 2012. What I need is the username that executed it and the command executed, then I can insert them on a log ...
0
votes
1answer
48 views

How to filter grouped data based on a single column values?

I have large patient dataset with diagnosis information (It has more columns than shown below, which are unnecessary for this). I have generated a sample datset like below: ID Name Gender ...
0
votes
0answers
17 views

Full Text Search Launcher service and process

I am puzzled by the full text search in sql server. I am trying to break down the issue in multiple sub questions, maybe that would help to bring some light into the situation. I created an ...
0
votes
2answers
43 views

Which way is a better structure for users table in a shopping project - SQL Server

I think it will be faster, but if its a better database design and structure I'm not sure, Should I create a field in Users table which indicates if the user has a shopping cart or not, and only if ...
0
votes
1answer
52 views

Get data between nth occurrence of two characters

I'm trying to extract a certain data from below two examples and can't seems to get it. From first string I need this value 99068001 and from second string I need this value 42135001 I think it would ...
0
votes
0answers
57 views

Error 18456 Login failed for User

We are observing these below errors in our logs frequently and it gets fixed automatically - Error: 18456, Severity: 14, State: 46. Login failed for user 'sqllogin'. Reason: Failed to open the ...
0
votes
0answers
44 views

MSSQL 2012 Update (or create new certificate with same name) that uses Symmetric Key encryption

Super short version of my question: For a MSSQL 2012 DB is it possible to update the current certificate with a new expiry date and new PW (or create new certificate with same name)? Or some other ...
0
votes
1answer
47 views

Looking for help understanding what is happening in this SQL Script that shows key info about SQL Server Autogrowth Events

Here is the code below: DECLARE @current_tracefilename VARCHAR(500); DECLARE @0_tracefilename VARCHAR(500); DECLARE @indx INT; SELECT @current_tracefilename = path FROM sys.traces WHERE is_default = 1;...
0
votes
1answer
20 views

Looking for authoritative Microsoft reference about db_owner automatically having db_datareader role and how to check specific role is check marked?

SELECT IS_MEMBER("DB_DATAREADER"); The above return 1 for user who has db_datareader. Also, it returns 1 for user who doesn't have this role but has got db_owner. I am looking for ...
0
votes
0answers
42 views

Linked server to Oracle 19c table not showing

We have a linked server setup on our production, test, and development Windows SQL Server 2012 machines that all connect to our production Oracle 19c database. All three linked servers in each ...
1
vote
2answers
245 views

How to lock table in SQL Server to prevent other transactions from INSERT and avoid deadlocking?

I'm writing a database trigger on Table A. In said trigger, I insert a new record into Table B by doing: Look up the PK ID of Table B Increment the PK ID and insert new row into Table B (Note: Table ...
0
votes
0answers
114 views

How can you read MySQL text and longtext fields using EXEC AT on SQL Server

(A similar question already exists, but it relates to Oracle rather than MySQL.) I have a MySQL table which I've connected to SQL Server as a linked server via ODBC (MySQL ODBC 8.0 Unicode Driver). ...
0
votes
0answers
75 views

Invalid Urn filter on server level SQL Server error

I am trying to alter permissions to some of my users using GUI. When I press Script Out or OK, I am receiving this error attached. Has anyone experienced this error and what did you to resolve this ...
0
votes
0answers
15 views

Getting database in suspected mode while running DBCC checkdb command

On production we had setup maintenance job for every weekend. In this maintenance job we use dbcc checkdb command in one of step. sometime while dbcc checkdb command run it gives database consistency ...
-4
votes
1answer
59 views

Case statement syntax error [closed]

I am trying the code below but the SQL throws an error case when (b.ModuleType in (20) and rtrim(substring(a.PrdAcctId,1,8))='RD') then (a.Balance1+(a.Balance2-(a.Balance3+a.Balance4)) when (b....
0
votes
0answers
88 views

SQL server IN Clause usage with Pivot table

I have a problem with pivoting a table on MSSQL. The main problem is, when I want to fetch row values in an inner query (with IN clause) I get syntax errors but when I type the values statically, it ...
0
votes
1answer
45 views

SQL server: Any user can access database instance without any grants [closed]

User created from Active directory can access all instances of databases in SQL Server without any grants. Was shocked to see this behaviour on our environment. Example. We have a database named MyDB ...
0
votes
0answers
58 views

transaction log grows despite recovery=simple. SHRINKFILE does not release space

I have this script that restores a DB, sets recovery=simple, trims some tables & shrinks files: RESTORE DATABASE [ABC] FROM DISK (....) ALTER DATABASE [ABC] SET RECOVERY simple go exec [ABC]..trim ...
1
vote
1answer
52 views

Connect to local instance after leaving domain account [duplicate]

Yesterday, I switched from a domain user account to a local user account in Windows. Before the change, I could connect to my local database instance, but after leaving the domain, I cannot connect ...
0
votes
2answers
78 views

Track deleted user in SQL Server?

Is it possible to track which user was deleted from SQL Server and when was it deleted?
3
votes
2answers
71 views

Question Regarding ISDATE Function and DATENAME Functions

We have had an issue this morning with a report failing due to the following error: "Conversion failed when converting date and/or time from character string" The issue is that in the ...

1
2 3 4 5
90