I use RedGate SQL data compare and generate a .sql file so i can run it on my local machine but the problem is the file is over 300mb and i can't do copy and paste because the clipboard won't able to handle it and when i try to open the file in sql management tool. it give me error compiling about the size.
is there a way to run large ....
(resolved: see bottom)
I have the following code snippet:
Protected Sub SqlDataSource1_Inserted(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs)
Handles SqlDataSource1.Inserted
affected = CInt(DirectCast(e.Command.Parameters("@affected"), IDbDataParameter).Value)
newID = CInt(DirectCas...
Hi there!
I have 2 tables:
1. Employees
2. Vouchers
Employees table has a single primary key.
Vouchers table has 3 foreign key constraints referencing the Employees table.
The following is a sample T-SQL script (not the actual table script) to create both tables and their relationship in SQL Server:
IF OBJECT_ID('dbo.Vouchers') IS N...
I have a LINQ to SQL model setup - however in my app there are certain places where I want "friendly" column names for example:
"NameFirst" to be "First Name"
"AgencyName" to be "Agency"
Just looking for suggestions on where the best place/technique to create these mappings would be - without changing the model. These mappings won't ne...
Problem 2b goes as follows:
2b. For each subject show the first year that the prize was awarded.
nobel(yr, subject, winner)
My solution was this:
SELECT DISTINCT subject, yr
FROM nobel
ORDER BY yr ASC;
Why isn't this working?
...
I want to be able to pass something into an SQL query to determine if I want to select only the ones where a certain column is null. If I was just building a query string instead of using bound variables, I'd do something like
if ($search_undeleted_only)
{
$sqlString .= " AND deleted_on IS NULL";
}
but I want to use bound que...
I have a db2 database file, but do not have a db2 server. I would like to export this data into something else (e.g. SQL, but it doesn't really matter what), without having to setup a full db2 server (I started looking into this, but it seems very involved).
Ideally the tool would run on (Debian) Linux, but Windows/OS X is fine if nece...
Consider these 3 table structures. Which will perform these queries the best.
Structure 1 - TagID as int with a join table
Article
-------
ArticleID int
Article_Tag
------------
ArticleTagID int
ArticleID int
TagID int
Tag
---
TagID int
TagText varchar(50)
Structure 2 - Tags only in Join table as string
Article
-------
articleID i...
Pretty self explanatory question. Is there any reason to use one or the other?
...
SELECT * FROM friends
WHERE (user1 = $userid OR user2 = $userid) AND accepted = 1
how would a JOIN look like if i want to get lets say user2's information from table "users"?
table friends:
id int(11) NOT NULL auto_increment,
user1 int(11) NOT NULL,
user2 int(11) NOT NULL,
date datetime NOT NULL,
accept tinyint(1) NOT NULL,
...
Consider the tables: (-> denotes a SQL defined relationship)
USER (userid, username, imageid->IMAGE.imageid)
EVENT (eventid, userid->USER.userid, description)
IMAGE (imageid, location)
Say I have a view (let's call it vw_UserInfo) defined as the following query.
SELECT u.*, i.* FROM users u
INNER JOIN images i ON i.imageid = u.imagei...
Ugh ok I'm terrible at explaining things, so I'll just give you the quotes and links first:
Problem 4b (near bottom):
4b. List the film title and the leading actor for all of 'Julie Andrews' films.
movie(id, title, yr, score, votes, director)
actor(id, name)
casting(movieid, actorid, ord)
(Note: movie.id = cast...
I work in a group of about 25 developers. I'm responsible for coming up with the database design (tables, views, etc) and am called apon for performance tuning when necessary.
There are a couple of different applications that connect. Database access is via JDBC, hibernate, and iBatis SQL maps. Developers with various levels of exper...
Alright, this one (3a; sample problem with provided answer) has got me scratching my head:
bbc(name, region, area, population, gdp)
3a. Find the largest country in each region:
SELECT region, name, population
FROM bbc x
WHERE population >= ALL
(SELECT population
FROM bbc y
WHERE y.region = x.region
AND...
I have the option of writing two different formats for a database structure:
Article
-------
ArticleID int FK
Article_Tags
------------
ArticleTagID int FK
ArticleID int FK
TagText varchar(50)
or
Article
-------
ArticleID int PK
Article_Tags
------------
ArticleTagID int PK
ArticleID int FK
TagText varchar(50) FK
Tag
---
TagText v...
I have a query :
select score, count(1) as 'NumStudents' from testresults where testid = 'mytestid'
group by score order by score
where testresults table contains the performances of students in a test. A sample result looks like the following, assuming maximum marks of the test is 10.
score, NumStudents
0 10 1 20 2 12 3...
I am new to sharepoint development. I have a list, this list has a column that is called Todaysdate, this column needs to be updated daily to todays accual date and since it contains ~20,000 rows I am NOT going to update it manually everyday. Because it's used in a calculation row.
My question is can I just use SQL and update the rows...
$query = mysql_query("SELECT * FROM news WHERE id = '{$_GET['id']}'");
$news = mysql_fetch_assoc($query);
$sql84 = mysql_query("SELECT username FROM users WHERE id = '".$news['user_id']."'") or exit(mysql_error());
$author = mysql_fetch_array($sql84);
is there i better way of doing this? a join maybe? how that look
...
In sql server 2005 , inside an update trigger is there a way to find the list of fields\columns those are modified by the original update query.
I have a table with 150 columns and inside the trigger need to konw if ONLY one particular field was updated or not ( and no-other field was modified )
I can write a long sql to compare 150 c...
How to decide whether to choose a Replication or Mirroring in SQL Server 2005 to provide data availabilty and performance at the same time.
...