sql-server-2005

How to efficiently store and manage images in SQL Server 2005

I want to insert my product's image into a database and then want to get those image on request. please suggest. ...

Syncing stored procedures between two databases?

For an app my team is developing, I have created a copy of the database to work independently on some possible features for the system. In doing so, I have changed some stored procedures. Meanwhile, other members of the team continue to work on the other database and change some of those stored procedures. The code is still calling ...

How to access SQL Server 2005 FROM a guest XP OS running in Virtual PC

I am running as my Host OS - Win 7 x64 and running an instance of SQL Server 2005 (developer, x64). I am also running an instance of Virtual PC XP and am trying to connect to the Host OS Sql Instance without alot of luck. I can ping the Host from the Guest OS and vice versa. The Virtual PC Guest is not using the NAT network adapter, bu...

from a trigger, how to find out who modified data on table X while that user is logged from a generic dbuser but got the right from a user-table (id, name, password)

I'm not sure how to formulate that question but: you have a webpage the webpage got a specific user/pass in the web.config for the connection string on a webpage you ask for a user/pass that is connected to a table(id, name, pass) the user is recognized with a valid user/pass and now you know the id from the table above the user chang...

Connection to SQL is not closing after call to DB in ASP.NET

I have a generic method to call a stored Procedure in ASP.NET: public SqlDataReader ExecuteStoredProc(string sprocName, SqlParameter[] SqlP) { SqlDataReader iReader; SqlCommand sql = new SqlCommand(); sql.CommandText = sprocName; sql.CommandType = CommandType.StoredProcedure; ...

How to have a "master-structure" database with "children-data" databases in SQL SERVER 2005???

I have been googling a lot and I couldn't find if this even exists or I'm asking for some magic =P Ok, so here's the deal. I need to have a way to create a "master-structured" database which will only contain the schemas, structures, tables, store procedures, udfs, etc, everything but real data in SQL SERVER 2005 (if this is available ...

SQL 2005 performance: column order when mixing varchars with int types

I have a table like this: create table SomeTable ( tableKey int identity(1,1) not null , foreignKey int not null , longDesc nvarchar(max) not null , shortName varchar(100) null ) I need to use shortName in a where clause: select tableKey from SomeTable where foreignKey = @foreign...

Where can DATEFORMAT and CONVERT be used? (sql server)

Hi, I am running SQL Server 2005 (express). I am trying to use DATEFORMAT and CONVERT in my queries. I am running into problems, so I first wanted to ask if those functions can be used everywhere. I already know they can be used in SELECT. But can they be used in WHERE as well? For example: SELECT * FROM review AS R, section AS S...

use 'between' with varchar (sql server)

Using SQL Server 2005 Express. ( CONVERT(VARCHAR(8), R.reviewStart, 108) between CONVERT(VARCHAR(8), M.meetingStart, 108) and CONVERT(VARCHAR(8), M.meetingEnd, 108) OR CONVERT(VARCHAR(8), R.reviewEnd, 108) between CONVERT(VARCHAR(8), M.meetingStart, 108) and CONVERT(VARCHAR(8), M.meetingEnd, 108) OR CONVERT(VARCHAR(8), M.meetingStart...

Query to invoke SQL agent Job with passing parameter from query in SQL server 2005?

Query to invoke SQL Job with passing parameter from query in SQL server 2005? ...

Generate SQL server Health Report

Are there any Query/Script to generate SQL serevr 2005 Health report , So i can send them to client on regularly basis. or can u tell me which type of report i can generate to send to client? Thanks ...

List which columns have a full-text index in SQL Server 2005

How do I list all tables / columns in my database that have a full-text index? ...

Scripting individual database objects

I have a database I have inherited, and my best practice is to create the scripts to create the objects (tables, stored procedures and views) and then version control these. It would like to have all the objects in this database scripted out, and put into source control; but on SQL Server 2005 (SQL Server Management Studio) it appears -...

Determine SQL Server version of linked server

Does anyone here know how i can determine the version of SQL running on my linked server through use of TSQL statements? I am running SQL2005 my linked servers are running a mix of sql2000, 2005 and 2008. ...

SQL Server Express Performance breaks with large Logfiles

Hello all, we run since 2 years a small application on SQL Server 2005 Express Edition the Database has gown from 75 MB up to nearly 400MB within this time, the there isn't a big amount of data. But the log file has been arrived at 3,7GB now without changing Hardware, table structure or Program code we noted that the Import processes wh...

sql server 2005 - select records from tbl A contained WITHIN a text field of tbl B

Hi, I'm trying to work out a SQL Select in MS SQL 2005, to do the following: TABLE_A contains a list of keywords... asparagus, beetroot, beans, egg plant etc (x200). TABLE_B contains a record with some long free text (approx 4000 chars)... I know what record within TABLE_B I am selecting (byID). However I need to get a shortlist of ...

Why does my cursor stop in the middle of a loop?

The code posted here is 'example' code, it's not production code. I've done this to make the problem I'm explaining readable / concise. Using code similar to that below, we're coming across a strange bug. After every INSERT the WHILE loop is stopped. table containst 100 rows, when the insert is done after 50 rows then the cursor sto...

How to simulate heavy database usage with SQL server 2005

How can I simulate very heavy database usage on Microsoft SQL Server 2005? For test purposes I need to push the sql server to the max. The server is on a virtual machine and I don't care about network load, just CRUD operations, mainly inserts because I want to demonstrate how the database grows very quickly. ...

SQL 2005 Split Comma Separated Column on Delimiter

My google searches on how to split a string on a delimiter have resulted in some useful functions for splitting strings when the string is known (i.e. see below): SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER FUNCTION [dbo].[Split] (@String varchar(8000), @Delimiter char(1)) returns @temptable TABLE (items varchar(8000)...

How can you do a full outer join in sqlserver 2005?

How can you do a full outer join in sqlserver 2005? Seems like there is full outer join in sqlserver 2008 but I need to do this in sqlserver 2005. In other words, I am merging two views based on the ACCTNUM col in both views (The views show aggregates so there is at most one ACCTNUM record in each view for each account) and I would ...