I have the following procedure (select) that gives me some information:
SELECT id_accion, accion_tomada, CAST(fec_inicio AS VARCHAR) AS fecha_ini,
CAST(fec_fin AS VARCHAR) AS fecha_fin, estatus
FROM detalles WHERE id_downtime = @id_dt...
Use SQL server 2008 R2
I want to make a simple select that using a GETDATE() show a specific date format without year:
day / month
This select gives me the values but in separate columns
SELECT MONTH(GETDATE()...
Assuming I have the following Date / Time in a tabla of the Database:
Entry : 05/03/2018 08:00:00.000
, Exit : 05/03/2018 18:00:00.000
I need to get the following output:
Entrada : 08:00:00 a.m....
I have an sp which I want to store inside a temporary table, either a table variable or a temporary table, in both cases, this error marks me:
An INSERT EXEC statement can not be nested.
This is my code that I am generating to store th...
$qry = "select
CONVERT(VARCHAR(20),fechaSalida,108) AS fechaSalida,
CONVERT(VARCHAR(20),fechaEntrada,108) AS fechaEntrada,
CAST(DATEDIFF(minute, fechaEntrada, fechaSalida)/60.0 as decimal (18,2)...
I have the following problem:
In the BDD I have records of thousands of products with the invoice date and the amount that was sold. What I need is to add records for all the product codes that I have registered, taking all the dates from the...
I want to verify if there is a database BDDATOS1, if it exists I create a table in this database BDDATOS1, otherwise I create a table in database BDDATOS2.
When I run the following
IF EXISTS(SELECT * FROM master.dbo.SYSDATABASES WHERE NA...
I have the following SP and it marks me the following error in the SP:
SQLState = 37000, NativeError = 137 Error = [Microsoft] [SQL Server]
Native Client 10.0] [SQL Server] Must declare the scalar variable
"@Today". SQLState = 37000, N...
The following sql code for the compaction of the log:
use My_dabase
go
declare
@arch_log sysname
set @arch_log =(select name FROM SYSFILES
where fileid = '2')
select name from sysfiles
ALTER DATABASE My_database
SET RECOVE...
Hi, I wanted to know if it is possible to carry out a split as shown below, since I need to receive a string of words separated by commas; So far I have not been served by the methods I have seen on the internet.
SELECT *
FROM BASE
WHERE Doc i...