I need to investigate a series of blocks and deadlocks that have been occurring randomly on our SQL 2008 server. I am the main developer on the site and do not have a DBA to lean on...
I am planning on using the Blocked Process Report in 2005 and enabling a trace.
What performace issues can I expect? The DB server is for a website wit...
The first picture is my query. I need to obtain results in second picture.
What to do? Which query do have to use?
Select OrarioA, OrarioB, Max(IDOrario), (????)IDDettaglioOrarioA, (???)IDDettaglioOrarioB
FROM TABLE
GROUP BY
OrarioA, OrarioB, ??????????????
I need respective IDDettaglioOrarioA, IDDettaglioOrarioB.
How to complet...
i have two tables, products and categories. how do i convert the following sql query to linq format?
select c.Name, c.DisplayName, count(p.id) from categories as c
LEFT join products as p on p.categoryId = c.id
group by c.Name, c.DisplayName
some categories will have 0 products in them so the LEFT JOIN is important
...
Hi,
Is there a way I can improve this kind of SQL query performance:
INSERT
INTO ...
WHERE NOT EXISTS(Validation...)
The problem is when I have many data in my table (like million of rows), the execution of the WHERE NOT EXISTS clause if very slow. I have to do this verification because I can't insert duplicated data.
I use SQLServ...
What is the recommended method for executing a SQL Server script from within a .NET application and why?
I'm in process of creating an application we can run from our installer to handle upgrading our database when a prior version of our application is installed. The database has a version table that I can programatically access and ...
In MySQL you can quite simply read a file with SELECT load_file('foo.txt') and write to a file with SELECT 'text' INTO DUMPFILE 'foo.txt'.
I am looking for a way to do this in MSSQL 2000 without using any external tools, just with queries or stored procedures.
...
How do you create a MembershipProvider for use in an ASP.NET/MVC website?
Doesn't it generate the tables it needs for you in your database?
...
I have transactional replication running between two servers over a dedicated VPN connection. The databases are fairly large, so I initially use the backup and restore method to get the initial snapshot over to the subscriber machine and then let it apply the incremental transactions from there.
Everything runs fine until the VPN line ...
Is there a special way to declare a DateCreated column in a MS Sql Server table so that it will automatically fill it with the appropriate time-stamp when created?
Or.. do I have to provide the datetime to it when I do the query, manually?
...
Using this SQL on SQL Server 2005
SELECT CONSTRAINT_NAME
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE TABLE_NAME = @TableName
AND COLUMN_NAME=@ColumnName
I get the Primary Keys AND the Foreign Keys.
How can I get only Foreign Keys?
How can I see if a Constraint is a Primary or a Foreign Key?
Thanks
...
Hi,
I am actually having 100's of SP in my database. I have to find a set of 10 SP's in that which have a particular comment inside them. Is there any search query for this.
...
If a column is null, does that affect the space used by the column?
Is the space used fixed by the column definition?
Does this vary from database to database.
(I am mainly interestred in SQL Server 2000.)
Clarification:
The question relates not to what happens when the column is 'nullable' (This costs another bit as Kritsen & gbn point...
I'm using C++ to query a SQL Server 2005 database using ODBC. The queries contain parameters that I set using SQLSetParam(). I run the queries by calling SQLExecute().
Occasionally a query will fail, and I need to log the context of the failure. I am calling SQLError() to get the error information, but I would also like to log the raw q...
I had no luck with this question so I've produced this simple-as-possible-test-case to demonstrate the problem.
In the code below, is it possible to detect that the connection is unusable before trying to use it?
SqlConnection c = new SqlConnection(myConnString);
c.Open(); // creates pool
setAppRole(c); // OK
c.Clo...
I am looking for a way to set the width on the returned column result from a SQL query.
I run a query like Select Product from ConfigScheduling where Product is an Nvarchar(Max) column.
The result in SQL Server Management Studio with Results to Grid is a 90 char wide visible column, with the full result present, but not visible.
Thank ...
I have MSSQL running on a Windows server. I can connect to it using ODBTP, ADODB and PHP from other windows servers. When I try the same thing on a Linux server, I get a response error:
[ODBTPERR][0]Invalid Response in /var/www/html/Database/adodb5/drivers/adodb-mssql.inc.php on line 726:[ODBTPERR][0]Invalid Response
The ODBTP (v1.1.4) i...
I'm building this report in a system for a Billboard company.
They have a table that stores all their billboards, and among other data, billboards have a Start Date and a Finish Date (both can be null).
If for some reason a billboard has to stop beeing used, they set a finish date and it will become unnavaiable to be used after that date...
I have a very large existing set of tables being replicated (transactional) between two servers over a dedicated VPN connection. I need to add a new table. Reloading all the tables is not an option.
I thought that by simply adding the new articles to the publication it would replicate them across, but that didn't work. Of course, som...
I need to select the rows of a table where a column value is numeric, any Help?
EDIT: I have a varchar column and I need to select the ones that are numbers and the ones that are not.
EDIT 2: Integer.TryParse cannot be use because it cannot be translate to SQL.
...