sql-server

How to efficiently archive older parts of a big (multi-GB) SQL Server database?

Right now I am working on a solution to archive older data from a big working database to a separate archive database with the same schema. I move the data using SQL scripts and SQL Server Management Objects (SMO) from a .Net executable written in C#. The archived data should still be accessible and even (occassionally) changeable, we j...

C# - SQLClient - Simplest INSERT

Before someone gets in a tizzy because this was answered elsewhere (not sure if it was,but...), the 5 "related questions" shown right now do not match what I'm looking for, and I searched the string "sql insert" and did not find quite what I was looking for. So I'm basically trying to figure out the simplest way to perform your basic in...

Why can't SQL Server run on a Novell server?

I'm not sure whether I'm asking the question correctly, but I've been told SQL Server cannot run on a Novell server. Is this true? If yes, why not? ...

What's the best way of cleaning up after a SQL Injection?

I've been tasked with the the maintenance of a nonprofit website that recently fell victim to a SQL injection attack. Someone exploited a form on the site to add text to every available text-like field in the database (varchar, nvarchar, etc.) which, when rendered as HTML, includes and executes a JavaScript file. A Google search of the...

In MS SQL Server 2005, is there a way to export, the complete maintenance plan of a database as a SQL Script?

Currently, if I want to output a SQL script for a table in my database, in Management Studio, I can right click and output a create script. Is there an equivalent to output an SQL script for a database's maintenance plan?# Edit The company I work for has 4 servers, 3 servers and no sign of integration, each one running about 500,00...

SQL Server 2003 internet connection

Recently we got a new server at the office purely for testing purposes. It is set up so that we can access it from any computer. However today our ip got blocked from one of our other sites saying that our ip has been suspected of having a virus that sends spam emails. we learned this from the cbl http://cbl.abuseat.org/ So of course...

SQL Server 2008 Reporting Services Control

Is the Sql Server 2008 control available for download? Does it yet support the 2008 RDL schema? ...

Accessing Sharepoint from outside the WebUI

Is it possible to access the database backend of a sharepoint server? My company uses Sharepoint to store data and pictures of various assets. Ideally I would be able to access the data and display it in my application to allow users both methods of access. Before I go talk to the IT department I would like to find out if this is even p...

How to tell the data types after executing a stored procedure?

Is there a way when executing a stored procedure in Management Studio to get the data types of the result sets coming back? I'm looking for something like functionality of when you pass a table name to sp_help ...

How do I check if a SQL Server text column is empty?

I am using SQL Server 2005. I have a table with a text column and I have many rows in the table where the value of this column is not null, but it is empty. Trying to compare against '' yields this response: The data types text and varchar are incompatible in the not equal to operator. Is there a special function to determine whe...

Can you call a webservice from TSQL code?

Is there a way to call out from a TSQL stored procedure or function to a webservice? ...

SMO and Sql Server 7.0

Does anyone have a definitive answer to whether Sql Server Management Objects is compatible with Sql Server 7.0? The docs state: Because SMO is compatible with SQL Server version 7.0, SQL Server 2000, SQL Server 2005, and SQL Server 2008, you easily manage a multi-version environment. But trying to connect to a Sql 7 instance gets ...

SQL 2000 'TRY CATCH like' Error Handling

This is a sql 2000 database that I am working with. I have what I call a staging table that is a raw data dump of data, so everything is ntext or nvarchar(255). I need to cast/convert all of this data into the appropriate data types (ie int, decimal, nvarchar, etc.) The way I was going to do this was to iterate through all records us...

How can I retrieve a list of parameters from a stored procedure in SQL Server

Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters that belong to a stored procedure on a SQL Server before I actually execute it? I have an a "multi-environment" scenario where there are multiple versions of the same database schema. Examples of environments might be "Development", "Staging", & "Product...

How should I model a field that can contain both numeric and string values in SQL Server 2005?

I have a new database table I need to create... It logically contains an ID, a name, and a "value." That value field could be either numeric or a character string in nature. I don't think I want to just make the field a varchar, because I also want to be able to query with filters like "WHERE value > 0.5" and such. What's the best way...

Natural (human alpha-numeric) sort in Microsoft SQL 2005

We have a large database on which we have DB side pagination. This is quick, returning a page of 50 rows from millions of records in a small fraction of a second. Users can define their own sort, basically choosing what column to sort by. Columns are dynamic - some have numeric values, some dates and some text. While most sort as expe...

SQL Server - Does column order matter?

In terms of performance and optimizations: When constructing a table in SQL Server, does it matter what order I put the columns in? Does it matter if my primary key is the first column? When constructing a multi-field index, does it matter if the columns are adjacent? Using ALTER TABLE syntax, is it possible to specify in what position...

How to benchmark a SQL Sever Query?

I'd like to know the standard way to benchmark a SQL Sever Query, preferibly I'd like to know about the tools that come with SQL Server rather than 3rd Party tools. ...

SQL Server, convert a named instance to default instance?

I need to convert a named instance of SQL server 2005, to a default instance. Is there a way to do this without a reinstall? ...

Would building an application using a Sql Server Database File (mdf) be a terrible idea?

I'm working on a side project that would be a simple web application to maintain a list of classes and their upcoming schedules. I would really like to use Linq to SQL for this project, but unfortunately the server environment I'm developing for only has MySql available. I've dabbled briefly with Subsonic but it just doesn't get the job...