Category "sql-server"

SSMS 2012: Convert DATETIME to Excel serial number

I can't seem to find an answer to this anywhere --- I want to convert a datetime in SQL to the excel serial number. I'm essentially looking for the DATEVALUE f

User defined table type with dynamic columns in SQL Server

In my .NET (C#) win application, I import an Excel file that contains multiple columns of varying numbers. So, I store the data in my datatable in code and I ne

SQL Query Error - Error Source: .Net SqlClient Data Provider

Error Message: The SELECT permissions was denied on the object 'quote', database 'oneview', schema 'dbo'. I am relatively new to SQL and the developer I am le

Pyspark connection to the Microsoft SQL server?

I have a huge dataset in SQL server, I want to Connect the SQL server with python, then use pyspark to run the query. I've seen the JDBC driver but I don't fin

Unable to install SQL Server (setup.exe)

I used SQL Server 2019 express version on my laptop butI uninstalled. Now I am trying to install SQL Server 2019 Developer edition but I get an error: Exit code

Forward SQL Server ODBC over SSH via putty

I would like to access a Azure SQL database. It is accessible on port 1433. However, the firewall is blocking this request. Therefore, I wold like to tunnel my

Prevent database access outside the application

We have a MVC application running with SQL Server database. We are using windows authentication, and when we want to give user access to our site we add them i

Is it necessary to test for NULL if also testing for greater than?

I inherited some old stored procedures today, and came across several examples that followed this general pattern, where @Test is some INT value: IF @Test IS N

Showing "The Visual Studio cache is out of date" when click new query in SQL Server

I use SQL Server 2016 Management Studio. After I connect to the server and click on "new query", a message appears: The Visual Studio cache is out of date

Unable to open SQL Server Management Studio

To download and install Microsoft SQL Server 2008 R2, I followed these steps from http://www.microsoft.com/en-in/download/details.aspx?id=22985: Download and i

SQL - The conversion of a varchar data type to a datetime data type resulted in an out-of-range value

I have been getting the following error when running a SQL to convert my data type value from varchar to datetime. Msg 242, Level 16, State 3, Line 1 The

Select the field as Distinct having data type as Text. Sql Server

Is their any way to select a field as Distinct whose data type is Text. If we have a table T1 with a field named Subjects have data type as Text. Subjects -

Docker initialize database tables and records in SQL Server

How do you specify initialization database script for SQL Server via docker-compose using SQL script file? docker-compose.yml database: image: microsoft/m

Dynamics NAV SQL Lead Time format conversion

I have a small issue getting data, one field in particular, from table replicated from Microsoft Dynamics NAV. There is a field storing lead time in strange fo

Export database schema into XML file

I would like to export whole database schema to XML file. Information there what are needed. tables - columns, data type, pk, fk, views - returned columns, fun

Push an R dataframe to SQL as a new table

I'm trying to make my analysis workflow more efficient connecting my SQL Server Database to R-Studio. What I do now? I develop my queries using MS SQL Managem

Can I do a DAG with SQL Server HierarchyId?

I'm developing an organizational chart in SQL Server 2016. I have some employees report to multiple managers which make the data structure a Directed Acyclic Gr

Mssql loop with UNION t-sql

I just use Mssql procedure given at this site Using loop with UNION t-sql to build my own loop procedure. When I'm executing this code: SELECT '[hpsdb].[

How to Identify port number of SQL server

I Install SQL server in my system and I have to check on which port number SQL is working in my system

CONCAT_WS() for SQL Server

How can I emulate MySQL's CONCAT_WS() function in SQL Server? This function is similar to CONCAT() function in SQL Server 2012 except that it adds a separator