sql-server

Making all Apps on a Server Use SQL Session Manager

Is there any way to make all the applications on a server use SQL Server as the session manager? The reason is that we have a server with hundreds of applications and we want to start load balancing the server but it will be a big hassle to configure each individual application to use SQL Server as the session manager. It will also p...

How do I speed up my application connecting to MS SQL Server?

I have a Delphi application running on SQL Server 2000, but it's taking awfully long to connect to the database! But when I run this application on my development server it connects pretty fast! I am running on Windows 2003 server, SQL Server 2k personal edition, when I look on my MDAC version in the registry, I see version 2.8 alread...

Best Practice for PK in SQL Server

I have been wondering what the best practices or ramifications are in setting up the PK in a M2M table in SQL Server. For instance: I have 2 tables Users Roles I am making a new table UserRole Which has 2 fields RoleId & UserID now should I create a UserRoleID as the PK and make UserID and RoleID the FKs make the PK UserID ...

ASP.NET, SQL Server, LINQTOSQL and Date formats

I am setting the locale of my .net application via: string userLocale = Web.Helpers.LocaleHelpers.GetBestRFC3066Locale(this.Context.Request.UserLanguages); if (userLocale != String.Empty) { System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCul...

SQL Server Database Locked

I am trying to delete an existing database in SQL Server 2005. My first attempt produced the following error: 5030: The database could not be exclusively locked to perform the operation. I have since killed all processes that are accessing the database. I have also removed the replication subscription that it had previously bee...

How can a Table's Last Modified date be returned in SQL Server 2005?

How can a Table's Last Modified date be returned in SQL Server 2005? I did see one on the Table Properties page. There is a Created Date but no Modified date. If it is not available, what would be some other ways to add this functionality? Here are a few that come to mind: Add another column, to the table, that a trigger would upda...

C# to SQL Server on client's network

I have a client with an established accounting database for which I want to write a report. I am planning to use VS 2008. I have no difficulty doing this for SQL Server running on my own machine but want to know how best to publish a c# program to run on the client's network SQL Server. So there are two main issues: 1.) How to adapt t...

How to remove diagramming support objects from SQL Server?

I need to remove diagramming support tables, stored procs, views, etc from SQL Servrer using TSQL script. Is there such a script available? SQL 2005 and 2008. ...

What are the scenarios for using mirroring, log shipping, replication and clustering in SQL Server

Hi, As far as i know SQL Server provides 4 techniques for better availability. I think these are the primary usage scenarios, in summary :- 1) Replication would be primarily suited for online-offline data synchronization scenarios (laptop , mobile devices, remote servers). 2) Log shipping could be used to have a failover server with...

Best way to allow the User to define a Table’s Order?

Best way to allow the User to define a Table’s Order? We are using SQL Server 2005 and DevExpress controls. We have a table that contains the following: Process A Process B Process C Report A Report B Report C We want to allow the user to change the order to anything they want. Here is one example: Process C Process A Proce...

Large Text and Images In SQL

Is it a good idea to store large amounts of text (eg html pages) inside your SQL database? Or is it a better idea to store it as html files in the filesystem? The same goes for images - is it a good idea to store image data in the database or better to put them on disk? Will storing large amounts of data cause me performance problems f...

SSIS - Data from MySql to MsSql some characters are ?

hi there I just transferred some data from MySql to MsSql (2K5) in a text field, some of my characters, such as apostrophes, are now ? (question mark) to me this indicates some sort of collation or character set error, right? To be honest, I don't know which one should I be using The MySql db currect charset is utf8_general_ci and in ...

Isn't a SQL Server just for reporting an overhead ?

Hi, I recently spoke to a user of SQL Server 2005 who said that their database was overly normalized and they replicate data to a report server. Isn't a database supposed to handle both transactions and reporting? Why would I have to invest in 2 servers and replicate? I know this is an open-ended, subjective question, and I don't have...

@@DBTS in MySql

Hey guys, I want to ask if there is an equivalent to the @@DBTS TSQL global variable in MySql (I need to access the timestamp of the last row that has been accessed in the whole database, not just one table). I need this because I'm trying to use Microsoft Sync Framework and MySql for bi-directional syncing. Any help will be much appre...

AutoIncrement fields on databases without autoincrement field

In MS Sql Server is easy create autoincrement fields. In my systems I stopped to use autoincrement fields for primary keys, and now I use Guid's. It was awesome, I've got a lot of advantages with that change. But in another non-primary key fields, I really was needing implement a "soft autoincrement". It's because my system is DB indepen...

How can I efficiently update a database with external data sources?

I'm trying to populate a table with user information in a MS SQL database with information from multiple data sources (i.e. LDAP and some other MS SQL databases). The process needs to run as a daily scheduled task to ensure that the user information table is updated frequently. The initial attempt at this query/ update script was writt...

How to call Inline Table Function with output parameter from scalar function?

Hi guys, I would like to know if it's possible to call a inline function with an output parameter from a scalar function? For example: My inline function is called test_1(input parameter format bigint), the following example works great: SELECT * FROM MM.test_1(4679) But now I would like to use it with an output parameter ...

How do you migrate SQL Server Database Diagrams to another Database?

My team recently rebuilt their SQL Server 2005 development database from scratch using the TFS source files. Afterwards, we had a nice clean database that more closely matched our test and production environments. However, we also lost the database diagrams that had been created over the months in the old development database. Does any...

Merge duplicate records into 1 field

I have a database table that contains a list of contacts, some of those contacts might have multiple records, e.g. CustomerID, CustomerName, Vehicle 1, Dan, Mazda 1, Dan, Suzuki 2, John, Ford 3, Dasha, Volvo 3, Dasha, Ford Can I write a select query to return the distinct customerID and CustomerName, and a list of vehicles in 1 record...

Nested transactions in Sql Server

Imagine the follwoing scenario: I am using Sql Server 2005. I have a transaction that is calling, among others Sql statements, a stored procedure that also has a transaction inside. The outer transaction sometimes fails and it is rolledback after the stored procedure is called and commited successfully. My question is, does the storedPro...