Category "sql-server"

Round And Show To 2 Decimal Places? [duplicate]

I have a small question to ask. How to round a numeric field upto 2 decimal places, and also show it with 2 decimal places only For example th

How to connect to a local database in SQL Server Management Studio?

I have downloaded the SQL Server Management Studio (SSMS) 2016 to recover a huge .bak file which is an old backup of a database. But first of all I need to conn

How change few columns to another table with key in SSIS?

I have: Collisions{PK_id, cashLoss, deaths, city, state, county} I want: Collisions{PK_id, cashLoss, deaths, #IdLocalization} Localization{#LocalizationID(a

Microsoft SQL Server Management Studio Opening Error

I installed SQL Server Management Studio and it worked fine. After that I updated my Visual Studio from 2010 to 2013 Express edition, now it is not working with

How do I go back to multi_user mode

Here is my query: IF EXISTS(%some query%) BEGIN BEGIN TRY ALTER DATABASE [MyDatabase] SET single_user WITH ROLLBACK IMMEDIATE; --d

SSIS - Intermittent error "Conversion failed because the data value overflowed the specified type."

I have an SSIS package which intermittently fails with a handful of errors, the two most informative of which are: DFT_PlaySummary SSIS Error Code DTS_E_O

Can't join FREETEXTTABLE with typeORM functions

I'm working on a graphQL backend with TypeORM I found FREETEXT, CONTAiNS, FREETEXTTABLE and CONTAINSTABLE options for fulltext searching in my SQL database. As

How to drop all tables from a database with one SQL query?

I don't want to type all tables' name to drop all of them. Is it possible with one query?

SQL values from a table with multiple groups

I have a table that has multiple persons linked to multiple groups. I have a procedure that needs to bring everyone from group 75588 but if this person is in gr

Find all stored procedures that reference another stored procedure

I want to find the all the directly and indirectly references to DB objects list. I am using below queries but I found the issue. DECLARE @Search varchar(255)

"Insert Into" statement causing errors due to "Parameter 7 (""): The supplied value is not a valid instance of data type float."

I'm loading a batch of CSV files into a SQL Server table using Python one row at a time. The files each contain a number of free text fields and erroneous data

Default row order in SELECT query - SQL Server 2008 vs SQL 2012

Our team recently upgraded our databases from SQL Server 2008 to SQL Server 2012. One breaking change we noticed was in the default order of rows returned by th

SQL Server not listening on IP address even if TCP/IP is enabled

I am trying to set up MS SQL Server Express 2019 to listen on TCP/IP and connect to it through IP address instead of shared memory. I am currently connecting th

Query to display Employee and Manager

I have to write a SQL Server query to display the employee last name and his respective manager’s name, as given below. John works for Robert Jane works f

SQL Server after update trigger

I have a problem with this trigger. I would like it to update the requested information only to the row in question (the one I just updated) and not the entire

Does a SQL connection close with "using" if the connection comes from a static class?

Am I closing my SQL connection correctly, by placing it inside a "using" block? This is how I grab a new connection, execute a query, and return the results:

pyodbc.ProgrammingError: ('42000', "[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near

I'm using python 3.9 to insert a list of multiple news from google rss news to SQL table with parameter using pyobc but always getting programming error below:

How to create SQL Server data backup file in Outlook Compatible format by C# code

I want to take backups of all emails from SQL Server database and need to create it's backup file using C# code in outlook compatible format. So that emails can

Cannot continue the execution because the session is in the kill state. while building clustered index

I get the following error while trying to create a clustered index The statement has been terminated. Msg 596, Level 21, State 1, Line 0 Cannot continu

Mapping relationships using PetaPoco paging

I am using PetaPoco v5.1.228.0 and I am trying to fetch a list of people along with the category they belong to, using paging (30 items per page). This is my c