Here's a few of the new posts today on the forums. To see more, visit the forums.
|
SQL Server 2017 - Development |
Need to Display date wise sales summary. - Hi, I have created a stored procedure like follows select issuedate, SUM((CASE WHEN ISNUMERIC(netpayable)=1 THEN CONVERT(MONEY,netpayable) ELSE 0 END) ) AS TotAmt from tbktym_TicketPrimeDetails where LEFT(CONVERT(DATETIME,issuedate,103),12)>=LEFT(CONVERT(DATETIME,'01-02-2020',103),12) and LEFT(CONVERT(DATETIME,issuedate,103),12)<=LEFT(CONVERT(DATETIME,'03-02-2020',103),12) and cstatus='billed' and branchid=1 group by issuedate The result is showing like 2020-02-03 00:00:00.000 252397.86 2020-02-02 00:00:00.000 500.00 2020-02-01 00:00:00.000 401757.00 2019-02-03 00:00:00.000 119547.00 2019-02-02 00:00:00.000 395913.00 […] |
Selecting data between just month and year - I know how to get data between just startdate and enddate, but I need to select it between just month and year, start month is previous July and current year, so for example, July 2019(startdate) and April 2020(enddate). I am having issues with the between, not sure how to format it. can anyone provide assistance? […] |
SSIS Export Help - Hi, Can someone show me (if its possible) how to create an ssis package to take the servername, tablename and todays date as parameters and export this table to a filename with todays date (formatted Filename_ddmmyyy.csv). I've managed to get the dynamic filename but its hard coded to the table and i don't understand how […] |
create new table from two others but have consistent date ranges - Hi all, I need your help. This sounds like a simple problem but it's driving me round the bend. I have two tables that are not technically joined but have a common data column (country) used across the two tables. Each table has a Start/End date. I am trying to merge the data into a […] |
SQL Server 2016 - Administration |
AlwaysON cluster suggestion - Hi All, Following is the current setup 2 node OS cluster with AG on different location, primary node if physical and secondary is VM. I would like to move from physical to virtual and from 2 node to 3 node - On primary site 2 node as HA and third node as DR. Which will […] |
SQL Server 2016 - Development and T-SQL |
Pefromance help for transaction derrivation - Hi, Can anyone help me in fine tuning this or any other suggestions also.I have a table which will have a set of transactions and reference transactions if any. I am creating a job to purge transactions based on some conditions like date , full completed based on a status etc. If a single transaction […] |
Administration - SQL Server 2014 |
Extended Event To Capture Proc Execution - I configured an extended event to capture the time procedures are executed and below is what I have so far CREATE EVENT SESSION [PROC_EXEC] ON SERVER ADD EVENT sqlserver.sp_statement_completed(SET collect_object_name=(1),collect_statement=(0) ACTION(sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.database_id,sqlserver.database_name,sqlserver.username) WHERE ([package0].[equal_uint64]([object_type],(8272)) AND [sqlserver].[not_equal_i_sql_unicode_string]([sqlserver].[database_name],N'master, model, tempdb, msdb, UserDB1, UserDB2'))) ADD TARGET package0.event_file(SET filename=N'C:\PROC_EXEC.xel',metadatafile=N'C:\PROC_EXEC.xem') WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=OFF,STARTUP_STATE=OFF) GO I'm having a few issues […] |
Development - SQL Server 2014 |
I want to find header row dynamically and create table schema with that header. - CREATE TABLE [dbo].[NewTable1]( [18/10/2020 date] [nvarchar](255) NULL ) ON [PRIMARY] GO INSERT [dbo].[NewTable1] ([18/10/2020 date]) VALUES (N'This is test file') INSERT [dbo].[NewTable1] ([18/10/2020 date]) VALUES (NULL) INSERT [dbo].[NewTable1] ([18/10/2020 date]) VALUES (N'20-20-2020') INSERT [dbo].[NewTable1] ([18/10/2020 date]) VALUES (NULL) INSERT [dbo].[NewTable1] ([18/10/2020 date]) VALUES (N'ID,name,sal') INSERT [dbo].[NewTable1] ([18/10/2020 date]) VALUES (N'10,mahi,2000') INSERT [dbo].[NewTable1] ([18/10/2020 date]) VALUES […] |
Convert VBA function to SQL function - I have VBA function need to convert to SQL function. Kindly help me change it. Here is a snippet of the code. Public Function VniToUni(str$) As String Dim VNI$, UNI$, i&, sUni$, arrUNI() As String VNI = "aù,aø,aû,aõ,aï,aâ,aê,aá,aà,aå,aã,aä,aé,aè,aú,aü,aë,AÙ,AØ,AÛ,AÕ,AÏ,AÂ,AÊ,AÁ,AÀ,AÅ,AÃ,AÄ,AÉ,AÈ,AÚ,AÜ,AË,eù,eø,eû,eõ,eï,eâ,eá,eà,eå,eã,eä,EÙ,EØ,EÛ,EÕ,EÏ,EÂ,EÁ,EÀ,EÅ,EÃ,EÄ,í ,ì ,æ ,ó ,ò ,Í ,Ì ,Æ ,Ó ,Ò ,où,oø,oû,oõ,oï,oâ,ô,oá,oà,oå,oã,oä,ôù,ôø,ôû,ôõ,ôï,OÙ,OØ,OÛ,OÕ,OÏ,OÂ,Ô ,OÁ,OÀ,OÅ,OÃ,OÄ,ÔÙ,ÔØ,ÔÛ,ÔÕ,ÔÏ,uù,uø,uû,uõ,uï,ö ,öù,öø,öû,öõ,öï,UÙ,UØ,UÛ,UÕ,UÏ,Ö ,ÖÙ,ÖØ,ÖÛ,ÖÕ,ÖÏ,yù,yø,yû,yõ,î ,YÙ,YØ,YÛ,YÕ,Î ,ñ ,Ñ " […] |
SQL 2012 - General |
TDE doubts - Hi All, As a part of security compliance are in a process of implementing TDE on all of the prod servers. Server version is SQL 2012 SP4 Enterprise Edition. Followed below steps : -- create Database master key(DMK) in "master" database -- create Certificate in "master" database -- backup the master key and certificate -- […] |
SQL Server 2019 - Development |
Object naming - I have a pretty "dumb" question, but I want to get the consensus on this I have a table that is going to store Location data (address, geocoding, etc). Location is a reserved word in SQL Server and I have always lived by "do not pluralize a object name". Anyone have suggestions on naming […] |
Constraint in a column - Hi, I have a requirement where my table (ex: TableA having columns Tranno , Trandate, Itemno). Tranno can be repeated in this table as it may have multiple Itemno for one Tranno. But Trandate needs to be only one value for one particular TranNo. Here i need to build a constraint such that for one […] |
Analysis Services |
Migration from Multidimensionnal Cube to Tabular Model - Hello I'm working on a migration from an on premise ssas multidimensionnal cube to an azure analysis services tabular model. Is there a way , a method or a tool to do it quickly and efficiently? It's a large cube and it will take time to develop it from scratch with tabular model. Thank you […] |
Dim trying to process deleted attribute - Hi all We have a Dim table with an attribute that's causing us problems. We want to delete the attribute while we work on it but it won't disappear. To delete it, we've found the Dim, opened it and deleted the attribute using right-click/delete. We did uncover an issue where, if you check […] |
Integration Services |
Dynamic Scheduling of a SSIS Step - Hi All, I need a favor, regarding the below topic: I have an SSIS to update a table on multiple servers and there is a requirement to run the updates (daily/weekly or Monthly) configured in a table on the basis of the different country(CorpRegionID) & Vendor(VendorID). Table structure: Could you please suggest me the […] |