I sql in txt file i have to format the enterie sql.I have to run each query in snowflakeit's 2800 lines.Is there any easy way to format sql?
I appreciate your help
Thanks in advance
I've used this site before to format SQL and works pretty well
Instant SQL Formatter
Related
Thanks for your help in advance. I'm new to Oracle SQL Developer, and my SQL code works fine, BUT the way it's separated by SQL Developer, makes it not work. I need to have it run in segments like this example:
How I need the code separated (good):
How my code is separated (not good):
I found the answer: I have to put a semicolon at the end.
;
Lmao. How silly. Please keep this thread for anyone else who makes a simple mistake.
Regards,
A timeclock table in SQL is storing TimeIn/TimeOut as 1:00p in a format which when i export into excel will not let me subtract and get the time difference.
I was trying to run a query in SQL and convert the times within SQL so that when i export i can subtract. In Access i was using CVDate.
This is the sql code i tried using:
Convert (varchar(6), dbo.tblPayrollFlashPunch.TIME_IN, 108) as TimeIn,
CONVERT (varchar(6), dbo.tblPayrollFlashPunch.TIME_OUT, 108) as TimeOut,
Any help will be appreciated, btw I am very new to SQL and we are running SQL 2008.
Below is a snapshot of sample data.
(Original here: http://i.stack.imgur.com/AS8BS.gif )
Edit: I was hoping SQL could do the conversion so that i could pull the data through a view directly into excel and have the correct format so that my formulas work. Also, I've tried changing the formats in excel with no success. In MSAccess you can use CVDATE and works great.
Edit 2: Being the noob that I am i just realized we are running SQL Server 2005 which explains why i cant use many of the suggested functions.
Which SQL are you using?
In T-SQL, I believe this would work if your time column is a string/varchar.
CONVERT(TIME, (dbo.tblPayrollFlashPunch.TIME_OUT + 'm'), 108) as TimeOut
What about using DATEDIFF in TSQL to get the difference straight from there?
I have a simple Oracle query with a non traditional mask:
SELECT TO_CHAR(1234567, '9G999G990D000000') VALUE_STR FROM dual
--- 1.234.567,000000
And I am not able to convert it to Sql Server 2005, I cannot figure out how to maintain the remaining decimal places:
SELECT CONVERT(VARCHAR(30), CAST(1234567 AS MONEY),1)
--- 1.234.567,00
I would appreciate some help on an elegant way to perform this query.
A workmate found this solution:
http://eltonbicalho.blogspot.com.br/2010/08/formatar-dinheiro-no-sql-server.html
It is working pretty fine, but is not the elegant way that I was looking for. Anyway it saved us some time.
PS: The solution is presented in portuguese.
I was wondering if there any program that can convert ArgoUML files into sql code?
Thanks
Try argouml-db. It uses this plugin for argo.
I am not able to see Arabic letters while using pl sql developer
In one database, its showing correctly, but when I query in another its not coming up.
Is there anything to change in settings ? if anyone knew please let me know !!!
Might be datatype on the other database in not the NVARCHAR. Please make sure that it is nvarchar datatype in the other database also.