Tag: sql-server

SQL Database Constraint | Multi-table Constraint

I need to make 2 database constraints that connect two different tables at one time. 1. The total score of the four quarters equals the total score of the game the quarters belong to. 2. The total point of all the players equals to the score of the game of that team. Here is what […]

SQL Server Management Studio is not allowing me to Alter views or stored procedures

I am installed Microsoft SQL Server Management Studio 2016 of a new PC that I have. When I try to alter a view I get the following error Syntax error in TextHeader of View ‘ViewName`. Microsoft.SqlServer.Smo) I get this error when I right click on the View > Script View As > Alter to > […]

asp.net app on IIS can't connect to localdb

I have an asp.net web app running on IIS, and everything is fine, until I try to access the database I get this error: I have read the 2 parts of the Using LocalDB with Full IIS: 1 Part | 2 Part I followed the instructions and still get the error, is there a way […]

Unknown number of child and grandchild elements in an XQuery

I have loaded a number of large XML files into an XML field/table in my MSSQL database. My table (called XMLImport) has two columns; an ID column and a second column labeled XMLColumn for the XML file. I now need to get certain elements out of that data so that it can be loaded into […]

Changing granularity of OLAP cube

Is there any possibility to change granularity level in cube? I look for GROUP BY equivalent in MDX. Now I have report based on SQL which I need move to the cube. The structure of it is something like this: SELECT rank() over (partition by x order by y z) group_column ,a ,b FROM abc […]

SQL Server Tedious Callback

I can’t use the callback of tedious on Request (This is a INSERT request) to make another request just after the first one. Any idea ? Here is my code. function intermediaryPositionSQL(decodeMessage, connection) { if (typeof (decodeMessage.latitudeInt) != “undefined” && typeof (decodeMessage.longitudeInt) != “undefined”) { var request = new Request(requestPosQuery, function (error) { if (error) […]

Microsoft SQL Server : the parameter is incorrect “exception from Hresult:0x80070057

After installating SQL Beautifier, I get this error when I Open SSMS. The parameter is incorrect. (Exception from HRESULT:0x80070057 (E_INVALIDRG)) Create Command bar error 2:VSShell

SQL Server – Behaviour of ROW_NUMBER Partition by Null Value

I find this behaviour very strange and counterintuitive. (Even for SQL). set ansi_nulls off go ;with sampledata(Value, CanBeNull) as ( select 1, 1 union select 2, 2 union select 3, null union select 4, null union select 5, null union select 6, null ) select ROW_NUMBER() over(partition by CanBeNull order by value) ‘RowNumber’,* from sampledata […]

Make sum of elements when case is lower than specific date

The problem is when the paymentDate is lower than 2005, it must make sum of all element in champs1 + champs2 with payment lower than 2005. But in this code, it makes sum of all champs1 + champs2 even if the payment is higher than 2005 and that is not what i am looking for. […]

SQL Server -> PHP Date

I’m having trouble with SQL Server date coming to my php file. I’ve researched but none of the usual solutions have helped. This is what I have in SQLServer: Table: Course_License_Date DATE, Entry: INSERT INTO Certs2 VALUES (‘INSERT INTO Certs2 VALUES (‘2004-09-20’);); This is what I have in my PHP file: <?php echo date(‘F d, […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.