I am trying to query an .xls spreadsheet with VBScript, but I have run into an issue when trying to cast a field. I connect to the spreadsheet like this.
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DataSource & ";Extended Properties=""Excel 8.0;HDR=No;"";"
...
Hi,
Can anyone please point out what im doing wrong with this Stored Procedure please. I cant get it to compile and my software isnt giving any useful clues as to what is wrong with it.
CREATE PROCEDURE web.createSubscriptions
(
@Member_Id BIGINT,
@Trans_type VARCHAR(100),
@Payment_Status VARCHAR(100),
@Payment_Date DATE...
I'm trying to add the AS400 as a linked server in SQL 2008 Express in order to access some tables in a DB on the iSeries. I've tried all of the OLE providers with many different strings and have had no luck establishing a connection. Is this even possible with this version of SQL?
Thanks
...
I have this query
select BUnit, value from myTable where BUnit in (555,556,557,558)
and this values for Bunit are constructed dynamicaly, ie. a program builds queries on demand, and not always this will be the selected numbers.
A possible query result would be
Bunit value
556 10.2
558 5.18
How...
It doesn't look like ispropertyavailable in the select tag is in ibatis 3. I'm moving a project from 2 to ibatis 3, is there another way to handle this scenario?
...
Hi I am trying to get information on an Oracle package directly from PHP using OCI8:
$sql = 'DESC my_package';
$stmt = oci_parse($conn, $sql);
oci_execute($stmt);
this returns:
Warning: oci_execute() [function.oci-execute]: ORA-00900: invalid SQL statement in /oci8_test.php on line 16
I know the command works as I tried it in SQL...
I want to retrieve multiples values from a field. the code I am using this this
$conditions = array('Tag.name'=>$compare);//$compare = array('value1', 'value2',..);
$values = $this->find('all', array('conditions' => $conditions));
But It keeps coming out like this
SELECT `Tag`.`id`, `Tag`.`name`, `Tag`.`count` FROM `tags` AS `Tag...
I want to do some quick inserts but avoid duplicates into a Table.
For argument's sake lets call it MarketPrices, I've been experimenting with two ways of doing it but not sure how to benchmark which will be faster.
INSERT INTO MarketPrices (SecurityCode, BuyPrice, SellPrice, IsMarketOpen)
SELECT @SecurityCode, @BuyPrice, @SellPrice, @...
Hello,
Does anyone know how to import a mysql sql file into microsoft visio 2007, and then generate a database chart automatically?
Thanks a lot.
...
How do you return 0 instead of null when running the following command:
SELECT MAX(X) AS MaxX
FROM tbl
WHERE XID = 1
(Assuming there is no row where XID=1)
...
If I raise an error in an AFTER UPDATE trigger in Sql Server 2005, will that cause the update which caused the trigger to be fired to roll back, even if the statement was not executed within a transaction?
Thanks.
...
Hi all,
first, I was pretty lost giving this question a correct title.
I'm working on a system which allows me to find specific networking devices. A network device (called "system" in my example) has a number of ports, where each port can have a specific configuration. An example would be: Return all devices which have at least 2 por...
I was reading this fabulous list of sql dba scripts at http://www.sqldbtools.com/Scripts.aspx, not affiliated with them. And I want to run this query...
select top 10
qs.execution_count,
st.dbid,
DB_NAME(st.dbid) as DbName,
st.text from sys.dm_exec_query_stats as qs cross
apply sys.dm_exec_sql_text(sql_handle)
st order b...
How do you create a temporary table exactly like a current table in a stored procedure?
...
Is there any application/project that provides you with a command line SQL client that will work with multiple databases and/or provides a mechanism for writing your own drivers?
Put another way, I'm looking for something like the mysql command line client or SQL*Plus for Oracle, but that's database agnostic.
All platforms welcome,...
I'm trying to write an SQL query that would search within a CSV (or similar) array in a column. Here's an example:
insert into properties set
bedrooms = 1,2,3 (or 1-3)
title = nice property
price = 500
I'd like to then search where bedrooms = 2+. Is this even possible?
...
I am having trouble with dynamic SQL.
Early in my code I assign data to a bunch of local variables.
I want to access these later in my code and use the data values.
The code example below shows a simplified example to explain what I am trying to do.
-- ----------------------------------------------
-- Declare and set the data into a ...
Is it possible to set up SQL Server with a web service to receive and store data bypassing the IIS/ASP.NET layer altogether?
I know it's possible to set up a web service via HTTP End Points and such to return requested data but I can't seem to find examples to show the opposite process.
...
Is this possible or the right way to go about this (if you're not using a stored proc):
conn.CommandText = "set @TotalPts = select SUM (pts) from cars where completedDate is not null and customerID = @customerID";
conn.AddParam("@customerID", customerID);
conn.AddOutputParam("@TotalPts", SqlDbType.Int);
...
I have a stored proc .sql file on my system. I want to be able to move this file into database as a sp from C# code.
i could open the file, read it in as a string, and execute it but I feel like there should be a better way.
...