sql-server

How would views & procs referencing another db cause log to grow?

Hi, I've got 2 databases on one server; let’s call them db A and B. Database A is about 11 GB, database B is very small (155mb). Database B has some views and procs which are constantly accessing and updating data in database A. The interesting thing is, the log for database B quickly grows to huge sizes, I think it grew to about 12 ...

MMORPG Client/Server Coding

How are the UDP and TCP protocols used in MMORPG client/server communication? For example: Does the client broadcast (player position, etc) via UDP to the server? or vice versa? Or is it more like using TCP where the Client requests that the server move the player. The server receives the request, moves the player and sends back to t...

SQL Server 2005 Pivot on Unknown Number of Columns

I am working with a set of data that looks something like the following. StudentName | AssignmentName | Grade --------------------------------------- StudentA | Assignment 1 | 100 StudentA | Assignment 2 | 80 StudentA | Total | 180 StudentB | Assignment 1 | 100 StudentB | Assignment 2 | 80 Student...

c# query ms access against sql server

I have been asked to setup a course leaflet system for a college. For whatever reason in the past their current system is not linked to their actual course file, they wish to close this link so course leaflets are related to actual course codes. Unfortunately their course file is a ms access database linked to many of their existing syst...

Reconciling a column across two tables in SQL Server

There are two Databases, Database A has a table A with columns of id, group and flag. Database B has a table B with columns of ID and flag. Table B is essentially a subset of table A where the group == 'B'. They are updated/created in odd ways that are outside my understanding at this time, and are beyond the scope of this question ...

How to determine total number of open/active connections in ms sql server 2005

My PHP/MS Sql Server 2005/win 2003 Application occasionally becomes very unresponsive, the memory/cpu usage does not spike. If i try to open any new connection from sql management studio, then the it just hangs at the open connection dialog box. how to deterime the total number of active connections ms sql server 2005 ...

Sql Server Backup to UNC

I've create a maintenance plan on my SQL Server 2005 server. The backup should be written to another server. I'm using a UNC path for this. The user running the SQL Agent jobs has full access to the other server. It's admin on both servers. The problem is that this statement fails ( has the correct server name ofcourse): EXECUTE mas...

Emulate MySQL LIMIT clause in Microsoft SQL Server 2000

When I worked on the Zend Framework's database component, we tried to abstract the functionality of the LIMIT clause supported by MySQL, PostgreSQL, and SQLite. That is, creating a query could be done this way: $select = $db->select(); $select->from('mytable'); $select->order('somecolumn'); $select->limit(10, 20); When the database s...

SQL Server application role, performance hit

I plan to use MS SQL Server 2005 application roles in my application. I will start the role by executing the *sp_setapprole* and finish by executing the *sp_unsetapprole* SPs. The application is implemented in ASP.NET. I've read that connection pooling doesn't work with application pooling and there is no way to react on connection disc...

How do you use LEFT on a NTEXT SQL Server Column?

How do you use the LEFT function (or an equivalent) on a SQL Server NTEXT column? Basically I'm building a GridView and I just want to return the first 100 or so characters from the Description column which is NTEXT. ...

N prefix before string in Transact-SQL query

Would you tell me, please, when should I use N prefix before string in Transact-SQL query? I have started to work with a database where I don't get any results using query like this SELECT * FROM a_table WHERE a_field LIKE '%а_pattern%' until I change pattern to N'%а_pattern%'. I never had to add this prefix in the past, so I am curio...

sql union with an aggregation component

I have a query that I use for charting in reporting services that looks something like: (SELECT Alpha, Beta, Gamma, Delta, Epsilon, Zeta, Eta, Theta, Iota, Kappa, Lambda, Mu,Nu, Xi from tbl WHERE Alpha in (@Alphas) and Beta in (@Betas) and Gamma in (@Gammas) and Delta in (@Deltas) and Epsilon in (@Epsilons) and Zeta in (@Zetas) ...

Is is possible to write MS SQL Server add-in?

Is is possible to write MS SQL Server add-in? I'm thinking of some application integrated with database server available form SQL Server Enterprise Manager. ...

Doing an edition change of Sql Server 2k5 on Windows Server from Standard to Workgroup

Hello, I am using Sql Server 2k5 Standard Edition at work, and I have been tasked with doing an edition change to Sql Server 2k5 Workgroup Edition. This is to be done on Windows Server 2k3 Standard Edition. Due to a failed attempt, I have a few questions: -Firstly, I’ve backed up my databases via the Backup tool in tasks when right cli...

Query that returns list of all Stored Procedures in an MS SQL database

Is there a query that returns the names of all the stored procedures in an MS SQL database (excluding "System Stored Procedures" would be a nice touch)? ...

Best Approach to Brownfield Database Development in SQL Server 2000/2005

I've recently taken over development on a SQL Server 2000 database that needs some help. We're planning on upgrading it to SQL Server 2005 soon. This database has no audit fields on the tables (CreatedBy, CreatedDate, etc.), no foreign keys, and terrible overall design. There are half a dozen programs that directly access the database...

Simplest way to print out the contents of a text field in SQL Server

I need to output the contents of a text field using MS Query Analyzer. I have tried this: select top 1 text from myTable (where text is a text field) and DECLARE @data VarChar(8000) select top 1 @data = text from myTable PRINT @data The first one prints only the first 2000 or so characters and the second only prints the first 800...

What is the comparative speed of temporary tables to physical tables in SQL?

I have a script that needs to extract data temporarily to do extra operations on it, but then doesn't need to store it any further after the script has run. I currently have the data in question in a series of temporary local tables (CREATE TABLE #table), which are then dropped as their use is completed. I was considering switching to ...

Are DbProviderFactory, DbConnection, DbCommand, and DbDataAdapter

Are the .net classes relating to DbProviderFactory thread safe? ...

How do I check SQL replication status via T-SQL?

I want to be able to check the status of a publication and subscription in SQL Server 2008 T-SQL. I want to be able to determine if its okay, when was the last successful, sync, etc.. Is this possible? ...