Microsoft SQL Server

164K

Solutions

50K

Contributors

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi

I have a SQL Server table with a varbinary-field in it. I want to insert that record in a MySQL-Database. How can I access this field-data?
myTable is local on a SQL Server
mySqlTable1 is on a MySQL Server in the web

Query1.SQL.Text := 'SELECT myString1, myVarBinary1 FROM myTable';
Query1.Execute;
mySqlQuery1.SQL.Text := 'INSERT INTO mySqlTable1 (str1, blob1) VALUES('+QuotedStr(Query1.FieldByName('myString1').AsString)+','+??myVarBinary1??)'

Open in new window

How can I access the varbinary-field? Something like Query1.FieldByName('myVarBinary1').As???
Thanks for any help
Peter
0
Fundamentals of JavaScript
LVL 13
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

Need assistance with sql statement to return the full date to just the Jan 2019, etc.

I need to return a count of ServiceID per SubIssued, for each MonthYear.

Please modify the following query to return the correct results:

 Code:

select       [VSTS_Common_ProjectSubIssue] as 'ProjectSubIssue'
    , Count([System_ID]) AS MTHLYCT
      , VSTS_Common_ResolvedDate
      , CONVERT(VARCHAR(2),MONTH(VSTS_Common_ResolvedDate)) + CONVERT(VARCHAR(4),YEAR(VSTS_Common_ResolvedDate) AS ResolvedDate  
--, REPLACE(RIGHT(CONVERT(VARCHAR(9), VSTS_Common_ResolvedDate(), 6), 6), ' ', '') AS [MMYY]
FROM [qry1].[view1] TFS
where VSTS_Common_ProjectSubIssue
      in
      (
            'China Special Handling Request'
            , 'Empty Box Received'
            , 'Incorrect Product Received'
            , 'Lost in Transit'
            , 'Replacement SN Verification Request'
            , 'Tamper/Damage Bypass Request'
            , 'Tamper/Damaged Product Received'
            , 'Wrong Item Received'
            , 'SN Dosent Match Ticket'
      )
and
[VSTS_Common_InputPath] = 'Service Center'
and System_State in ('Closed', 'Resolved')
and VSTS_Common_ResolvedDate >= '07/01/2019'  
group by VSTS_Common_ProjectSubIssue, VSTS_Common_ResolvedDate
--, Count([System_ID])
--, CONVERT(VARCHAR(2),MONTH(TransactionDte)) + '/' + CONVERT(VARCHAR(4),YEAR(TransactionDte)
0
I'm using an ssis pkg to load data from Oracle 12.2.0.1.0 (we just upgraded) into Sql Server 2014.  It worked fine before upgrade, now I'm getting buffer and memory errors.  

Any suggestions?

Connection manager - Native OLE\DB Oracle provider for OLE DB

using a dataflow
0
Priority Boost feature on SQL server

As per the Microsoft recommendation, the feature will be deprecated in future versions and
recommended to not use this feature in new development work and modify applications that currently
use this feature as soon as possible.

https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-priority-boost-server-configuration-option?view=sql-server-ver15


Do we also need to disable it on existing critical servers where implemented as best practice?

Thanks
0
There's a field in a table of a SQL Server database that doesn't except "NULL" but has a default value of "0".  The InsertCommand for the data adapter that vb.net automatically  generates doesn't accommodate this. If the field is left blank in the front end program, the update method of the data adapter fails with a message that the field can't be left blank.  It doesn't set it to the default value that is set in the SQL Server table.  What is the easiest way to get the data adapter to set the field to the default value when the corresponding parameter is null (from being left blank by the user)?
0
I am creating a stored procedure.  I will be passing in a string parameter of ID's.  How do I write my SQL code to select those ID's.  

Error I'm getting is:
Msg 245, Level 16, State 1, Line 9
Conversion failed when converting the varchar value '26395, 26396' to data type int.

Here is the code:
DECLARE @POID AS VARCHAR(200) = '26395, 26396'

SELECT * FROM PO WHERE POID IN (@POID)

Open in new window

0
How do I add a grand total to an existing row of totals?  On the example, I want the total in the bottom right corner to be the sum of the (sum(tax) + sum(cost) for all groups?
ee1.jpg
0
How do I add a column group to a table that has a row group and details?
0
I have a measure and I need a way to sum up the value the measure produces.

I have come up with the example below

Report Table that I would produce in Power BI

==============================
Number of
channels
/ Customer   Measure 1    Measure 2    Measure 3
1                         1                        1                  0.50          <== Correct Value
2                         1                        2                  0.33          <== Correct Value
3                         1                        0                  1.00          <== Correct Value

Total                  3                        3                  1.83          <== this is the value I am looking for
                                                                                                   on a total line

                                                                          1.00         <== this is what I am getting
                                                                                                    but not what I want

Here is the Raw Data

RawTable
=======
Customer  Channel     Age of    Number of    Customer   Customer  Customer
 ID                                   Data       channels         Type          ID A            ID B
                                                       / Customer                        
123              web                  0              3                 A               123           <blank>
123     …
0
I need to change the formatting of 8 cells in a table in SSRS.  I want to set the number formatting.

How do I do this at one time?
0
Ensure you’re charging the right price for your IT
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

I am struggling with PowerBI and I need to show that data in a certain way.

I have the data set with a Days Completed, and I want to show the number of tickets completed in 0 days, 1 days, and 3 days for the last three months.

The data goes back almost a year and I cannot figure out how to do it
DATA-Annotation-2019-10-11-095147.png
InkedAnnotation-2019-10-11-095147_LI.jpg
TablesAnnotation-2019-10-11-100441.png
0
I'm setting up a job to run daily, pull backup information and email it out to a select number of people. when I test run the script with a simple query it works fine, when I add the query to pull the backup data it fails with the error below.

Failed to initialize sqlcmd library with error number -2147467259

When I run the script that gets the data it runs fine.

What am I missing?
experts-query-question.docx
0
Experts,

I have the following dataset
dd
I am going to add a row with a name 'newadd' in column Name.
I am going to update a row with name Boris to Blair
I am finally going to delete the row with name Michael in the name column.

When I run the following code everything shows apart from the where I deleted the row;

 SELECT
    ChVer = SYS_CHANGE_VERSION,
    ChCrVer = SYS_CHANGE_CREATION_VERSION,
    ChOp = SYS_CHANGE_OPERATION, PA.*
  FROM CHANGETABLE(CHANGES dbo.data_source_table, 15) AS ChTbl
 INNER JOIN dbo.data_source_table PA ON PA.PersonID = ChTbl.PersonID

Open in new window


As you can see, I am able see those rows that were updated or inserted, but I can't see the row that was deleted. Can someone let me know why I can't see the deleted row?
deg
0
I have a Sharepoint list (Calendar) and I want to get data into a different SQL Server Table every 5 minutes (live Linked Server would be awesome but in my dreams i think). I can build SQL job that runs every 5 minutes but I just cannot seem to grab the data. Options would be great.
0
I need to find the required doc that need to uploaded by the employee when the expiration date is 90 days before or after.

The query that I am dealing with
SELECT *
from instructors I
inner join userInstructorLicense UIL on UIL.userKey = I.instructorKey
left  Join instructorsDoc ID on I.instructorKey = ID.instructorKey
left outer join lkup_insDoc lID on LID.docKey = ID.docKey
WHERE UIL.userKey = 5
and DATEDIFF(year,UIL.expirationdt,getDATE()) < 0
and LID.status = 1

Open in new window

0
Hello

I need to test the integrity of a dump file of MS SQL server (*.BAK file)

Is there a simple command (or a free tool) that could check that this file is OK and not corrupted? Ans that restoration to an SQL server will be OK?

I do not have SQL Server installed and I am looking for an external tool (without having to import the BAK file in SQL)

Thank you for your help
0
I had this question after viewing How do i modify specific ExtensionSettings details in the Subscriptions for SSRS.

Trying to add the value so when I query ssrs subscription information I do not get

@ReportName was executed at @ExecutionTime

but rather the actual report name and execution time

I got impression I could do without data driven subscription by updating xml parameter value but not sure how
0
I am trying to back up a reporting server using the following article:

https://docs.microsoft.com/en-us/sql/reporting-services/report-server/moving-the-report-server-databases-to-another-computer-ssrs-native-mode?view=sql-server-2017


I can back up the DB just fine but when I get to the command to back up the logs I get an error  "Backup LOG " cannot be performed because there is no current database backup.

Reading the article below, it makes it seem the COPY_ONLY command is causing me the issue. Is this the case? If I do not run the COPY_ONLY command, am I going to be missing anything important?

https://sqlbackupandftp.com/blog/backup-log-cannot-be-performed-because-there-is-no-current-database-backup
0
I have full name column in my  table

bond,james
smith, john
trump, donald



I want to write a select statement in such a way that it shows

bo*,Ja*
sm*,jo*
tr*, do*
0
PMI ACP® Project Management
LVL 13
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Hello all, I am getting errors when restoring a SP 2010 farm.
The current Intranet is on a Windows Server 2008 R2 with SQL Server 2008 R2 and SharePoint 2010.
I have created a new VM with Windows Server 2012 R2, SQL Server 2012 SP4 and SharePoint 2010.
sprestore.log
0
I'm looking for a script to  Create partition on PERIOD_YR i.e. one partition for each Month/Year, so 12 partition for a year.
0
Hi,

I have a question regarding zero initialization .
Can we add SQL service account to the initial file reinitialization after the server is active ?
Will an admin account work instead of the sql services account?

Thanks
0
Can we release the available free space on the transaction log file to disk drive without shrinking the log file.?
0
I am lost in trying to create a user defined function. I want to understand what am doing
output that I currently have

 LoginID   (adventure-works\alan0      )          UserLogintID  (alan0)         from dbo.HumanResources.Employee

1.       Create a UDF that accepts EmployeeID (2012: BusinessEntityID) and returns UserLoginID.
                  The UserLoginID is the last part of the LoginID column.  It’s only the part that comes after the \  
                  select LoginId                                     
                  ,SUBSTRING(LoginID,CHARINDEX('\', LoginID,0) + 1, len(LoginId)) AS UserLoginID                  
                  from [HumanResources].[Employee]

--parameter to be used in the function UserLoginID we declare and set the parameter declare @UserLoginID, set @UserLoginID int (data type) , @EmployeeID int

Syntax - Scalar
CREATE FUNCTION      fn_Business_Login (@UserLoginID) (@EmplyoeeID)  
    RETURN     INT  
     AS    
    BEGIN      
     
        CODE        SELECT LoginID
                           FROM dbo.HumanResources.Employee
                           WHERE
                         

        RETURN INT

    END
0
I'm looking for some help doing this assignment. Its due tomorrow Sunday 10/6/2019

 Please look at the attached file A07, for assignment instructions

HERE IS AN EXAMPLE of how the query going to look like


: 1.
 a) Least profitable
SELECT  prod.ProductID,
            prod.ProductNumber,
            prod.Name as ProductName,
            SUM(sod.OrderQty) AS QuantitySold,
            SUM(prod.StandardCost) AS TotalCost,
            SUM(sod.LineTotal) AS TotalRevenue,
            SUM(ListPrice-StandardCost) AS TotalProfit

FROM Production.Product prod
JOIN Sales.SalesOrderDetail sod
      ON prod.ProductID = sod.ProductID

GROUP BY prod.ProductID,
             prod.ProductNumber,
             prod.Name

ORDER BY TotalProfit

 




1. b) Most Profitable
SELECT  prod.ProductID,
            prod.ProductNumber,
            prod.Name as ProductName,
            SUM(sod.OrderQty) AS QuantitySold,
            SUM(prod.StandardCost) AS TotalCost,
            SUM(sod.LineTotal) AS TotalRevenue,
            SUM(ListPrice-StandardCost) AS TotalProfit

FROM Production.Product prod
JOIN Sales.SalesOrderDetail sod
      ON prod.ProductID = sod.ProductID

GROUP BY prod.ProductID,
             prod.ProductNumber,
             prod.Name

ORDER BY TotalProfit DESC
A07.docx
0

Microsoft SQL Server

164K

Solutions

50K

Contributors

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.