sql-server

Stored Procedure Versioning

How do you manage revisions of stored procedures? We have a BI solution on SQL Server 2005 with hundreds of stored procedures. What would be a good way to get these into subversion? recommended tools to script SP to files? ...

How do I handle large SQL SERVER batch inserts?

I'm looking to execute a series of queries as part of a migration project. The scripts to be generated are produced from a tool which analyses the legacy database then produces a script to map each of the old entities to an appropriate new record. THe scripts run well for small entities but some have records in the hundreds of thousands ...

SQL Server 2005 replication configuration

Hi Folks, Does anyone have a link to a decent tutorial on configuring SQL Server 2005 replication. The article needs to explain how to configure the correct security for the replication snapshot agent, there a lots of articles out there but they all seem to miss out on that part of the process. Or....if someone has set this up already ...

What does the SQL Server Error "String Data, Right Truncation" mean and how do I fix it?

We are doing some performance tests on our website and we are getting the following error a lot: *** 'C:\inetpub\foo.plex' log message at: 2008/10/07 13:19:58 DBD::ODBC::st execute failed: [Microsoft][SQL Native Client]String data, right truncation (SQL-22001) at C:\inetpub\foo.plex line 25. Line 25 is the following: SELECT DISTINCT ...

Storing Crystal Reports Files in Database?

I've got a UI front end which talks to and manipulates a SQL Server database, and one of the things it can do is run reports on the data in the database. This UI can be installed on multiple computers, and so far I've just been keeping the reports in a folder with the install, but this means that any time a new report is added is has t...

Recommended Hardware to Support Full Text Search in SQL 2005

What is the recommended hardware specifications to support full text search in SQL 2005? We are looking to go in production and I want to make sure the current hardware can accommodate it. To provide the context, We are expecting 2 - 3 million records to be searched by small subset of our users(probably in 100s).The user has the optio...

How to Gain Exclusive Access to SQL Server 2005 DB to restore?

Whenever I restore a backup of my database in SQL Server I am presented with the following error: Msg 3101, Level 16, State 1, Line 1 Exclusive access could not be obtained because the database is in use. Msg 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally. Usually to get around this I just restart the serve...

Can Database Mirroring Be Setup On MS SQLServer Between Two Clusters

Just like the title says, using Microsoft SQL Server's database mirroring capability, can the mirroring occur between two clusters? All of the examples in MSDN show a topology indicating single servers for both the principal and mirror server. ...

Upsizing a split Access database

Hi, I need to upsize a split Access database, i.e., one that's currently split between tow mdb files, a front-end and back-end. I see many webpages that in essence say, "run the Upsizing Wizard." My first, very basic question: Should I be running this wizard in my front-end mdb or my back-end mdb? I assume I don't want to link main mdb...

Is there an equivalent to SHA1() in MS-SQL?

Converting a couple stored procedures from MySQL to Microsoft SQL server. Everything is going well, except one procedure used the MySQL SHA1() function. I cannot seem to find an equivalent to this in MS-SQL. Does anyone know a valid equivalent for SHA1() on MS-SQL? ...

Multiple DB Updates:

Replaces Question: http://stackoverflow.com/questions/184096/update-multiple-rows-into-sql-table Here's a Code Snippet to update an exam results set. DB structure is as given, but I can submit Stored Procedures for inclusion (Which are a pain to modify, so I save that until the end.) The question: Is there a better way using SQL server...

SharePoint Lists vs Database Tables performance...

Hi, We are looking to store transactional data in SharePoint lists. The lists will easily grow to 100,000+ items. How would the query performance be compared with queries on a database table with these columns? Queries: Select by Id Select Where ColumnValue = X Group By OrderId Group By Date The SP List will be 6 columns wide: Id, D...

Are GUID collisions possible?

I'm working on a database that uses a GUID for each user that uses the app it's tied to. Somehow, two users ended up with the same GUID. I know that microsoft uses an algorithm to generate a random GUID that has an extremely low chance of causing collisons, but is a collision still possible? This is in SQL Server 2000 btw ...

Query Analyzer VS. Query Profiler Reads, Writes, and Duration Discrepencies

I'm using MS Sql Server 2000, and for many queries when I run a query in Query Analyzer, with the statistics turned on, the numbers reported in the statistics tab are extremely different from the values shown in the Query Profiler. When the profiler and the analyzer are running at the same time, some queries report 200 reads in Analyzer...

Can I pass a sharepoint security context value to a reporting services report parameter?

I'm considering using reporting services 05 SP2 with share point integration on a new reporting project. In this project's reports users can only see records they own. I was thinking a simple userId parameter on the report would allow me to filter the report's results to only these "owned" records. I'm curious: Can I pass the current...

What options are available for connecting to a Microsoft SQL Server database from an Oracle database?

At the moment I pull data from remote MS SQL Server databases using custom-built JDBC connectors. This works fine but doesn't feel like the way to do it. I feel I should be able to put a JDBC connection string into tnsnames on the server and have it "just work". I've looked around a little for this functionality but it doesn't seem to b...

Retriving date in sql server, CURRENT_TIMESTAMP vs GetDate()

Using SQL server - which is the fastest or best practice method to use for date retrival? Is there a difference? ...

Generate Multiple and Filtered Drop + Create Stored Procedures

I have this script: select name,create_date,modify_date from sys.procedures order by modify_date desc I can see what procedures were modified lately. I will add a "where modify_date >= " And I'd like to use some system stored procedure, that will generate me : drop + create scripts for the (let's say 5 matching) stored procedures Ca...

Is it important that Visual Studio 2008 thinks it's the wrong edition?

I installed Visual Studio 2008 Standard Edition a month or so ago after a reformat (on Vista64, if that matters). I got it for free from one of those "Heroes Happen Here" launch events. I then installed SQL Server 2008 Express Edition a week or so ago (we're supposed to be getting that for free in the mail but I gave up - a little too e...

Copy tables from one database to another in SQL Server.

I have a database called foo and a database called bar. I have a table in foo called tblFoobar that I want to move (data and all) to database bar from database foo. What is the SQL statement to do this? ...