I'm in the process of trying to optimize a query that looks up historical data. I'm using the query analyzer to lookup the Execution Plan and have found that the majority of my query cost is on something called a "Bookmark Lookup". I've never seen this node in an execution plan before and don't know what it means.
Is this a good thi...
I have an ASP.NET MVC application up and running, using a SQL Sever express 2005 database instance that is running on my development machine. When the app gets deployed to production, however, the IIS instance and the SQL Server instance will be on different logical machines. I dont know if they're different physical boxes, but i doubt...
We are using a SQL Native Client to connect to a local SQL Server 2005 from a Boarland application. It will fine for selects, inserts, and updates. When we delete we get the error:
Could not find server
'SERVERNAME\SQLEXPRESS' in
sys.servers. Verify that the correct
server name was specified. If
necessary, execute the stored
...
I have read the various questions/answers here that basically indicate that having a clustered index on a uniqueidentifier column is a poor choice for performance reasons. Regardless, I need to use a uniqueidentifier as my primary key, and I do NOT want to use newsequentialid() because the generated values are too similar to one another ...
I'm using sql 2008 express edition and I'm trying to do a multiple row insert thru my C# application.
I've got around 100000 records that needs to be inserted.
Okay all goes well for the first 1000 records then I'm getting the error:
"The number of row value expressions in the INSERT statement exceeds the maximum allowed number of 10...
I am having problems with SQL Server dropping a connection after I have dropped and re-created a given database and the next time I try to execute a command against a new connection on that same database, I get:
A transport-level error has occurred when sending the request to the server. (provider: Shared Memory Provider, error: 0 - ...
I am trying to get the name of the database I am connected to in SQL Server. I tried doing:
Query query = session.createQuery("SELECT db_name()");
List<String> dbNames = query.list();
However, I got the following error:
[ERROR PARSER:35] *** ERROR: <AST>:0:0: unexpected end of subtree
Exception in thread "main" java.lang.IllegalState...
I want to join 2 tables 'addresses' and 'user_info' on user_id and app_id
(which is a number, or it is null), like these 2 examples:
select * from user_info
left outer join addresses on addresses.user_id = user_info.user_id
and addresses.app_id is null
select * from user_info
left outer join addresses on addresses.user_id = user_in...
Let's say I have a table:
SELECT SUM(quantity) AS items_sold_since_date,
product_ID
FROM Sales
WHERE order_date >= '01/01/09'
GROUP BY product_ID
This returns a list of products with the quantity sold since a particular date. Is there a way to select not only this sum, but ALSO the sum WITHOUT the where condition? I'd like...
I have a stored procedure which executes a select statement. I would like my results ordered by a date field and display all records with NULL dates first and then the most recent dates.
The statement looks like this:
SELECT a,b,c,[Submission Date]
FROM someView
ORDER BY [Submission Date] ASC
Now this will display all records with NU...
I am looking for a way to increment a uniqueidentifier by 1 in TSQL. For example, if the id is A6BC60AD-A4D9-46F4-A7D3-98B2A7237A9E, I'd like to be able to select A6BC60AD-A4D9-46F4-A7D3-98B2A7237A9F.
@rein It's for a data import. We have an intermediate table with IDs that we're generating records from, and we join on those IDs later...
I'm trying to attach my database on a server that is running SQL2005 and I encountered an error that says that my DB is version 655 which is not suppoerted on a 612 system. Is there a way to alter my DB to get to a attach or to find out what is causing the structural change that is preventing me from attaching my DB?
SOLUTION
If you r...
In a SQL statement ( or procedure ) I want to collapse the rows of this table into a single comma delimited string.
simpleTable
id value
-- -----
1 "a"
2 "b"
3 "c"
Collapse to:
"a, b, c"
...
I have a SQL Server 2000 database that will not display the column list for any tables in the View "designer" in Enterprise Manager This problem exists when either designing a new view or when editing existing views. All that is displayed for each table in the diagram is "* (All Columns)". The views otherwise work.
I do NOT have this...
Using SQL Server 2005 and Visual Studio 2005, I'm trying to create a SSIS package to merge data from 1 table to several other tables.
The source table does not have a several fields that the destination tables do. For example 'CreatedBy' and 'CreatedDate' fields. I would like these to be hard coded (in a sense) as part of the package im...
We have a dev server running C# and talking to SQL server on the same machine.
We have another server running the same code and talking to SQL server on another machine.
A job does 60,000 reads (that is it calls a stored procedure 60,000 times - each read returns one row).
The job runs in 1/40th of the time on the first server compar...
Isn't there a (simple) way to tell Linq To SQL classes that a particular DateTime property should be considered as UTC (i.e. having the Kind property of the DateTime type to be Utc by default), or is there a 'clean' workaround?
The time zone on my app-server is not the same as the SQL 2005 Server (cannot change any), and none is UTC. Wh...
website needs to go live which i have placed on client server.i have gven all permissions for IIS.in web.config file i have also given SQL connection string as :
<appSettings>
<add key="ConnectionString" value="Data Source=USER\SQLEXPRESS;Initial Catalog=people_metrix;User ID=MyUser;Password=abc123"/> </appSettings>
In sql server 200...
I have a query that has been running every day for a little over 2 years now and has typically taken less than 30 seconds to complete. All of a sudden, yesterday, the query started taking 3+ hours to complete and was using 100% CPU the entire time.
The SQL is:
SELECT
@id,
alpha.A, alpha.B, alpha.C,
beta.X, beta.Y, beta.Z,
...
History:
I had a deployment the other night which involved executing a script that creates a stored procedure. However when running the script, an error occurred about the collation of the DB.
The Problem:
With the help of our friend Google, I managed to find out that the problem I was having was because on our live environment's db ha...