With my Windows batch file, I have following SQL statement: FOR /F “eol=; tokens=1,2,3,4,5,6* delims=, ” %a in (myfile.txt) do( sqlcmd -SmYSerbver -Uhhh -P12345 -dmyDB_Admin -Q”insert into …
ssis replace variables in sql code
Using an SSIS package, is it possible to load sql code that contains variables in it, replace those variables and run the code without saving it(similarly to DTS 2000 packages)? For example, I want …
How do identify the first character of a string as numeric or character in SQL
I need to identify the first character in my data as numeric or character in SQL Server. I am relatively new to this and I don’t know where to begin on this one. But here is what I have done to this point. I had data that looked like this: I used the right function to remove the ‘transfer fromR…
Why Can’t I Connect to My Database Over the Internet
I have an sql database called roottesting and I manage it at the ip 192.168.1.121. I also have a simple java application that connects to it (or rather, is supposed to connect to it) over the Internet with a user named ‘user’ that has a host of ‘%’, which I know will make it usable for…
How to select from User Defined Table Type?
The above query returns me data but when I try to query the data within, it says dbo.udt_test not exists? https://msdn.microsoft.com/en-us/library/ms131086.aspx Referred to the above link, there should be no problem with the select query to display data. May I know if I missing something obvious here? Answer …
Column count doesn’t match value count at row
INSERT INTO clnt_reports_01 (r_id, cl_no, cl_no, servi, size, vol, deliver_point, port_, a_port, road, term, compet, speed, rcomments, stage, meetrating, username, user_status, kids, hobbies, …
How to set to NULL a datetime with 0000-00-00 00:00:00 value?
I need to change a few values on my DB. I forgot to set nullable to the table and it set to 0000-00-00 00:00:00 by default. Now I need to convert that value in NULL. The field type is Datetime. How can I do it? I try with the typical Update table set field = NULL WHERE field = ‘0000-00-00
Operation not allowed after ResultSet closed (mysql, java)
I was stuck with the error , here my line number 42 is while(rs.next()){, please help me with this i am stuck at this for few hrs. > Exception in thread “main” java.sql.SQLException: Operation not …
How to iterate over results of query
I am creating a function in pgsql script language, and what I want to do in this point is iterate over the results of a query and for each row do something specific. My current try is the following, where temprow is declared as temprow user_data.users%rowtype. The code in question is the following: However I …
Running Oracle SQL query over several dates
Within Crystal Reports, I’m using the following query (against an Oracle database) to generate data for a single field in a report: This works fine and returns a single integer value, based on the {?HB_As_At_Date} supplied (The {?} syntax is Crystal’s way of embedding parameter values into SQL). T…