Is there a way to find what "Feature Selection" has been installed on an existing SQL Server?
JSON to SQL
Hi,
My text file is not in complete json format so i loaded the text file into sql and removed unwanted characters and changed to complete json format.
After that i tried to split nested element into invidual column,column also splitted as planned but values not inserting into column it comes all come values as null.i don't know why?
Are there any downsides to applying SQL server SP's and CU's via SCCM, alongside windows updates
Hi
We currently apply SQL server Sp's manually, to allow for certain level of testing. However this often gets delayed and presumably means that we are not applying the latest security fixes as often as we would like.
We do however, apply windows updates (via SCCM) every month, automatically, and are thinking of applying SQL server SP's and CU's automsatically at the same time. Can anyone see any downside re this ?
As I understand it , since 2016 , microsoft are recommending that you pro-actively patch:
Do security fixes for SQL server (GDR's ?) only get installed as part of SP's or CU's ? i.e. is there a way just to automatically apply GDR's
Regards
G
SQL Server on Linux on IBM Power9
Hello,
SQL Server is certified to run on Red Hat 7.4, Red Hat 7.4 is certified to run on IBM Power 9. Is SQL Server able to run on IBM Power 9 ?
Thank you
SQL Server 2008 R2 Error occurring when trying to attach database
Hi, I'm having trouble attaching a database and do not know how to log on as a 'sa' as it was stated would be a fix. Below is the error message.
===================================
Attach database failed for Server 'LARRY-PC\SQLEXPRESS'. (Microsoft.SqlServer.Smo)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1540+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Smo.Server.AttachDatabase(String name, StringCollection files)
at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabaseData.PrimaryFile.Attach()
at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SendDataToServer()
===================================
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQuery(StringCollection queries)
at Microsoft.SqlServer.Management.Smo.Server.AttachDatabaseWorker(String name, StringCollection files, String owner, AttachOptions attachOptions)
at Microsoft.SqlServer.Management.Smo.Server.AttachDatabase(String name, StringCollection files)
===================================
Unable to open the physical file "C:\Murach\SQL Server 2008\Databases\AP.mdf". Operating system error 5: "5(failed to retrieve text for this error. Reason: 15105)". (.Net SqlClient Data Provider)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476
------------------------------
Server Name: LARRY-PC\SQLEXPRESS
Error Number: 5120
Severity: 16
State: 101
Line Number: 1
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
SQL server Backup Issue
Hi All,
we are facing database slowness and I/O issue during SQL server database backup period on Production server. Application team is informing line are not update during the backup time and drive I/O are high.
Total database size is 699 GB. Some time backup is complete with in 4 Hours. some time it will take 6 hrs.
This is issue happen more than month and application is very slow.
Regards,
karthik B
Restoring a 2014 database
Just need some advice, we have a copy of a 2014 database and would like to restore it on a 2012 box.
Firstly, is this possible? because we are getting the following error message.
The media family on device "xxxx.bak" is incorrectly formed. SQL Server cannot process this media family.
Why is this happening?
DMA 4.1 shows breaking changes.. Will upgrade fail or be success?
I am planning to upgrade SQL 2016 instance to SQL 2017.
I have several databases showing breaking changes related to CLR assemblies and table hints, if the compatible changes to 140.
We are planning to do an inplace upgrade, I guess during this, the upgrade process will attempt to change the compatibility level to 140.
My question is, will these reported breaking changes cause the upgrade to fail to due being incompatible ?
Or will the upgrade complete successfully but the reported changes wont work anymore?
Sorry im i am not clear.
According to this link
https://blogs.msdn.microsoft.com/datamigration/2018/10/16/announcing-assessments-on-premises-sql-server-migrating-to-azure-sql-database-managed-instance-using-dma-4-1/
"DMA also identifies compatibility issues related to the following areas:
Breaking changes: The specific schema objects that may break the functionality migrating to the target database. We recommend fixing these schema objects after the database migration."
But im not sure if that means for inplace upgrade or, backup restore or rolling upgrade etc..
thanks if anyone can clarify for me..
I dont want to do the inplace upgrade and break the instance/database.
ilikefondue
Tune Query
hi,
below one takes 3min to complete, can anyone give tuned one?
select
isnull(categories,'[N/A]') Category,
isnull(u.fullname,'[Main Box]') Agent,
dbo.f_get_period_formatted_date( 'Daily',
case
when es.status='open' then getdate()
else lu.last_updated
end) Period,
e.id,
e.subject,
es.Status,
dbo.f_business_hours(e.received, isnull(case when cd.directory_type='completed' then lu.last_updated end,getdate())) response_time
From Commu_email e
left join Commu_directories cd on cd.id = e.directory_id
join v_Commu_email_status es on es.id = e.id
left join Commu_user u on u.id = e.owner
join (
select e.id,
max(isnull(ea.ts,e.last_updated)) last_updated
from Commu_email e left join Commu_email_activity ea on ea.email_id = e.id and ea.activity_type not in('Modified')
group by e.id
) lu on lu.id = e.id
where isnull(cd.account,'') not in('blindcc')
and isnull(e.directory_id,0) not in(49) --SYSTEM DELETE EXCLUDED
and
case
when es.status='Open' then 1
--when e.received between @from and @to then 1
when lu.last_updated between '11/12/2018' and '11/13/2018' then 1
else 0 end = 1
), b as (
select category, agent, Period, '1Open' Action, count(id) Total from a where status='Open' and 'Open' in (N'Open',N'Completed') group by Category,Agent,Period
union
select category, agent, Period, '2Completed' Action, count(id) Total from a where status='completed' and 'completed' in (N'Open',N'Completed') group by Category,Agent,Period
union
select category, agent, Period, '3Deleted' Action, count(id) Total from a where status='deleted' and 'deleted' in (N'Open',N'Completed') group by Category,Agent,Period
union
select category, agent, Period, '4Avg Time' Action, avg(response_time) from a where 'avg' in (N'Open',N'Completed') group by Category,Agent,Period
)
select * From b
Collation problem
Hi, We happen to have different collation between the databases and we usually use collate keyword to make sure the queries successfully run. We fixed the collation to match between all the databases, But we are still getting the collation related error messages when we run below query. Both OrderDB and CT_OrderDB are in the same collation , here is the error message:
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_BIN" in the equal to operation.DECLARE @rowcounts TABLE (mergeaction nvarchar(10)); DECLARE @insertcount int, @deletecount int; MERGE [OrderDB].[dbo].[order] AS P USING (SELECT order_number, wh_id, priority_score, threshold_type_id, updated_date, SYS_CHANGE_VERSION, SYS_CHANGE_OPERATION FROM [CT_OrderDB].[dbo].[Order_495962]) AS CT ON (P.order_number = CT.order_number AND P.wh_id = CT.wh_id) WHEN MATCHED AND CT.SYS_CHANGE_OPERATION = 'D' THEN DELETE WHEN MATCHED AND CT.SYS_CHANGE_OPERATION IN ('I', 'U') THEN UPDATE SET P.priority_score=CT.priority_score, P.threshold_type_id=CT.threshold_type_id, P.updated_date=CT.updated_date WHEN NOT MATCHED BY TARGET AND CT.SYS_CHANGE_OPERATION IN ('I', 'U') THEN INSERT (order_number, wh_id, priority_score, threshold_type_id, updated_date) VALUES (CT.order_number,CT.wh_id,CT.priority_score,CT.threshold_type_id,CT.updated_date) OUTPUT $action INTO @rowcounts; SELECT @insertcount = COUNT(*) FROM @rowcounts WHERE mergeaction IN ('INSERT', 'UPDATE'); SELECT @deletecount = COUNT(*) FROM @rowcounts WHERE mergeaction IN ('DELETE', 'UPDATE'); DELETE @rowcounts; SELECT @insertcount AS insertcount, @deletecount AS deletecountand I double checked the collation, is there anyway it might be cached? Thank you!
Connect to on prem SQL Server 2016 using IP Address not Server name
I am trying to connect looker to SQL Server and need to pass IP address of my laptop and port number to establish communication.
Have already done the following:
- opened firewall port 1433 for inbound traffic
- enabled TCPIP as a protocol for my default 2016 instance
- set the TCP Port for 1433
- restarted services
- configured SQL Server to accept remote connections
- setup sql authenticated user "looker" as sysadmin
- Entered following into "Server Name" in "Connect To Server" dialog - "//##.##.###.###,1433 "
- Selected following into "Network Protocol" in "Connection Properties" dialog - "TCP/IP"
This is to test that I can connect locally using the ip address prior to attempting to do same through looker.
Keep receiving this error below - have tried not supplying port number after IP, removing "//", adding "http://" before IP address. If anyone has pulled this off I would be glad to hear!
"
------------------------------
ADDITIONAL INFORMATION:
cache plan pressure limit
I'm doing some research about the local memory pressure limit and as I understand it (simply put), the local pressure limit is calculated as follow on SQL Server 2106: 75% of target memory between 0 - 4GB + 10% of target memory between 4 - 64GB + 5% of target memory > 64GB.
When a cache store reaches 62.5% of the pressure limit entries are removed from the store. SQL Server uses a CLOCK algorithm with two hands (INTERNAL and EXTERNAL) to remove those entries.
I checked my research on a SQL Server 2016 SP1 CU3 with a target memory of 24GB but I think there is a mistake in my research. Using the above info the pressure limit is 5GB and entries should get removed from a cache store when it reaches 3.2GB.
I used the dm_os_memory_cache_clock_hands DMV to check when the clock hand moved. When I checked dm_os_memory_cache_counters I saw that entries got removed when pages_kb was aprrox 3140MB.
Can somebody check if my research is correct and explain why entries are getting removed when pages_kb is aprrox 3140MB?
error: 22123, severity: 16, state: 1 after installing SQL Server 2014 SP3
Hi,
After installing the new SP3 for SQL Server 2014, we keep getting the error: 22123, severity: 16, state: 1 - "Change Tracking autocleanup is blocked on side table of <TABLE>. If the failure persists, check if the table <TABLE> is blocked by any process.
I found a related issue with installing the latest SPs with SQL Server 2016 and 2017. However, this is now resolved with a CU for each of the versions.
It looks to me like a bug in the newer SPs of each version. However, I don't know why a CU was not released for SQL Server 2014. Can anyone confirm or provide more information into this?
Thank you in advance for any assistance.
Cheers,
Rocky
databases are not in use
we want to know the databases which are not accessed by users/login form 180days/1year.
Kindly some one help me if we have any script to get this result.
How can see which index used or not used
Hi
How can see which index used or not used in sql server 2012?
thanks
SQL Server 2016 SP1 crashes after installing CU6
Hi,
After installing CU6 in a production SQL Server 2016 SP1 Standard, I received 2 crashes of the system in the first 12 hours. In the log file I can read:
2017-11-27 13:17:48.08 Server **Dump thread - spid = 0, EC = 0x0000000000000000
............
and in the sqldump..txt file
Memory
MemoryLoad = 84%
Total Physical = 28671 MB
Available Physical = 4586 MB
Total Page File = 33023 MB
Available Page File = 8514 MB
Total Virtual = 134217727 MB
Available Virtual = 134174939 MB
.............
I can understand that I am not providing much information, but just wanted to share this fact in case other users have experienced the same behavior.
Thank you,
Dimitris
Error with Connecting to SQL Server
I always get the error 53 when connecting to the remote server. (The Server was not found or was not accessible.)
How to resolve it.
Thanks in advance.
I have some questions which i need to solve.
1.
A query which has previously been performing well suddenly starts to take a very long time to execute, based on the information contained in the actual execution plan fragment below, what would your next steps be?
<o:p></o:p>
2.
You need to produce a report which shows the highest and second highest bidders for various auctions. Sample data for a single auction is included below (In the table you are reporting against there is data for multiple auctions). How might you write a query to return (for each auction):
• The highest bid and the second highest bid
• The time difference between the highest bid and second highest bid
You don’t need to write SQL, just indicate the general methods & techniques you might use.
AuctionID | BidAmount | BidDate | UserID |
15410 | 42559.23 | 16/11/2012 19:38 | 41 |
15410 | 23613.12 | 16/11/2012 19:16 | 2 |
15410 | 18000.00 | 16/11/2012 19:13 | 16 |
15410 | 15249.94 | 16/11/2012 18:38 | 9 |
5. Explain the best use cases for denormalised data.
6.
You see this table in the database. What criticisms do you have of how the data is stored and what would you change?
<o:p></o:p>
Please provide me the answers of above.
SQL server questions regarding queries.
1.
A query which has previously been performing well suddenly starts to take a very long time to execute, based on the information contained in the actual execution plan fragment below, what would your next steps be?
<o:p></o:p>
2.
You need to produce a report which shows the highest and second highest bidders for various auctions. Sample data for a single auction is included below (In the table you are reporting against there is data for multiple auctions). How might you write a query to return (for each auction):
• The highest bid and the second highest bid
• The time difference between the highest bid and second highest bid
You don’t need to write SQL, just indicate the general methods & techniques you might use.
AuctionID | BidAmount | BidDate | UserID |
15410 | 42559.23 | 16/11/2012 19:38 | 41 |
15410 | 23613.12 | 16/11/2012 19:16 | 2 |
15410 | 18000.00 | 16/11/2012 19:13 | 16 |
15410 | 15249.94 | 16/11/2012 18:38 | 9 |
5. Explain the best use cases for denormalised data.
6.
You see this table in the database. What criticisms do you have of how the data is stored and what would you change?
<o:p></o:p>
Please provide me the answers of above.