Skip to main content

Questions tagged [sql-server-2005]

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

-1 votes
1 answer
235 views

Script to change the SQL Default database location in windows

Can someone help me with any script like windows script, BAT script or SQLcmd script for changing the default database location of SQL. I am using Windows
Manasa gowda's user avatar
0 votes
0 answers
137 views

Connect SQL Server and MySQL

I've a SQL Server 2005 on a Windows PC and I also have a MySQL database on another Linux server. I'm looking for a way to combine both databases under a 3rd server, to run respective queries and ...
Ervin Skendaj's user avatar
0 votes
3 answers
713 views

SQL - Remove pattern from varchar string

One of our applications was appending notes to the end of one of our columns, we have now removed this from the app and wish to remove existing from the data. I have a pattern within Varchar (2000) ...
Benison's user avatar
-1 votes
1 answer
64 views

Why is dbTimeStamp() adding a comma?

I have the following code: $NOW = $db->dbTimeStamp(time()); And using that in a query it is producing a timestamp like this: 2021-01-13, 08:17:06PM However, that comma seems to be causing the ...
Darrell Brogdon's user avatar
4 votes
2 answers
12k views

How to get timezone offset from the timezone name

I have a timezone name like America/Vancouver saved in a SQL Server database. I want to get the UTC offset from the timezone name in SQL like America/Vancouver has -08:00 offset. So how can I write a ...
Haresh Makwana's user avatar
0 votes
1 answer
45 views

Connect two queries using join or any other method?

I'm using two tables. One is [Receipt Cash Book] (RCB) & other one is Banking Cheques. Some Records insert from RCB & Insert into BC. I wrote following queries to view records in RCB table ...
Mark S Fernando's user avatar
0 votes
1 answer
73 views

Running total for payments to the issued invoices

I have the following tables: create table Invoices (InvoiceID int, InvoiceDate date, Total money); insert into Invoices (InvoiceID, InvoiceDate, Total) values (1,'2020-11-01', 20), (2,'2020-11-01', 14)...
milo2011's user avatar
  • 339
0 votes
1 answer
97 views

Running total SQL Server query

So far, I have the following SQL Server 2005 query: WITH D AS ( SELECT CONVERT(VARCHAR, '2020.11.01', 102) AS d_y_m, CAST('2020-11-01' AS DATETIME) AS dt UNION ALL SELECT CONVERT(VARCHAR, DATEADD(dd, ...
milo2011's user avatar
  • 339
-1 votes
1 answer
304 views

How to remove null values in lat long in sql

I am using this below query and it is giving me an error. The error that I am getting is at the very bottom. The error is caused by lat and long having null values in a few of my transactions. I ...
Sal Ali's user avatar
  • 23
0 votes
1 answer
1k views

How to get table's metadata from linked server (SQL Server)

How to get tables metadata from linked server/another database? The query below works ideally when running on the main server, but returns null if calls remote server or even another database. select ...
Alex Ivanov's user avatar
1 vote
1 answer
74 views

INSERT with selected value

From the Table: user | groupId ------------------------- A | 1 B | 1 B | 2 C | 1 C | 3 I would like to find all the records without groupId = 2 and thus insert it, ...
standalonec's user avatar
0 votes
0 answers
151 views

Which SQL server version supports varchar(MAX) data type

We should use varchar(max) when length of string varies and max limit is 2GB. Is it supported in older versions like SQL server 2005? If supports then still the MAX size limit is 2GB?
Ismail Asghar's user avatar
1 vote
0 answers
58 views

XML Parsing in SQL

I have to parse the below xml query DECLARE @xml XML, @Columns VARCHAR(MAX) set @xml='<d><record1><columnA>1</columnA><columnB>as</columnB><columnC&...
Abinaya's user avatar
  • 11
0 votes
2 answers
73 views

Occurrence in MS SQL Server

create table #Task (ID int, Name varchar(1), Occurrence int) insert into #Task values (1, 'A', 2) insert into #Task values (2, 'B', 3) insert into #Task values (3, 'C', 1) insert into #Task values (4,...
Suresh Gajula's user avatar
1 vote
2 answers
3k views

Alternative for lead() function in SQL Server 5

I want the same output as lead function do for window function. I want to do it for SQL Server version 5.0 Table Name: Table EventID CID Date 123 1 01-12-2020 123 2 01-12-2020 123 ...
ANSH's user avatar
  • 21

15 30 50 per page
1
3 4
5
6 7
1224