sql-server

laptop hibernation mode, sql express and data corruption

Hi, We recently got a corruption problem (error 824) from a database hosted in sql server express 2005 on a latop configured to use hibernation (windows xp). I do not have access to this laptop yet to perform disk tests. Is there any known problems using hibernation mode and sql server express on laptops? Thanks a lot. ...

How can I create a database on my server from the web?

I have an admin account for my website where I add new clients. When a new client is added, they get an account and their own database. The problem is I can't create new databases on my server from my admin account. When running it locally, I can add a database locally. But, when I try adding to the server running my website off the s...

'Rotate' data in a WinForms datagrid

Using Winforms .NET 2.0, my client has requested that data in a Datagrid be displayed vertically rather than horizontally. The data layer of the app is built upon NHibernate, so I generally avoid writing raw SQL in favor of HQL. However, this scenario may lend itself to utilizing the 'crosstab' functionality of SQL Server 2005. So f...

SQL 2000 single mode, related to database dbcc checkdb

I am trying to hack opening a MDF file in a new database. We lost the backup. After reading numerous articles, I came to the point where the only thing that separates me from a successful solution is setting the db into a single user mode. I issue "sp_dboption 'MyDbName',single,true" SQL Server reports that "The command(s) completed su...

Using Pivot in SQL

For example I have a table IPPARSED 127 0 0 1 now I need to pivot the table so it can come like this 1       2   3   4 127   0   0   1 Can you help me how? ...

How can I use TSQL to check when a user's password will expire?

With SQL Server 2005 and above, how can I check when a user's password is going to expire using TSQL? Preferably this would be done using a connection for that same user. What permissions would be required for the SQL statement to be run? ...

How do i use a hashing computed column after i have indexed a varchar(max) field?

I created a computed column of type varbinary and referenced a varchar(max) field. Now, how do i use or invoke it? thanks ...

First steps to SQL Server

I've working with Oracle for years (a like it so much and will a lot of years more) and I want to know about SQL Server. I have installed SQL Server Express. Can anyone give some clues for working with It? For instance: There are any command like like sql*plus on Oracle or the mysqladmin? Which are the superusers names? And which are ...

Sql Stored Procedures

I'm trying to write a Stored Procedure this is what I have so far Create procedure sp_Create_order @P_nafn varchar(50), @P_fj int, @P_sótt datetime, @F_kt varchar(10), @V_nr int, @L_id int as begin set nocount on if exists(    select * from Lotur    where L_id=@L_id and    @P_sótt between L_hefst and L_pfrest ) INSERT INTO Pantar...

DDL not executing properly inside of an IF NOT EXISTS statement on SQL Server 2005

I have a fairly complex database that needs to be deployed to a variety of servers which may or may not potentially have existing parts of the DB already implemented on it. To work around this contingency I have setup the following test: USE [testDB] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO IF NOT EXIST...

A question about run program

How can I run my application (written in C#) and use a SQL Server database without having to install SQL Server first? ...

Sql Server 2005 connection log

Hello, I have multiple databases on one SQL Server 2005 server. I would like to know a way using which I can see all the connections made to a particular database today and the activities performed. Thanks in advance Joe ...

why do square bracket appear with the table name?

Hi, I created a database with couple of tables and some table names are enclosed with square bracket: [table_name] Does anyone qnow why this happen, and how to get rid of it? Thanks! ...

Apostrophes and SQL Server FT search

I have setup FT search in SQL Server 2005 but I cant seem to find a way to match "Lias" keyword to a record with "Lia's". What I basically want is to allow people to search without the apostrophe. I have been on and off this problem for quite some time now so any help will really be a blessing. ...

While linked server is closed, exec the stored procedure will get an error

I have a stored procedure for select data between many different sql server, and all the sql server have set the link server at the sql server where the stored procedure built in. Here is my procedure: Create Proc dbo.spGetData @code as char(4) AS if (@code='aaaa') Select date From [ServerA].Stock.dbo.Syspara else if (@code='bbbb') ...

How to find out (runtime) if a type in t-sql is fixed-length or not?

Is it possible to find out runtime using t-sql if a type (e.g. nvarchar or int) is fixed-length or not by querying some system-table? The reason I need to do this is that I need to generate sql-code runtime and need to generate some declarations (DECLARE @foo SOMETYPE(LENGTH) or DECLARE @foo SOMETYPE) depending on the type of some colum...

Reporting Services - Report Model (SDML) reference to Data Source View (DSV)

Hello, We have a ad-hoc reporting projecto where we created several data source views (DSV) and several Report Models (SDML). Frequently we need to change the DSV associated to a particular SDML, but we only found it's reference in one place: the "Data Source View Name" property (availabe through the VS properties pane) of the sdml file...

Add more than 16 columns to clustered index

Is there any way by which i can add more than 16 columns in clustered index. ...

SQL SERVER 2005 Automatic Schedule Backup Working not Properly

Hello Friends, I am having a web server with install of WINDOWS 2003 Server and SQL SERVER 2005 Currently and i try to do a job schedule with the use of some control that i created. every thing is working properly but when it starts the job (in job i have written T-SQL Command for Backup Database) it will gives following error. i alread...

how to read values in the column of a table in sqlserver?

There is a table called Friends. It has columns named Names, Address, Phone no, Dob. We want to use Names which are in Friends table one by one. so I want to store all names in an array which is to be used later. ...