Here's a few of the new posts today on the forums. To see more, visit the forums.
|
SQL Server 2017 - Administration |
ERROR: Could not find a login matching the name provided - Okay. This is an odd one that I can't quite figure out. I hope someone can advise. A user was having issues logging into a server with a new AD account. One of my coworkers verified the login was part of windows groups which had access to the server. For kicks and giggles, I added […] |
Uploading 1 M file contents to SQL Server - Hi, How to upload large file contents in to sql server when there is no file stream enabled? Received the following error MSG>[Microsoft][ODBC SQL Server Driver] Warning: Partial insert/update. The insert/update of a text or image column did not succeed. |
SQL Server 2016 - Development and T-SQL |
How to Refactor Code with CTE - Hello Community, Can someone show me how to refactor the following code with CTE's? My platform doesn't support CTE's WITH CTE1 AS ( SELECT *,ROW_NUMBER()OVER(ORDER BY ts_primarysecondaryfocus)RowNum FROM [dataverse_montagu_org5a2bcccf].[dbo].[account] ),CTE2 AS ( SELECT *,ROW_NUMBER()OVER(ORDER BY ts_primarysecondaryfocus)RowNum FROM [dbo].[OptionsetMetadata] ) SELECT C1.Id,C1.SinkCreatedOn,C1.SinkModifiedOn,C1.statecode,C1.statuscode, CASE WHEN ISNULL(CAST(C1.ts_primarysecondaryfocus AS VARCHAR(50)),'') <> ISNULL(CAST(C2.ts_primarysecondaryfocus AS VARCHAR(50)),'') THEN CAST(C2.ts_primarysecondaryfocus AS VARCHAR(50)) ELSE CAST(C1.ts_primarysecondaryfocus AS VARCHAR(50)) END AS ts_primarysecondaryfocus ,C1.customertypecode,C1.address1_addresstypecode,C1.accountclassificationcode,C1.ts_easeofworking ,CASE WHEN ISNULL(CAST(C1.ts_ukrow AS VARCHAR(50)),'') <> ISNULL(CAST(C2.ts_ukrow AS VARCHAR(50)),'') THEN CAST(C2.ts_ukrow AS VARCHAR(50)) ELSE CAST(C1.ts_ukrow AS VARCHAR(50)) END AS ts_ukrow FROM CTE1 C1 LEFT JOIN CTE2 C2 ON C1.RowNum = C2.RowNum Thank you |
Going after my MCSA SQL Server 2016 and need MOC recommendations. - As above. My employer has allocated $5,000 for my education in this budget and I have to use it or lose it. I want to get my MCSA for SQL Server 2016 and am trying to pick a MOC provider. TechSherpas is desirable on paper because of the exam voucher you get and access to […] |
Error converting data type varchar to bigint. - Hello Community, I'm getting the following SQL error in Azure Synapse Error converting data type varchar to bigint. ;WITH CTE1 AS ( SELECT *,ROW_NUMBER()OVER(ORDER BY ts_primarysecondaryfocus)RowNum FROM [dbo].[account] ),CTE2 AS ( SELECT *,ROW_NUMBER()OVER(ORDER BY ts_primarysecondaryfocus)RowNum FROM [dbo].[OptionsetMetadata] ) SELECT C1.Id,C1.SinkCreatedOn,C1.SinkModifiedOn,C1.statecode,C1.statuscode ,CASE WHEN C1.ts_primarysecondaryfocus<>ISNULL(C2.ts_primarysecondaryfocus,'')THEN C2.ts_primarysecondaryfocus ELSE C1.ts_primarysecondaryfocus END AS ts_primarysecondaryfocus ,C1.customertypecode,C1.address1_addresstypecode,C1.accountclassificationcode,C1.ts_easeofworking ,CASE WHEN C1.ts_ukrow<>ISNULL(C2.ts_ukrow,'')THEN C2.ts_ukrow ELSE C1.ts_ukrow END AS ts_ukrow ,C1.preferredappointmenttimecode,C1.xpd_relationshipstatus,C1.ts_relationship FROM CTE1 C1 LEFT JOIN CTE2 C2 ON C1.RowNum = C2.RowNum The problem is, I don't know why Azure Synapse is trying to convert the Data Type to BIGINT. Also, I don't know how to […] |
Administration - SQL Server 2014 |
SQL Server 2014 Service Packs? - I noticed that there's SQL Server 2014 Service Pack 2 CU4 and Server Pack 3 CU18 in WSUS.. KB's 4500180 and 4500181 respectively. I am a LITTLE hesitant to install these,, as the old adage, if it aint broke, don't try to fix it,, however, i'm wondering if i don't install these, will I potentially […] |
Filter Pivot Table - Hi I have below query & i want to filter data on 2 parameters Create PROC USP_Book ( @ID VARCHAR(500), @SID VARCHAR(500) ) AS BEGIN declare @cols as nvarchar(max)=''; declare @query as nvarchar(max)=''; select @cols = @cols + QUOTENAME(SName) + ',' from (Select distinct SName from View_Book) as tmp select @cols = substring(@cols,0,len(@cols)) set @query […] |
Query - Hi I have data like below. Brands can be dynamic Loc1 Brand Qty Value Loc1 Omega 10 1000000 Loc2 Swatch 5 […] |
Incorrect syntax near the keyword end - Create PROC [dbo].[SP_Planning] AS BEGIN Truncate TABLE Planning Select * into Planning from (select T0.ID,T1.SID,[dbo].[Planning](T1.Id,T0.SId) as Status from BDetails T0 cross join SDetails T1) END |
SQL Server 2019 - Administration |
Conversion failed when converting the varchar value - Hi Error - Conversion failed when converting the varchar value '+ cast(@BookId as varchar(Max))+' to data type int. ALTER PROC [dbo].[USP_Session] --'0','20,21,22' ( @BookID VARCHAR(500), @StudentID VARCHAR(500) ) AS BEGIN with ROWCTE as ( SELECT * from View_Session where BookID IN('+ cast(@BookId as varchar(Max))+') ) SELECT * FROM ROWCTE Thanks |
Incorrect syntax near 0 - BookId & StudentId has int DataType ALTER PROC [dbo].[USP_SessionBookPlanningSearch] --'0','20,21,22' ( @BookID VARCHAR(500), @StudentID VARCHAR(500) ) AS BEGIN with ROWCTE as ( SELECT * from View_Session Where (('''+@@BookId+'''=''0'' OR BookID IN('+ cast(@@BookId as varchar(Max))+')) and (('''+@@@StudentID+'''=''0'' OR StudentID IN('+ cast(@@@StudentID as varchar(Max))+')) ) SELECT * FROM ROWCTE end |
SQL Server 2019 - Development |
SSIS Web Service task SSL errors - I've tried different credentials, target server versions, etc. hitting our Primavera WSDL. Works great in any browser. Via the Web Service SSIS task, I get an error when running the package: Target Server 2016: --1. Connection manager "HTTP Connection Manager 1": SSL certificate response obtained from the server was not valid. Cannot process the request. […] |
Populate Column Based on Distinct Values - Hello! I am trying to populate a column based on the number of distinct values in a different column. If there is only one distinct department, Export Department should be populated with *, if there is more than one distinct department, Export Department should be populated with the same value in Department. Any help would […] |
XML |
Parsing a lange XML data-column from one server to another - Dear PS-scripters. As a newbee I encouter the next challange.... I have a PS script that needs to copy data from server A (table VV) to server B (table VV). One of the columns is an XML column. Now I run: Invoke-Sqlcmd -ServerInstance $DestServer -Database $DestDatabase -MaxBinaryLength 204850000 -Query $InsertQuery The $InsertQuery holds just one […] |
Integration Services |
How to Replace LF to CRLF in file source connection - hi, I have a issue where ,the flat text file (fixed width) used to come with CRLF and now it is coming as LF and it is failing. How can i fix it, Is it possible? Please suggest. Thanks in Advance, Komal. |