Here's a few of the new posts today on the forums. To see more, visit the forums.
|
SQL Server 2017 - Administration |
backup to blob azure with sa account - Good morning all I must make backup to Azure BLOB URL Can I do this type of backup with the SA account or do I need a specific account? thank you for your explanation |
SQL Server 2017 - Development |
How can I improve its query speed? - Hi, I am facing an extremely slow result from below script. Can anyone advise how can I improve its query speed? Thanks in advance, Wilson SELECT d.part_code, x1.part_desc, x1.specification, d.odr_ref, d.dbcode, crcode, d.ref_no, d.date, d.source, d.unit_cost, d.lot_no, d.wh_code, d.part_loc, d.shelf_loc, 0 as qty_open, CASE WHEN (d.source LIKE 'R%') THEN d.qty ELSE 0 END AS qty_in, […] |
SQL Server 2016 - Development and T-SQL |
How to get RowCount and ResultSet from CTE - Hi, I have this query CREATE TABLE #Summary(SourceQueryRowCount INT, TargetQueryRowCount INT, QueryDiffRowCount INT) CREATE TABLE #CompareResult(DataSource varchar(50), ID int, Rule1 varchar(50), Rule2 varchar(50)) ;WITH SourceQuery AS( SELECT * FROM (VALUES( 1, 'a','b'),(2, 'c','d'),(3,'e','f'))rs(id,rule1,rule2)WHERE rs.rule1 != 'a'), TargetQuery AS ( SELECT * FROM (VALUES( 1, 'a','b'),(2, 'c','d'),(3,'e','f'))rs(id,rule1,rule2) ) INSERT INTO #CompareResultSELECT DataSource = 'SourceToTarget', * FROM SourceQuery EXCEPT […] |
Joining a table based on date range - Case Statement? - Okay - Two tables one transnational table with a standard document date Second table is financial fiscal period table that is 'not standard calendar months'. CREATE TABLE [dbo].[Sales]( [SOPTYPE] [smallint] NOT NULL, [SOPNUMBE] [char](21) NOT NULL, [DOCAMNT] [numeric](19, 5) NOT NULL, [DOCDATE] [Date] NOT NULL ) INSERT [Sales] Values ('6', 'SOP105','0.00','2020-08-30'), ('6', 'SOP101','1250.00','2020-01-16'), ('6', 'SOP102','200.00','2020-09-10'), […] |
Development - SQL Server 2014 |
Compare data with previous period - Hi All, I want to compare data of current period with previous period. sample table n data is below. create table #tempdata ( Country varchar(50), Fiscal_year varchar(50), Posting_period varchar(50), Amount float ) insert into #tempdata(Country,Fiscal_year,Posting_period,Amount) values ('IND' ,'2020' ,'006' ,30410.6) ,('IND' ,'2019' ,'005' ,5711.44) ,('IND' ,'2020' ,'005' ,10909.2) ,('IND' ,'2019' ,'004' ,10641.7) ,('IND' ,'2020' ,'004' […] |
Index build spilling to tempdb - Hi, I'm building nonclustered indexes on a table, and the execution plan is showing the sort spilling to tempdb. The estimated data size going into the sort is 15GB (this is accurate, all fixed-width columns, row counts correct). The properties of the plan show that granted memory was 21817320 (so about 20GB), but desired memory […] |
SQL 2012 - General |
Can't update status to match characters in case of signature key value is stars? - I work on SQL server 2012 I face issue : I can't update status to match characters where signature key have stars * . I need to update status to match characters where signature key have starts as example Signature Key Group Id Portion Key Status *$*$**s$***$**$**$* 3 12s Match Characters group id 3 from […] |
SQL Server 2019 - Administration |
Any 2014 to 2019 migration issues? - Hi, Were planning a migration from 2014 to 2019 soon, and were wondering if anyone has experienced any particular issues we should watch out for. At the moment our databases are in a mix of compat 100 and 120, and will initially remain so after the upgrade, after which we'll be testing for a compat […] |
backup database in alwayson - Hello everyone I need to transfer a database configured on alwayson from one datacenter to another What would be the best practice to back up this database in other words, should I remove my database from alwayson before doing l save operation? Thank you |
SQL Server 2019 - Development |
SQL Help Beginner - Hello, I don't know if this is a place to ask for help, if it isn't, please point me in the right direction. I just started doing SQL server today, I know I need a "WHERE" statement but I don't know WHERE to put it in my code. Can anyone help me out? |
Export to text file for specific row inserted - I am looking for a solution to export the sql rows to a text file in a path when the database insert meets particular condition. I need one text file for each row. I don't need a text file for all the rows. Need text file output only when the database insert happens for my […] |
SQL query question - I'm trying to create a "smart agent" feature in my website. A user can search for ads by some criteria, and then save his search as a "smart agent". When a new ad is added that matches his criteria he will get an email. For example, I have 3 tables: 'Ads' table: columns: recordID(int), […] |
SQL Server 2008 - General |
Extended Event collect sql text executed - Dear Coallegues, I am trying to configure an extended event session in order to capture parameters executed with a specific stored procedures in a specific database, without results: It is not possible use Profiler Please help, thanks for any idea CREATE EVENT SESSION [9999] ON SERVER ADD EVENT sqlserver.rpc_completed ( ACTION ( sqlserver.database_id, sqlserver.session_id, sqlserver.username, […] |
SQL Azure - Development |
Real time sync from One SQL server to another - Hi All, Please forgive me if this is a simple query but im pretty new to all of this. I am working with a company who are developing an app for us. My manager would like to explore the idea of being able to live sync the data from their database to our database so […] |
Integration Services |
SSIS Send Mail task permissions - I'm having a forgetful moment while migrating packages from an existing SSIS server (ServerA) and a new one (ServerB). One of my packages uses the Send Mail task to create a file and email it. Pretty basic. It runs in Visual Studio and as a SQL: Agent job on ServerA without any issues. When testing […] |