Here's a few of the new posts today on the forums. To see more, visit the forums.
|
SQL Server 2017 - Development |
Creating appropriate data type from varchar(max) - This is something I am thinking someone may have done already. Basically we have data loader which loads data from any source but the data type in the table will always be varchar(max). if it is db to db transfer then the table will have correct data type as source. This was perhaps designed long […] |
SQL Server 2016 - Development and T-SQL |
Extract data from XML field - Hello, I have a SQL view with a column called GlobalCountryRegionXML. Here is an example of a value stored in this field:- United Kingdom UK-IE United States NORAM From this, I would like two further columns showing the following results (in the same single row) separated by a comma:- […] |
How to get YYYYMMDDHHMMSS - This is getting the data I need, but not the format. select replace(convert(varchar, getdate(),101),'/','') + replace(convert(varchar, getdate(),108),':','') 10212021102437 I want YYYYMMDD before the time portion. Thanks. |
SSIS File System Task - Permission Inheritence - I have an SSIS package which outputs a flat file to the file system into a "staging" folder. The package then runs a File System Task to move this file from the Flat File Destination "staging" location to another "collection" path specified in an SSIS Parameter. The package works successfully. However, the resulting file that […] |
Alter Procedure With Invalid Object Name - We are trying to update a stored procedure to reference objects that don't yet exist in preparation for when they will exist. The problem is SSMS doesn't like that and gives the error that there are invalid objects. Is there a way to trick it into allowing the invalid references? |
Development - SQL Server 2014 |
Conversion failed when converting the varchar value to data type int. - Hi, I've tried using cast but can't seem to get the syntax right. Here is the query below: SELECT PurchaseOrder AS Customer, [JobNumber] AS ROM#, Counter_Type as Countertop, ((Length/12)*(16)) as Price, LnFt AS Reason, CASE WHEN LnFt = '1' THEN ' SHIPPING DAMAGE' WHEN LnFt = '2' THEN 'SHIPPING SHORT ON DELIVERY' WHEN LnFt = […] |
SQL 2012 - General |
named pipes connect error - Inherited an estate. Just trying to logon to one of the SQL servers. It's not a named instance. Trying to connect via SSMS & osql (local to the SQL box) - connecting with either: SSMS (windows user onto hostname, hostname,1433 or hostname\mssqlserver). It's windows auth only. osql -S. -E osql -S hostname -E osql -S […] |
How to make row number start by 1 instead of 0 when make union all? - I work on SQL server 2012 i face issue i can't arrange rows from 1,2,3,4,5 current arrange is 0,1,2,3 for rownumber i need row number start by 1 then 2,3,4,5,etc select H.lifecycleid,H.ZPartID,H.ZLC,H.ProccessingDate,ROW_NUMBER() OVER(Partition by H.ZPartID ORDER BY H.ProccessingDate DESC) AS Row_Number into #arrangeHistory from #TempLC t inner join parts.LifeCycleHistory H on H.ZPartID=t.ZPartID --3---get data related […] |
SQL Server 2019 - Administration |
Need the (default) port to connect - why is this not implicit. - So I have 2 instances (1 x 12, 1 x 19). Both have the default port set to 1433. Same settings on each. I connect in from a central server. On one, I must specify the port the other I don't need to. Just wondering why. I would have presumed the default port is implied? […] |
SQL Server 2019 - Development |
Rank values based on dates (grouping) - Hello friends, I need some help. I need to rank all titles for each week. Later on, I need to pull top20 titles for each week in PowerBI, however for some reason it doesn't let me to do it there (it pulls top20% only). I am trying to find a way around and group it […] |
Replace apostrophe in user input field - I have an Access front end with SQL backend. The user input field is text. He inputs: don't mess up. When I run the SQL update to update the field I get the SQL injection error. My code: strSQL = _ "UPDATE [Orders] " & _ " SET [Orders].[Comment] = '" & Me.Comment & "' & _ " WHERE [Orders].[OrderId] = '" & strOrderId & "';" DoCmd.RunSQL strSQL The Comment text […] |
DATEDIFF with GETWEEK worth of data - I have such an issue. I have units, on sale date and also how many weeks the unit is on sale. However, my current formula with DATEDIFF grabs only dates that are from '09-20' and some from '09-21' (if we take a week of 1 month example), but I need to change it so it […] |
Update field based on next 5 rows - Hi, I have table below: ID Postcode PostcodeNext 1 LL11 2 LL12 3 LL13 4 LL14 5 LL15 6 LL16 . . . I need to update PostcodeNext column for each row in database with next 5 postcodes as string, so ie […] |
Reporting Services |
Please help with grouping totals and details - I am trying to get the same layout going in ssrs as in the picture below. Basically there is a parent group on business area/line and then it groups on event type too and does the totals on the top line. right underneth the totals for the event type it goes into the detail to […] |
SQL REporting SErvices 2017 , how do I deny permission to users - I set site level and user level Security entry for domain users, but still user is able to access the repots.. How do I mitigate this... i want to give access to only few user groups and not all user groups.. |