How do I get list of all tables in a database using TSQL?

What is the best way to get the names of all of the tables in a specific database on SQL Server?

How do I determine a public holiday in Sql server?

I have an application written in c# that cannot run on a public holiday or a weekend. I've looked around a bit and haven't found anywhere (official) that provides all the public holidays for the...

How do I see active SQL Server connections?

I am using SQL Server 2008 Enterprise. I want to see any active SQL Server connections, and the related information of all the connections, like from which IP address, connect to which database or...

Getting only Month and Year from SQL DATE

I need to access only Month.Year from Date field in SQL Server.

A connection was successfully established with the server, but then an error occurred during the pre-login handshake

I am getting following error when i am trying to connect Production DB from Local Environment. I was able to connect Production DB before, but suddenly i am getting following error, any idea? A...

Retrieving database name from bak file

I have a bak file that has in it a back up of a database . I want to restore this database to a new location and I need to retrieve the database name from this file any idea how to do so ? I need...

close/kill transaction

I have this open transaction, according to DBCC OPENTRAN: Oldest active transaction: SPID (server process ID) : 54 UID (user ID) : -1 Name : UPDATE LSN ...

Update count column from data in another table

In my DB I have two tables Items(Id, ..., ToatlViews int) and ItemViews (id, ItemId, Timestamp) In ItemViews table I store all views of an item as they come to the site. From time to time I want...

Amazon RDS w/ SQL Server wont allow bulk insert from CSV source

I've tried two methods and both fall flat... BULK INSERT TEMPUSERIMPORT1357081926 FROM 'C:\uploads\19E0E1.csv' WITH (FIELDTERMINATOR = ',',ROWTERMINATOR = '\n') You do not have permission to...

The INSERT statement conflicted with the FOREIGN KEY constraint error

Hi I'm getting this error The INSERT statement conflicted with the FOREIGN KEY constraint "FK_dbo.AspNetUsers_dbo.Contacts_ContactID". The conflict occurred in database...

How to populate Excel ComboBox with data from SQL Server?

I am trying to populate a combobox in Excel file with data from SQL Server. Here is code for event: Private Sub Workbook_Open() ActiveWorkbook.Sheets("Generation").Activate Set cn = New...

Excel Power Query - convert date time from UTC to Local

I'm connecting to an MS SQL database via Power Query (Version: 2.10.3598.81) in Excel 2010. My dates are stored in UTC in the database, however I would like to show them as local in the...

Passing a SQL parameter collection to a function

When writing ASP.NET CRUD applications in C#, I often find myself inserting a lot of repetitive boilerplate codes for fetching SQL Server queries into data tables, fetching scalar values from...

C# PISDK - How do you pull a full column of data from a PISDK server using C#?

I am looking to pull full column data from a table in a PISDK Server, and then populate any blank fields in that column with the field from another column in the same row. This would be similar to...

Access linked tables truncating my Decimal values from the SQL server

Since migrating the Access data to a SQL server I am having multiple problems with the decimal values. In my SQL tables on the SQL 2012 server I am using the Decimal data type for multiple fields....

How to retrieve the schema from MS Server Compact Edition (*.sdf) by using adodbapi?

I am trying to get the schema out of a database, before applying any queries from a local file (*.sdf). So far, I can connect to the database and perform queries when I know the schema. I have...

How to open recordset from SQL Server in MATLAB via MS Access front-end

I've got code (below) to read data from a MS Access table into MATLAB, via an ActiveX server, that works very nicely. I'm now trying to use the same code to read data from an Access linked table...

Correct Nodejs mssql parameterized LIKE query syntax

Using Nodejs and mssql package for SQL Server, I understand normal SELECT query with parameters: aVar = "somestring"; // used as example, the real input is from a web form request = new...

Error using SSMA to migrate Data from Access to SQL Server

I am trying to use the SSMA to migrate two Databases from Access 2007 to SQL Server 2014. The SSMA recognizes the Access DB's but the tables and queries show as zero. I have ammended the...

convert varchar to date and subtract it from another date

How do I convert varchar into date in MS sql Server.? eg - there is a number like this --> 19690409. This is of type varchar. It has to converted into a date format like 1969-04-09(yyyy-mm-dd)....

Oracle OLE DB Provider not Listed in SSIS

I'm having an issue with SSIS and VS2015 CM. I have a package that needs to connect with Oracle to get some data. I installed the ODAC for Win64 and the Oracle client but I can't see the Oracle...

how to create a linked server to a SharePoint site in SQL Server 2014

I keep reading articles online that say this is possible but nothing that says how to do it. I have an SQL Server 2014 server and I want to create a linked server to a SharePoint site. I can go to...

Sql query to find users with same skills

I have three tables UserInfo (U-id,U-name) Skill(S-id,S-Name) and a bridge table between them (cause they have many to many relationship) 3. UserSkill(U-id,S-id) I want to write a query to find...

SSIS: Unable to access sensitive parameter in script task using GetSensitiveValue() in DontSaveSensitive mode

Running SQL Server 2014. I am following the instructions on the following web-link: https://www.hansmichiels.com/2016/11/19/using-sensitive-parameters-ssis-series/ Basically, I don't think what...

Could not import package. Warning SQL72012: The object exists in the target

I exported my Azure database using Tasks > Export Data-tier Application in to a .bacpac file. Recently when I tried to import it into my local database server (Tasks > Import Data-tier...

Azure data factory says temp table is an "Invalid object name"?

I have a very large query that I am attempting to use in a Copy Data Azure Data Factory (ADF) workflow. This is a simplified version of it: CREATE TABLE #tmp (         Name...

Recursive CTE listing all ancestors as columns

I found many examples that show recursive CTEs that will list the path as a concatenated string and the depth of the level. For example: CREATE TABLE #Test (ID varchar(20), ParentID...

Serilog enriched properties not being sent across HTTP Sink

I'm using Serilog HTTP sink from a web service to send logs to a different logging service. That logging service then uses the MSSQLServer Serilog sink to write to the DB. I'm wondering about...

node:10212[DEP0123]DeprecationWarning:Setting the TLS ServerName to an IPaddress is not permitted by RFC 6066.This will be ignored in a future version

Below is my nodejs code to connect to a mssql database and query data const sql = require('mssql') export class GetJDBCCasedata { async fetchData(wellid, wellboreid, designid) { var result ...

Opening PDFs in WebView2 based on selection in CheckBoxColumn

So, In my WPF application, I want my users to be able to open previews of invoices, so that they may either verify or discard them. I am letting them check rows (each row representing a invoice)...