How to convert money to decimal in SQL Server stored procedure [closed] - sql

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have stored procedure where want convert money type to decimal type.
#money = 513.9010 type money
I want to convert it to decimal - how to do that?

select convert(decimal(7,4),#money)

Related

How to convert date '20200901' to '01-Sep-20' [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
Please help me to convert the date format from '20200901' to '01-Sep-20' in SQL Server.
You can use convert() with format 12 for that purpose:
select convert(datetime,'20200901',12); -- 01-Sep-2020
You must convert '20200901' to date first ,then you can convert to '01-Sep-20' using below code
SELECT CONVERT(VARCHAR,CAST('20200901' AS DATE),106);

ORA-03291: Invalid truncate option - missing STORAGE keyword [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
i have to execute two statements in a sequence. My Statement is as below. I get the above error when i run this.
TRUNCATE TABLE MANUAL_LIST_BACKUP
INSERT INTO MANUAL_LIST_BACKUP AS SELECT * FROM MANUAL_TRANSACTIONS
Separate the two statements with a ;

SQL Server queries with datetime [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have old program with access database. I want rewrite it to MS ACCESS. In queries u have text value mm/yyyy in query how to convert it to datetime from string?
DECLARE #a nvarchar(100)
SET #a = '12052013'
SELECT CONVERT(DATETIME,LEFT(#a,2) + '/' +
SUBSTRING(#a,3,2) + '/' + RIGHT(#a,4),101)
outputs this
--2013-12-05 00:00:00.000

How to be a command in SQL using LIKE? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to select records where a field (varchar (45)) contains one and only one letter x and the field length is greater than 20
In MySQL you can do:
SELECT * FROM tablename WHERE fieldname REGEXP '^[x]{20,}$'

Generating SQL SP checksum [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
does anyone know of a way to generate some kind of checksum for each Stored Procedure on a server, in order to be able to compare them to other SP's on different servers?
Regards,
Jeroen
You could;
SELECT
ROUTINE_NAME,
HASHBYTES('SHA1', ROUTINE_DEFINITION)
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE = 'PROCEDURE'
AND OBJECTPROPERTY(OBJECT_ID(ROUTINE_NAME), 'IsMSShipped') = 0