Questions tagged [sql-server-2005]
Use this tag for questions specific to the 2005 version of Microsoft's SQL Server.
sql-server-2005
18,357
questions
-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
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 ...
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) ...
-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 ...
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 ...
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
...
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)...
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, ...
-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 ...
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 ...
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, ...
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?
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&...
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,...
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 ...