Questions tagged [sql-server-2008]

Use this tag for questions specific to the 2008 version of Microsoft's SQL Server.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Migrating Database in MySql

I am migrating database from Microsoft SQL Server to Mysql server An error occurs when selecting "Microsoft SQL Server" option from Database System The following is the error: connection ...
Abishekk's user avatar
0 votes
0 answers
14 views

Java Project SQL Server Update Query Not Updating Table, No Errors [duplicate]

I'm working on a Java project that interacts with a SQL Server database. I'm trying to perform an update operation on a table using a SQL update query, but it doesn't seem to update the table, and I'm ...
Vinish's user avatar
  • 1
-2 votes
0 answers
44 views

Need to write a SQL query depending on flag status

I have a table StatusTable with a Flag column with values 'I' or 'E'. So depending on the flag value, I need to change where condition of the SQL query. For example: Select a.col1, b.col2, c.col3 from ...
Tris's user avatar
  • 7
-1 votes
0 answers
37 views

Check If a row value is present in another table within a group

I have a requirement to check if the value from the master table is present in the transaction table within groups. Master table: ID Item 1 Home 2 Admin 3 Users 4 Roles 5 Deals Transaction ...
Chaitra Murthy's user avatar
-2 votes
1 answer
73 views

My SQL statement with 2 INSERT commands is failing on the second INSERT

I have the following 2 INSERT statements: -- Create a new database entry for the astronomicalObject in the GradObservers database -- based on values of the given id INSERT INTO astro.bodies (id, title,...
SkyeBoniwell's user avatar
  • 6,367
-4 votes
2 answers
43 views

How do I find doctors who work in the same specialty but live in different cities using SQL Server

The goal is to select all doctors who work in the same specialty, but come from different cities. I tried the two code options below but they didn't produce the desired results. Image of doctors table ...
Payamah's user avatar
  • 11
0 votes
1 answer
37 views

Node TS API container is unable to connect with SQL Server

I’m trying to run a container from my backend application, but I can’t connect to my SQL Server (mssql), I get the following error: ConnectionError: Failed to connect to = 192.168.0.190:1433 - ...
Thomas's user avatar
  • 21
0 votes
0 answers
49 views

[DBNETLIB][ConnectionOpen (SECCreateCredentials()).]SSL Security error Communicating with Win 10 OS

I'm getting this error when my windows application communicating to SQL Server 2008 R2. Application framework .Net framework 4.6.2 [DBNETLIB][ConnectionOpen (SECCreateCredentials()).]SSL Security ...
Sandy's user avatar
  • 1
-2 votes
2 answers
49 views

Display Parent Records After Related Child Records in SQL Server

declare @t1 table (Id int, Name nvarchar(200) ) declare @t2 table (Id int, t1Id int fk, Name nvarchar(200), Amount decimal(18,2) ) declare @t3 table ( t2Id int, t1Id int, Name nvarchar(200), total ...
Nirali Akabari's user avatar
0 votes
0 answers
160 views

Cannot get .Net Framework 4.8 to install on Windows Server 2012 Standard

I am currently running .Net Framework 4.7.03062 on my Windows 2012 Server. I ran the Offline installation of Version 4.8. It finished and said that version 4.8 was installed. When I look at the ...
Dubbi's user avatar
  • 1
0 votes
0 answers
48 views

Connecting to SQL Server view with Windows authentication using Python?

I have access to the following view in a SQL Server database: [Serverlocation\Server].[Server.DW.Application].[Application_AdHoc].[DepartmentDailySummary] I am a beginner, I do not know too much ...
thomasglanz99's user avatar
-2 votes
1 answer
36 views

What are the default locations that OSQL and SQLCMD search to connect to a server when -S option is not specified?

I am trying to identify how osql and sqlcmd resolve server name and user to connect to that server when we do not specify server using -S option and use -E option. Below is the output for various ...
Sachin Kumar's user avatar
0 votes
1 answer
81 views

How to insert mm/dd/yyyy strings into a SQL Server datetime column using fast_executemany?

I am querying data from BQ. I have to insert it to SQL Server 2008. pseudocode: # get results from bigquery client = bigquery.Client() result = client.query(sql).result() # create parametrized ...
mkylfnur's user avatar
0 votes
2 answers
55 views

Compare the Definitions of Two Tables

Is there a way to compare programmatically in T-SQL the definitions of two tables. Not only the column names and the data types, but all definitions that are returned by: sp_help 'table_name'
st_stefanov's user avatar
  • 1,147
1 vote
0 answers
34 views

How to show all column names of a TEMP table [duplicate]

My goal is to show all the column names of a temp table called #foo. This will turn into a stored procedure that can display the field names of any temp table. But right now, it doesn't work for a ...
PowerUser's user avatar
  • 11.6k
1 vote
1 answer
61 views

How to add a trigger to delete duplicates in table

Hi I have a table like this below: [dbo].[table1]( [predictions] [int] NULL, [timestamp] [datetime] NULL, [train1] [int] NULL, [train2] [int] NULL) I'm inserting data into this table ...
MMV's user avatar
  • 156
0 votes
0 answers
148 views

Sequelize model methods (findOne,findAll,create etc) not working but sequelize.query methods are working on SQL Server 2008 database

I have done same sequelize methods with Postgres database all things are working fine.Whenever I make a connection to a SQL Server 2008 database and hit the model method, I got the error and I am ...
manish's user avatar
  • 1
0 votes
0 answers
10 views

Errors when connecting to an offline .cub file by using C# ADOMD Connection

I'm trying to connect to an offline .cub file via ADOMDConnection ADOMDConnection aConnection = new ADOMDConnection(); aConnection.ConnectionString="DataSource=D:\Downloads\Market\updated.cub;...
longchang's user avatar
0 votes
0 answers
64 views

Implicit Conversion happening

Issue Description: I am using Springboot 2.7.9 and microsoft sqlserver as database. Spring data Jpa sends BigDecimal datatype as decimal(38,0) to MssqlServer where column is defined as decimal(12,0) ...
Shina Amin's user avatar
-1 votes
2 answers
57 views

Selecting rows, where a column is at its minimal value [duplicate]

The otherwise identical rows here can sometimes differ by a numerical value of one column, let's call it Group: Col1 Col2 ..... Group A B 100 A B 200 A C 100 A D 200 For a particular value ...
Mikhail T.'s user avatar
  • 3,093
0 votes
1 answer
49 views

How to update SQL Server database column

I have a table called Table1 that looks something like this : MEID Type KELO mb OLEM mb-sd And another table called Table2: MEID SD KELO NO OLEM YES I'm updating Table2 SD column like this : ...
aasenomad's user avatar
  • 395
-2 votes
2 answers
67 views

Create view with if statement

I have a query where the result changes according to the parameter. I have created a stored procedure to show what I need. I want it in a view so that I can join with other tables. CREATE PROCEDURE [...
Shamaal's user avatar
-2 votes
1 answer
72 views

I want to apply unpivot function in SQL Server and Sqllite [closed]

I have below table Monday Tuesday Wednesday Thursday Friday WeekStartsOn 8 8 8 8 8 2019-09-06 I want to convert it to below table DayOftheWeek ActualHrs WeekStartsOn TimecardDate Monday 8 2019-09-...
Sourav Guha's user avatar
-1 votes
1 answer
67 views

T-SQL in SQL Server 2008 and later : standard function to escape string variable that is going into a like comparison

I have user input coming in a parameter which then goes into a query to do a wildcard search. Similar to: DECLARE @myVariableContainingUserInput VARCHAR(50) = 'part of string'; DECLARE @myTable TABLE ...
Donald's user avatar
  • 399
0 votes
3 answers
71 views

Rolling up Values into Weekdays

I have a Basic SQL Query which looks at the SalesOrders table of our database, and shows all sales "per day" for a specific Sales Rep. ;with date_cur_month as( select convert(datetime, ...
James Davis's user avatar
1 vote
3 answers
73 views

Splitting column from one record into multiple rows

I have the following customer data in SQL Server 2008: Table name Customer_Note: Note_ID Customer_ID Note 1 99 This is a note I am adding to the record and its a very long record indeed 2 102 Note ...
Nicola's user avatar
  • 19
0 votes
1 answer
41 views

MS SQL Sort Alphanumeric values (1, 2, 3, 5, 6, 7, 9, 10, 4a, 8a, 4b, 8b) [duplicate]

In SQL database (2005/2008), I have a field named Ordernumber having the following values: 1, 2, 3, 5, 6, 7, 9, 10, 4a, 8a, 4b, 8b I want a way to sort them to be 1, 2, 3, 4a, 4b, 5, 6, 7, 8a, 8b, 9, ...
Fadl Assaad's user avatar
-1 votes
1 answer
127 views

Angular app creates 500 error code when running it locally

I have an Angular app which gives me a 500 error code when run it locally and try to create an account. I run the application on my laptop, the database is on my laptop too. The database is using ...
Suji's user avatar
  • 767
-1 votes
1 answer
56 views

Joining 2 tables with many-to-many id's, but returning 1 row [duplicate]

Table A joins to TABLE B on an ID. Table A column sometimes has a csv of ID's. I'm only interested in the first ID for the join. The 2nd problem is that table B sometimes has the same ID multiple ...
Damien's user avatar
  • 4,101
-3 votes
2 answers
68 views

Grabbing left side of comma in returned SQL result for JOIN

Table A joins to TABLE B on an ID. The problem I'm finding is that sometimes in table A, the returned column for ID is multiple ID's Separated by a comma. So what I'm trying to do is just to a join ...
Damien's user avatar
  • 4,101
2 votes
1 answer
851 views

ASP.NET Core real-time data change notification with MSSQL Server

I have a database in MSSQL Server. I want to get notified when there is a change in specific table i.e on insertion and deletion of record it update the table in real-time with SignalR hub without ...
Ayesha Iqbal's user avatar
0 votes
2 answers
79 views

Conversion failed error during trigger execution

I have created a trigger on the student table and when the dropped status is turned to true, I have to delete that student from any group he is part of and add him in another log table. The studentid ...
Noobie's user avatar
  • 107
0 votes
1 answer
174 views

Stored procedure for table search without cycles or cursors

I have a view vwValues in my SQL Server 2008 database with these columns: ExamObjID (uniqueidentifier) Locus (varchar(10)) ValOrder (tinyint) Value (varchar(5)) IndexType (char(1)) PersCount (tinyint))...
Stas Hladow's user avatar
0 votes
1 answer
120 views

Why is this query blocking other queries from running?

Here's my entire script: IF OBJECT_ID('tempdb..#Products_temp') IS NOT NULL BEGIN DROP TABLE #Products_temp END GO SELECT p.product_id, p.price, p.cost, i.qty INTO #Products_temp FROM ...
Joe Defill's user avatar
0 votes
2 answers
399 views

Laravel make an autoincrement code/records and will reset daily

I'm trying to make an autoincrement code with date and it will reset the code on the other day. I have this migration. public function up() { Schema::create('records', function (Blueprint $table) {...
Newbee's user avatar
  • 696
0 votes
0 answers
29 views

spring boot datasource not able to connect MSSQL database where user is in Active Directory

There is an user testuserAD in Active Directory and password tuAD!. also, In MsSQL DB new user testuserAD added to database TestDB and have read write access. Again, In MsSQL DB server new testuserAD ...
touchchandra's user avatar
  • 1,506
0 votes
1 answer
53 views

Is this a correct way of returning a SqlDataReader from a function?

Here's my function I use for convenience: Function executeSQL(ByVal sqlConn As String, ByVal sql As String) As SqlDataReader Dim sdr As SqlDataReader Dim objConn As SqlConnection = New ...
Joe Defill's user avatar
0 votes
3 answers
55 views

How to get running percentages or earliest date

I have a table with MemberID, MemberName, ReportingQuarter, FinalExpectedDay. I need to find the earliest FinalExpectedDay where the Member will have completed 3/5 (60%), 4/5 (80%), 5/5 (90%). Here is ...
Nhubao Rai's user avatar
-3 votes
1 answer
66 views

Microsoft SQL server doesn't connect

I am trying to connect to a server but I confront this email several times. I've tried restarting SQL Server and SQL VSS writer still doesn't work. Here is the exact error Cannot connect to LAPTOP-...
mensure.ezeroglu's user avatar
0 votes
1 answer
20 views

Database call clarification on rs.getString("columnName")

we know using Jdbc driver we connect to DB , and rs.next() points to cursor , my question is when we read each columns data using rs.getString("position of column/name of the column), My Question ...
Koppolu Balayogeeswar's user avatar
0 votes
0 answers
57 views

How to programmatically determine the state/structure of an SQL Server trigger via SQL itself?

The company I work for has a product that makes use of SQL Server 2016, with 2008 as an absolute functional minimum, and uses Liquibase to push updates to that database. There is a trigger on a table ...
R. Kåbis's user avatar
0 votes
0 answers
59 views

created cases and closed cases in the last 7 days

created date created cases closed cases teams 6-03-2023 9 7 abc 7-03-2023 8 8 abc 8-03-2023 7 9 ...
user20971593's user avatar
0 votes
1 answer
60 views

SQL Server - Fill date range gaps

I have records of employee employment that contain date ranges. There are some gaps between employments. I need to fill the gaps with date ranges and set them to inactive. All employees are to be ...
VollerSterne's user avatar
0 votes
0 answers
24 views

SQL 2008 into Excel autosave

We have an excel file that get auto-populate with information via SQL 2008 query even when this file is not opened on the computer. Now my question is as following: How can I save the excel file ...
Cedric Durand's user avatar
0 votes
0 answers
32 views

Is it Possible to Connect Two Tables from Different Servers on MS SQL Server?

I would like to know if is possible to connect two tables from different Servers on MS SQL Server. If so, how do I do this? If it is not possible on MS SQL Server, is there any RDBMS able to do it?
Lucas Correa's user avatar
1 vote
2 answers
59 views

How can I write a query where I can get different name values?

I have an table similar to the one below. ID Name Surname Grade 1 A K 10 2 B L 20 3 C M 30 4 A N 40 5 C O 50 How can I write a query where I can get different name values? For example, the ...
mehmet_kacmaz_03's user avatar
0 votes
1 answer
39 views

How to use composite key with join in SQL

I have these tables: ACCOUNTS: BANK_ID (PK) BRANCH_ID (PK) ACCOUNT_NUM (PK) CURRENCY 20 621 1001 ILS 20 623 1002 USD 20 90 1003 GBP AMOUNTS: ACCOUNT_REC (PK) AMOUNT 20 621 1001 10000 20 623 ...
Amir Tuchner's user avatar
1 vote
0 answers
164 views

Do SQL Server temp tables live in memory even after the script finishes executing?

If I have a stored procedure that users are running constantly that creates temp tables and don't clear these temp tables at the end of the stored procedure, do these temp tables continue to exist and ...
TheMortiestMorty's user avatar
1 vote
0 answers
50 views

SQL Server 2008 - nvarchar concatenation cuts off ISNULL() replacement value

I have a stored procedure in which I have a default WHERE clause nvarchar with the following: DECLARE @DEFAULT_WHERE NVARCHAR(MAX) SET @DEFAULT_WHERE = N'RTRIM(LTRIM(DD.CODIGO)) = ' +isnull(''''+@...
Alex Serafini's user avatar
0 votes
0 answers
44 views

SQL Server : Freetext search with And Operator

Project table Name columns contains this data: USA Russia England Canada Canada Query: SELECT name FROM project WHERE FREETEXT(name, '"USA Canada"') Result: the query returns both rows. ...
hsn's user avatar
  • 31

1
2 3 4 5
1077