Table 1 (history data)
SiteName OutcomeType SpeciesType Count DateType
-------------------------------------------------------------
S1 Adopted Dog 3 0
S2 Adopted Cat 12 0
S1 Transferred Puppy 2 0
S1 Transfer...
Is there a way in SMSS to detect whether a table has any records? I need to get a list of tables that have records. perhaps there is a sql statement that will do the trick?
...
I'm trying to filter a relationship table down to get a subset of the table where two conditions are met (ie: I want all of the id's of the entries who's color_ids are 1 or 2). It's a beefy table, so I'm trying to optimize as much as possible.
I was wondering if anyone could explain my finding in this case:
Why is
SELECT DISTINCT a.id...
If I have a table of random values in a sql table, how can I export and display them as a raking rather than the absolute value... for example.. if the three values are 30 85 and 90 how do i get 30 do display as 1 or 1st, 85 as 2 or 2nd etc
...
I'm trying to do some simple manipulations with variables in MySQL 5.0 but I can't quite get it to work. I've seen many (very!) different syntaxen for DECLARE/SET, I'm not sure why... in any case I'm presumably confusing them/picking the wrong one/mixing them.
Here's a minimal fragment that fails:
DECLARE FOO varchar(7);
DECLARE oldFO...
I know the .Contains() method does like LIKE %therm%, the .StartsWith() method does like LIKE therm% and the .EndsWith() method like LIKE %therm but...
Is there a way to do like below on **Linq to Entities**?
SELECT * FROM [dbo].[Users] WHERE Name LIKE 'rodrigo%otavio%diniz%waltenberg'
PS: I'M USING LINQ TO ENTITIES. NOT LINQ TO SQL
...
I would like to have a view that I could run return multiple result sets. Is this possible?
If a view can not do this, then is there another object with High Visibility/Transparency within SQL Server that can achieve this? (I like using a view because I can easily see it and run it under the Views folder). A stored procedure is not rea...
I have a very simple set-up. Table "Node" has a nullable foreign key "ObjectId." This is represented in my database model with a one-to-many association. Now, I want to run a query that gives me all Node-Objects with a particular object id. In straight SQL, this is very easy:
SELECT Node.*, Object.*
FROM Node INNER JOIN Object
O...
I have a site under drupal (using mysql) but need it to read from a external sql database and make quires/reports, maybe using views2?
Is is at all possible? I been looking for a solution to just read (not import, its thousands of entries...) from an external database for hours and not sure if its even possible.
...
Is this a design choice by Microsoft, or is there a way to do it, that I'm not aware of?
...
Can someone please explain to me why I keep getting this PLS-00905 error for the below simple procedure? Thank you.
create or replace procedure copy_table(
table_name IN varchar2,
database_link IN varchar2,
suffix IN varchar2,
table_owner IN varchar2)
IS
begin
execute immediate 'create table ' || table_name || '_'...
I want to call a web service from my SQL code, but it cannot be using CLR code.
Can this even be done?
...
REPHRASING QUESTION:
i apologize for being unclear. i have a textbox and a button a form. when the button is clicked it runs this saved access query:
select * from sqlservertable where field=form!textbox.value
i have an access front end and sql server back end.
this query is not working. it doesnt like me passing this parameter form...
I am working with an IBM Maximo database that issues workorders automatically. When the workorders are issued (aka Inserted into the database workorder table), I would like to auto-assign a supervisor, owner, and owner group based on a set of criteria. This only needs to happen IF the supervisor, owner, and owner group aren't already ass...
Here's a tricky normalization/SQL/Database Design question that has been puzzling us. I hope I can state it correctly.
You have a set of activities. They are things that need to be done -- a glorified TODO list. Any given activity can be assigned to an employee.
Every activity also has an enitity for whom the activity is to be perf...
Hello,
I've got a bunch of classes that describe database schema: Table,Field,ForeignKey.
Tables have ForeignKeys list and Fields list.
Now I would like to generate SELECT statement with all the joins that are described in ForeignKey instances.
The question is: is order of tables relevant for the query time? Another words - do I have ...
I'm using some old code that runs a sql query as a reference.
At some point, it gets to something like:
sqlDataAdapter.Fill(dataSet);
DataRow dataRow = dataSet.Tables[0].Rows[0];
Object obj = dataRow[fieldName];
The old code does:
string output;
if (!string.IsNullOrEmpty(obj.ToString())) { output = obj.ToString(); }
else { output = ...
Hello,
I am trying to merge 2 databases with the same schema together, and this is one part of it.
I have changed the subject to keep it more understandable - I cannot change this schema, it's just what I'm working with.
I have a table in both my source and target databases with the following columns:
Car
CarType1
CarType2
CarType3
C...
Just more a general question I can't seem to find a definite answer on.
But what is a good SQL wrapper for C++ that allows me to call queries?
I'm used to Oracle, but i've used MYSQL before aswell.
And how would you call something such as an insert statement (for example) in one?
...
Hi,
I have a dropdown that is bound to a column in an excel spreadsheet. I select a customer in the dropdown and then populate some address fields with related data also from the excel spreadsheet.
Code:
Private Sub cboCompany_Change()
Dim customerName As String
customerName = cboCompany.Value
custo...