text
stringlengths
209
10.7k
<s>[INST]How to get zplid that have zfeature key value on all rows? Exactly I need zplid and codetypeid that have feature value on all rows . if I have Null on zfeature key on one row then I don't Need it . I need to get zplid that have features Not Null on all rows as zplid 9714 but 9823,5890 have Null s...
<s>[INST]Using cast inside sum or outside ? I work on sql server 2012 I face issue using cast first or sum ? cast (sum(a) as decimal(18,2) or sum(cast (a as decimal(18,2))) which is correct and more speed a is integer need to convert to decimal so using cast inside sum or outside[/INST]Just to be c...
<s>[INST]SSMS does not have access to sys schema for master database - error is mssqlresourceserver schema sys execute permission denied After trying to get a user to be able to execute a view - providing SCHEMA permissions, providing extended stored procedure permissions (directly) to the extended stored procedure spe...
<s>[INST]How to get parts that not have same features count on table settings by code typeid and pl ? I work on sql server 2012 . if face issue I can't get parts that not have all features on table settings so I will count distinct features from table settings and compare it with count features per part if count feat...
<s>[INST]How to Update status for pl data table when at lease one row part level = 1 for zplid ? I work on sql server 2012 I have issue I need to update status for table pl data where i have at least partlevel=1 for every zplid ? meaning I need to update status for historypl table by message 'have Correct Fl...
<s>[INST]How to create table NEW_TABLE "like" OLD_TABLE including all column constraint definitions? Hi All, I am trying to create a copy of an existing table into a new table and retain all of it's old column definitions including all defined constraints. The table has over 200 columns, and typing in each constraint ...
<s>[INST]Disbaling Connection to a DB, allow only main admin account Good day, The dw db was opened for a few users to connect to at anytime with read access, but our dw dows not do paralism well and automation fails with out of memory or locked by another process (qlikview). I wanted to do it differently where ...
<s>[INST]Databases showed "recovery pending" (SQL 2019) Hello, - customer has one SQL 2019 Standard on a Windows 2016 Std. (vmware esxi) and he use four databases - I restarted the Windows Server three different times in the last month because of application maintenance - at two times SQL Datab...
<s>[INST]sql 2019 server cals Hello where do we install the sql server 2019 cals ? how do i know if my cals are all used ? thank you[/INST]CALs are just pieces of paper. They are not installed or tracked anywhere in the system.</s>
<s>[INST]Max size of data to be encrypted Max size of data decrypted by CONVERT(varchar, DecryptByKey(encripted_data)) is only 30?[/INST]Yes. Since you don't specify any length, you get a default of 30. With CONVERT, I should hasten to add. If you say DECLARE VAR varchar you get varchar(1). So always sp...
<s>[INST]SQL Server DB Backup - Backup Compression and Timing Hi All, We are using PeopleSoft Application (HRMS and FSCM) and it's running on SQL Server 2014 Enterprise Edition. Here the FSCM DB Size is 440GB and HRMS DB Size is 395 GB. We are taking daily DB Backup's for both HRMS and FSCM Database and using th...
<s>[INST]Multiple tables or 1 big table Hi, I'm going to log the consumption (water, electricity, gas, ect) for plenty of devices (take 400 devices which log every hour and we need to keep the data at least 2 or 3 years) . Now i was wondering if i can better put them in 1 table with the following colums: ...
<s>[INST]What are JFM, MDL files in Visual Studio Database Project? I am trying to create a Visual Studio Database project to ensure my databases are scripted and version controlled. Post creating the project file I see the following files being created in the folder .sln (Solution File) (Need to checkin, IMHO) ...
<s>[INST]SQL Server 17default User Groups Not Created for Windows 10: cannot assign permissions to folders I've just installed SQL Server 17 on Whindows 10 (with latest updates) and wish to grant permissions for SQL Server to open up mda files from a second drive. When attempting to grant permissions to the drive, I ...
<s>[INST]Performance and Linked servers Hi All. I have a setup whereby I need to retrieve data from a different database, what I found is that if I run the query directly from the source database and use PowerShell to copy the data onto my test database, the query runs within seconds. If I however setup a linked s...
<s>[INST]SQL linked server Hi All, I need to rename table name from cross server.I have linked server(Azure SQL server is the destination where I need to rename) in server object but I cannot rename using it.Could you please help me with the script for it. Thanks, Brindha[/INST]What do the linked server ha...
<s>[INST]SQL Server query loggin When i execute a drop view query i don't see it in the query logging. Goal is to store all the executed queries. How can i achieve this? use [MY_DB] go create view test as select '1' as one ; go DROP VIEW [dbo].[test] ; SELECT sql_text.text, st.last_...
<s>[INST]Not able to see data from ## table if changing server Hello - I have added data in ##1 and #2 using server/database-ACL-SQLSER1.CHG_N1 but when I moved the server and running the query in another server/database-ACL-SQLSER2.CHG_N2 then I am unable to see the data of ##1 and #2 and gets the following error. I ...
<s>[INST]How to run pssdiag on a single database? Hi, I would like to run pssdiag on a single database using Diagmanager (instead of the whole instance), is it possible to do that? Pretty much i would like to filter the profiler trace to be run only on 1 database... Just like if you just run sql profiler - you can...
<s>[INST]SQL Best Practices Hi All, Need some advice on the below questions please * Is there any best practices to manage shared DB. * Just wanted to understand, how patching is managed for shared DB without any downtime. Is there any load balancer used normally [/INST]Is there any best ...
<s>[INST]Unable to apply security updates Hi there, Following a recent security scan of our SQL servers, it was noted that KB4458621 and KB4293802 were missing. I downloaded these and attempted to apply them but was unable to do so. When I ran the update, the dialog box that shows the instances that are avail...
<s>[INST]Compare two table columns, Compare two table column ,if Item_Rate of B_ID against Level_Four_ID exit in #tbl_Assign ,then item_Rate Pick from #tbl_Assign,if Item_Rate does not exit in #tbl_Assign of B_ID, then rate will pick from #tbl_bottles . I Created below condition ,in which i defined B_ID=2,which is no...
<s>[INST]Stop user access when updating Tables? Hi, We are going to run some scripts from consultant to update some tables in a SQL Server Database. We would like to block end users from accessing that database during our update. Is it feasible ? If not, can we disconnect all users from the database before ...
<s>[INST]Can OS pressurize SQL to release memory? In which of the following two cases, OS can pressurize SQL to release memory. Suppose a VM has 6Gb RAM 1. If I set sql MAXMemory to 3Gb (without setting Lock pages in memory), would OS be able to free some memory from sql if it needs. 2. If I set sql MA...
<s>[INST]Is it a good practice to limit the tempdb data files size when the drive is getting full I am seeing an issue wherein the tempdb drive is given only 50 GB size(4 tempdb data files are present within the drive) and the drive is getting filled up during maintenance job run due to increase in tempdb file sizes. I...
<s>[INST]Conversion failed when converting the varchar value 'BB-2' to data type int. I am inserting BB-1 ,then again ,BB-2 is generating , it is giving error. Conversion failed when converting the varchar value 'BB-2' to data type int. CREATE TABLE #tbl_Sell_M(Bill_No varchar(10),E_Date date) WITH cte AS...
<s>[INST]sql studio management studio "how do i" feature missing Hello, I've installed SQL server management studio 18.9.1 Out of the box, it's completely missing the dynamic help and the "How do I" entry in the help menu. Is there something I'm missing? How could I enable it?[/INST]In the latest version of SSMS ...
<s>[INST]SQL Server Express 2019 Architecture Is SQL Server 2019 Express edition available in 32-bit or is it 64-bit only?[/INST]SQL Server 2014 was the last version to have a 32-bit version of SQL Server.</s>
<s>[INST]Table composite Index position has performance affect? Hello, we have the following similar Index on a particular table as example: CREATE NONCLUSTERED INDEX \[Products_IDX\] ON \[dbo\].\[Products\] ( \[Product_ID\] ASC, \[Purchase_Date\] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_...
<s>[INST]Format Decimal column Hi. I am trying to format a column, so that value is displayed in 30 characters before the decimal and 4 places after the decimal. Example: +000000000000000000000002500000.0000 ( + or - depending on the value ) . I tried the below: select CAST(ISNULL(NULLIF(columnName,...
<s>[INST]Add between date and a specific date Hi, In one of our feed I need to add between date and also a specific date WHERE sof.Sales_Office = @SalesOffice and s.postage = 'Y' and s.[Order Date] >= @FromDate and s.[Order Date] <= @ToDate How would I say the above **and** s.[Order ...
<s>[INST]Not able to cast nvchar as number Hi, We have had some SQL thats been running for about a year and it has suddenly stopped working. CAST(ISNULL(M.DEFINED_KEY1, 0) AS NUMERIC(9, 0)) AS [No_of_Cats] It basically puts a 0 instead of null and then makes it numeric. I have checked the column and...
<s>[INST]Operand data type varchar is invalid for sum operator. i am doing sum of Trans_Amount ,but error is coming. ;with cte as ( SELECT T.Trans_ID as ID,COnvert(varchar,T.Trans_Date,101) as Date,COA.Level_Four_Name as Head,T.Cheque_No , Convert(varchar,T.Cheque_Date,101) as Cheque_Date,T.Cheque_Bank,T...
<s>[INST]A database with datafile size 418 GB backup is running very slow A database with simple recovery mode and datafile size 418 GB, backup is really slow. What is the fastest way to backup the database.[/INST]The fastest way is a snapshot-based backup. Which is nothing you do from SQL Server, but typically somethi...
<s>[INST]Query store Experts, Query store is used for capturing a history of executed queries,, execution plans etc. against a specific database. However just to understand what is the impact of enabling it in read-write mode on the general performance. Does it utilize a lot of resources and might impact the overall ...
<s>[INST]nth Occurence Join I am very stuck with this. I have two tables: **Table 1:** Patients and CPT values that all say SURG PATNOCPT58903SURG58903SURG**Table 2:** Has same patients but with actual codes I need to match with Table 1. PATNOCPT5890329882589036447 **The issue:** Vlookup only gets f...
<s>[INST]Enable read-only replica alwaysON & HA platform Hi I'm setting up high availability for my SQL 2017 STD platform. I currently have a WSCF with 2 nodes and the data on NAS. It works perfectly. Now I have configured the AlwaysON on an additional server and the secondary replica has been successfully est...
<s>[INST]Insert data in Parent and child table I know update and delete cascade will update and delete automatically in child table when any changes happen in parent table but how about insert data in parent , does insert data in parent table will automatically insert in child table [/INST]Here is a script to illustrat...
<s>[INST]COUNT occurence of X,Y across columns Hi all, SQL noob here :) I currently have data presented in such a format where col 1 = number of trips 2 = origin postcode 3 = destination (UK) post code, 1 2 3 1 PR5 0XD AB23 8HG 1 PR5 0XD ...
<s>[INST]How to skip space in a query Hello, I am trying to alter credentials using a SQL query "ALTER CREDENTIAL credential_name WITH IDENTITY = 'identity_name' [ , SECRET = 'secret' ]" And the issue is that my credential_name has a space in it. so that would make my query look something like: ...
<s>[INST]Ad Hoc Distributed Queries Hi, We are using SQL Server 2017 in our production environment. We got following requirement from our security team. *Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0'* Is there any impact for database connection if we disbale this'? Our...
<s>[INST]merging data from another table in another database SQL Dear all I currently have this query SELECT count (load_id) as [number trips], origin_zip, Destination_Zip,Load_Carrier_ID,Load_Carrier_Description FROM [Rep_UK].[dbo].[Main_table_UK] WHERE Origin_Zip = 'pr5 0xd' AND [T...
<s>[INST]Cannot Connect to SQL Availability Group Using ApplicationIntent = ReadOnly Get Network Error From Outside AWS I have what I thought was a very simple Availability Group set up on two EC2 instances in AWS. There are two instances, one running on Windows Server 2016, and another running in Ubuntu 18.04. I cre...
<s>[INST]Password Expiry for SQL Authenticated Dear Experts, If I mention "Enforce password expiration" for a SQL instance in a sql authenticated account and my local policy defines password expiry as 45 days as mentioned in secpol.msc in windows Local Security Policy , will I be unable to login to the SQL account...
<s>[INST]Transaction log is full 9002 error Hi SQLTeam, Today we have been receiving continuous log full 9002 alerts. The drive is completely full with 10mb free space. Identified an open transaction and associated sql statement which is been run from past 2 days and in sleeping mode doing nothing. The database is...
<s>[INST]SQL if statemnt in visual basic Hi Guys, I'm trying to display different forms based on the value in the usertype field in the DB but I can't get it to work. I presume it's a problem with calling the table but I don't know where I'm going wrong. Any help would be appreciated. Thanks ...
<s>[INST]SQL advise please Hi I have two tables StaffRequired and StaffBookedAggregate. Both have the following columns; EventID, Role, StartTiem, EndTime, Qty I need rows from StaffRequired that; a. Do not have corresponding rows in StaffBookedAggregate for the combination EventID+Role+StartTime+En...
<s>[INST]If i use SQL Server key name( like where , select, value ) as one of the column name in my user defined table, is there any performance impact ? Hi Experts, In one of my table, i had column name "Value". but when i write any T-SQL statement by using that column, it is appeared as blue color since it is system ...
<s>[INST]sql server 2019 developer edition My company currently has Enterprise per core licensing on all servers, if i change the development servers to the Developer edition, do we need any license on the client side? Thanks. [/INST]\> Does that mean we cannot use the Developer Edition? No. You can use the copy fr...
<s>[INST]Column for bar code Hi, What kind of data type (of column) is for storing bar code? [/INST]You could save your barcodes as datatype **CHAR(<number of characters>)** and not VARCHAR as VARCHAR is characters can vary in length and CHAR data does not. If you're using actual product barcodes and they're re...
<s>[INST]Select query from another database using 'exists' Hello, I hit an issue to get data using 'IN' operator from another database. Could you please help me to fix it? My query looks like this: > SELECT i.EXTERNAL_CODE, tc.SITE_NAME, tr.TRANSACTION_DT FROM app4_starlims_data.dbo.INVENTORY i JOIN app4_star...
<s>[INST]Need Trigger for Updating . i have data in table Create table #tbl_GRN_Detail (D_ID int,GRN_ID int,item_code int,Issue_ID int) Insert into #tbl_GRN_Detail values (11001,2001,22,Null) Now i want ,when i insert row into #tbl_issuance ,then Issue_ID value get updated into #tbl_GRN_Detail col Issue...
<s>[INST]MAP error; backup file is not compatible... Hi Microsoft, For years I was able to open .BAK files created by this specific customer. Now when I try to open a .BAK with the same newest version of MAP Toolkit 9.9.13.0 as it also was installed on the customer site, I get the following error; "A failur...
<s>[INST]Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Hi Team, We are getting below error while running query in SSMS: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not r...
<s>[INST]Calculating the completion rates within the same month Hi All, Hope you are doing well..I am trying to calculated the (percentage of) number of escalations that were completed in the same month they were raised.. The combination of ctextid and vbill denotes an escalation ..Raised denotes the datetime they...
<s>[INST]Do Idle Sessions use Resources I am a data analyst/report developer for a very large company. I use SSMS daily. I only have access to certain data; no access to the server, explain plan, or anything like that. The first thing I do each day is to open a copy of SSMS in which I create several global temp tables....
<s>[INST]How to extract date from a long string Hi All, have a long string like below in my column and I need to extract only the date (2021-07-05) from it. Could any one please help Name - Koteswararao vp Department - Prod Location - Hyderabad Domain - ND Job Title - Technical-ABAP Date of ...
<s>[INST]How to encrypt table name and column name in sql server? Hi All, I know column data can be encrypted in sql server. But can anyone please help how can i encrypt table name and column name in sql server. Thanks Chirag[/INST]how can i encrypt table name and column name in sql server. And what's ...
<s>[INST]THe Transaction log for database is full Hello, I been facing below error from last two days. I took full backup and Transaction log backup after that but still some SQL jobs has been failing with below error. Error :- The transaction log for database 'DB' is full due to 'LOG_BACKUP'. [SQLSTATE 420...
<s>[INST]Can one use a where clause inside a partition clause? Is there a way to add a where clause when doing a partition? I have several columns and want to add 2 more column whereby I will only count total status for each origin and Total red status where status color = red only. Create table #Temp ...
<s>[INST]Clear the cache while Stored Procedure session is running What happen if a SP A is running slowly with 5 different session ID (executed 5 times) and that point of a time, I clear the cache of that SP A or I execute sp_recompile for that SP A. Is it all the 5 session ID which is running SP A will start again wi...
<s>[INST]Adding a tuple from a function to table Hi, I am creating a function and I want it to add a tuple from the function to a table-as the question says above :'D- I got the function right but I am missing something...I am missing the part of RETURNS What should I write after RETURNES keyword ? I want t...
<s>[INST]how to distinct parent tag in for xml path in sql server CREATE TABLE temp_xmltable1( Report_id INT, Report_name VARCHAR(6), Report_Gender VARCHAR(1), Report_DOB DATETIME, Transaction_number INT, Transaciont_code VARCHAR(2), Amount INT, Currency\` VARCHAR(3) ); INSERT INTO temp_xmltable1 VA...
<s>[INST]Execute SQL commands stored in database column I have a small bit of SQL that creates a temporary table, #List, with a column "Command". The contents of the Command column are SQL commands ready to execute. I'm beating my head against a wall, trying to: run through the table, one row at a time, execut...
<s>[INST]select Json related value and revert option I Hi, I want one more changes i want display Name related ID --Query1-- create table #CIDValue (Slno int,CID varchar(100)) INSERT INTO #CIDValue (Slno,CID) VALUES (67,'AAA'),(68,'BBB'),(69,'CCC') create table #temp (ID INT,Details nvarchar(2...
<s>[INST]Log growth in simple recovery model My database is in simple recovery mode and log is growing very fast and space in disk is very less. There are 2 transaction is running in My database and the first transaction is running 20 mins earlier than second transaction. Both transaction still running and didn't relea...
<s>[INST]Call SQL Agent Job on different instance I have a SQL Job on a 2008 R2 instance and would like as it's final step to start another SQL job on a SQL 2019 instance. Is this possible?[/INST]You can set up a CmdExec job that connects with SQLCMD to the other instance and runs sp_start_job. You would have create a ...
<s>[INST]How to retrieve actual query plan for a specific stored procedure using Extended Events? Is there an example of how to define an extended event that will capture the actual query plan for a single / specific stored procedure each time it executes? [/INST]You could probably to this by setting up an event s...
<s>[INST]Finding the distinct number of coders and number of encounters completed per day Hi All, Hope you are doing well!... A combination of contextid and visitbillid represents an encounter ...An encounter can be 1) Just coded by one person and then completed 2) coded by one person and then qaed by another person a...
<s>[INST]Restoring SQL Server Database from Drive Image backup Hi, My company runs a database application with MS Access as the front end and MS SQL Server as the back end. I am planning to execute some code that will make changes to a quite a bit of data. This code has not been thoroughly tested. I hope that i...
<s>[INST]JSON - multiple aggregations extremely slow Select col1 ,sum(json_value(json_field,’$.col2’)) ,sum(json_value(json_field,’$.col3’)) ,sum(json_value(json_field,’$.col4’)) ,sum(json_value(json_field,’$.col5’)) ,avg(json_value(json_field,’$.col6’)) ,max(json_value(json_field,’$.col7’)) From table1 ...
<s>[INST]Finding the overall Utilization by month of claim creation Hi All, Hope you are doing well!...I am trying to build a dataset that calculates the number of clients (distinct count of (ctextid,prid) by month of claim creation -> claimcreated field) and the utilization (number of claims created by organizati...
<s>[INST]For every CarID calculate mode of Price within specific date range Hello there, i stuck in problem - Calculate mode Price within specific date range (e.i 2020-21). I think, i was done with the first part of task, but exist next additional condition - "if you have more than one mode, display average price of al...
<s>[INST]Sysadmin - rights to write, modify and drop on all databases? Short question: -Does Sysadmin has the rights to write, modify and drop on all databases that exist on a SQL server? -Really appreciate your answer [/INST]Members of the server role SysAdmin have all unlimited permissions on SQL Server and ...
<s>[INST]Column 'result.result_id' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. I have a query that I have created, when I run it I get these errors: Msg 8120, Level 16, State 1, Line 7 Column 'result.result_id' is invalid in the select list becaus...
<s>[INST]convert nvarchar to int Hi, I have a table like the below CREATE TABLE \[dbo\].\[myCodes\]( \[Code\] [nvarchar] NULL ) ON \[PRIMARY\] GO INSERT \[dbo\].\[myCodes\] (\[Code\]) VALUES (N'T0146') INSERT \[dbo\].\[myCodes\] (\[Code\]) VALUES (N'T0108') INSERT \[dbo\].\[myCodes\] (\[Code\]) VALUES (N'T0...
<s>[INST]How to write query generate unique Id for concate both columns search parts and company id ? I work on sql server 2012 . I face issue I can't generate unique Id from merge or concave both columns Search Parts and Company ID and generated Id must be on column Generated ID to be easier and fast on search so P...
<s>[INST]Columnstore Index and Analytical Queries All, We are looking at using the Data Virtualization layer in SQLServer 2019 BDC to run Analytical Queries against Operational/LOB Systems (Claims Management database, Accounting database). Assuming that I create Non-Clustered Columnstore Index on top of Table...
<s>[INST]Intelli sense for linked server objects Hi, Will intelli sense work for linked server objects ? My searching indicates that its a no. Can someone confirm it ? thanks[/INST]I don't use IIntellinonsense myself, but keep in mind that a linked server could be running Oracle or Postgreas, it could...
<s>[INST]MSDN Forum: Msg 7346, Level 16, State 2, Line 1 PLS HELP What mean this error: OLE DB provider "SQLNCLI11" for linked server "servername" returned message "Row handle referred to a deleted row or a row marked for deletion.". Msg 7346, Level 16, State 2, Line 1 Cannot get the data of the row from ...
<s>[INST]How to Change datatype of all column to Unicode datatype for all base table in a database Due to storing values from language specific diacritics (Spanish, French, German) I am trying to change the datatype of a column to Unicode datatype. β€’ Varchar to nvarchar β€’ char to nchar So all column datatyp...
<s>[INST]does cdc get affected by sql server restart we have a couple of databases and tables that are enabled for cdc. would restarting the sql server affect the cdc enabled databases or tables in any way. please guide. thanks [/INST]What do you mean with "affected"? It would be quite a bad feature...
<s>[INST]SQL Server Converting Date, Time to UNIX Epoch time (Pre-SQL 2016) I am currently trying to convert SQL server (2008 R2 and 2012) audit logs from .sqlaudit file to csv/json/txt via PowerShell sqlcmd command. There is no issues doing this. Something like this: Invoke-sqlcmd -ServerInstance ...I -Query "SEL...
<s>[INST]Can I have different versions of a stored procedure in DACPAC deploy based on the SQL Server version level due to syntax changes? I have a few stored procedures that will require slightly different but critical syntax for option hints added to some version of SQL server but these would be unrecognized and erro...
<s>[INST]Run DB restore and backup at same time? Hello, say I have the following scenario: 1 - Perform a long running restore of a large DB (from a backup of another SQL Server as source) with brand new name (this DB doesn't yet exist on target SQL Server) i.e. starts at 9pm takes two hours to complete restore ...
<s>[INST]How to return results where (row by row) column 1 data must be different from column 2 in SQL server Hi everyone I need to work out how to return results on two columns where (row by row) column 1 must be different from column 2 and both columns also need to contain distinct values (in SQL server) ...
<s>[INST]Read-Only Replica between a Standard Edition and Enteprise Edition We have 2 servers, one with standard edition and one enterprise edition of SQL Server. We would like a couple of databases in the standard edition be replicated (for read-only purposes) into the 2nd server with the enterprise edition. ...
<s>[INST]Finding the difference between datetimes excluding sundays and Business holidays Hi All, Hope you are doing well!... I am trying to find the difference in the date times between the assign datetime and the completed datetime for a task completion (in hours and minutes) identified by the combination of ctextid...
<s>[INST]SQL Server Express 10GB Limit - Total DB size or Used DB size? SQL Server Express 10GB Limit - Total DB size or Used DB size? Couldn't find a straight answer anywhere and it it quite important for my monitoring purposes. How does the 10GB limit apply with SQL Express? I.E. as soon as the DB grow...
<s>[INST]Case When ISNULL Hi, I have the following Case statement, but my logic doesn't seem to work, any idea why this is please? case when method = 'TP' and second_method ISNULL then 'New' end as Method_Type This is my error message: An expression of non-boolean type specified in a context wher...
<s>[INST]DateDiff Error Hi, I have a DATEDIFF query but upon executing my code, I get an error message that I am unsure how to resolve, any ideas please? Arithmetic overflow error converting expression to data type datetime.**strong text** DATEDIFF(month, Comp_Date, Down_Date) AS Months_to_end ...
<s>[INST]Strange Login and AppDomain xx created On a sql 2k16, when I go through error logs, I find a lot of messages las follows Server Date Process Count Text SQL2K12 2021-03-15 13:30:44.640 spid17s 1 AppDomain 39 (MDS.mds_schema_user[runtime].38) unloaded. SQL2K12 2021-03-15 13:00:15.550 spid62 1 Ap...
<s>[INST]can i use over clause after having on sql server 2012 ? can i use over clause after having on sql server 2012 ? I have technical question can i use over clause over count on having clause as example select partid,product from product having count(partid) over are this valid please answer...
<s>[INST]GMSA, MSA for SQL Server Need to find out if I can configure managed service account to run SQL server and agent services? I know GMSA is not available for 2008 r2 with SQL 2008 R2, is MSA an option? How about Windows 2012 and SQL 2012 (and R2 versions as well) Thanks [/INST]\> I know GMSA is not ...
<s>[INST]SQL Server 2008R2 Security Update 10.50.6560.0 Does SQL Server 2008R2 Security Update 10.50.6560.0 (Meltdown/Spectre) include the TLS1.2 update 10.50.6542.0? I can see the TLS1.2 update is a lower build number, but I can't find anywhere that states that the higher update includes the lower one(s) - there'...
<s>[INST]Inner Join using SQL SMS Hi. Noob here trying to figure out SQL SMS queries. I'm trying to take a query that works in MS Access and use it in SQL Server Management Studio. I start getting syntax errors at the "inner join". If I just run the first select-from-where statement all is good, but after I add th...
<s>[INST]MSSQL Audit Log I renamed sa account and disabled. Why my audit log showing sa activities? EventTime server_principal_name session_server_principal_name statement 14-11-20 0:56 sa What is this entry for sa account because I don't have sa account[/INST]Please execute the foll...
<s>[INST]Kill DB backup process? Hello, will sending a KILL/terminate command potentially corrupt/negative impacts during a long running large DB BACKUP ? Thanks in advance.[/INST]Are you trying to kill the process of backup? If yes, you can kill it, the operation will not impact Databases, but you have to be caut...
<s>[INST]Cast a varchar field with mixed time format to time (0) Hi I have a [time] field- varchar datatype and it has got values in mixed formats as below 14:24:00 07:00.0 10:00:56.7730000 54:80.0 (exclude wrong format) I am trying to cast the field as time (0) but it is causing conversion error. ...
<s>[INST]Adding or Deleting a Login Fails with xp_cmdshell Error I have such a weird issue. I have a brand new SQL2019 FCI with CU9 and I can't add or delete logins without having xp_cmdshell enabled. If it isn't I get this error when trying to delete/add/disable etc a login:- SQL Server blocked access to procedu...