sql-server

SQL Server Login

What is the SQL query to check whether particular SQL Login is Enable or Disable? ...

How do you Move Dev Database Changes to Production Database?

I have been working on a project and gotten it through the first stage. However, the requirments ended up changing and I have to add new tables and redo some of the foriegn key references in the DB. The problem I have is my lack of knowledge of dealing with doing this kind of change to a staging then production database once I get the d...

Help Using Variables in MS SQL Statement

I have a stored procedure to which I pass 4 variables, @DCUId,@SlaveAddress,@DateFrom,@DateTo Within the SP I have the following: DECLARE @MinAmbient decimal (4,1),@AverageAmbient decimal (4,1) DECLARE @MaxAmbient decimal (4,1) SELECT @MaxAmbient = MAX(CAST(T4 AS DECIMAL))/10, @MinAmbient = MIN(CAST(T4 AS DECIMAL))/10, @AverageAmbien...

SQL Converting string MMM.YY to date

Hi, how do i convert/cast a column contains strings e.g. Jan.08,Feb.08.. into date format so that i can sort them? Greatest Thanks! ...

Implementation of periodic writing timestamps in ms sql database

Task: Write timestamps into MS SQL database table every second. Solutions: External application which writes timestamps by schedule (Sql agent for example). Stored procedure, which writes timestamps in infinite loop. Questions. Which of the solutions is best? Is there any drawbacks of running infinite loop in stored procedure? ...

Transacation Log Backup

Dear Friend How can i check with SQL query whether transction log backup every 15 minutes JOB is created or not ? Thanx in advance. ...

stop Sql 2000 from work

I successfully attached DB with Sql2000 to SQl2005 and I had two version 2005,2000 and I want to stop 2000 all it,s services without any effect on 2005 so what I can do? ...

SQL Server OLE DB - select data from DB using RowSet

Hi, I want to ask how to select data from DB using OLE DB CRowSet in C++. How to access specific row, specific column etc. like in ADO .NET using DataTable. Can you give me some tutorial please? Thanks ...

Can't disable Vardecimal Storage Format

I recently moved a database from a 'SQL Server 2005 SP1' instance to 'SQL Server 2008 SP1' (using detach - attach). I now need to move it back but it fails with the error: The database 'MyDB' cannot be opened because it is version 655. This server supports version 612 and earlier. A downgrade path is not supported. After a bit of resea...

Storing a Set of Integer values in Sql Server 2005 with nHibernate?

What is the best way to store and map an Entity which contains a set of Integer as one of its attributes? I am using nHibernate over Sql Server 2005. Will creating a CLR Custom Type will help here? If yes how it can be mapped using nHibernate? I should be able to query on the Set. E.g. select myEntity from MyEntities where myEntity.In...

Loop through controls and change LINQ columns

Hi I have the following code: Dim i As Integer For i = 1 To 20 Dim captionTextBox As TextBox = DirectCast(Me.FindControl("news_Image" + i.ToString() + "CaptionTextBox"), TextBox) Dim deleteCheckBox As CheckBox = DirectCast(Me.FindControl("Image" + i.ToString() + "DeleteCheckBox"), CheckBox) If Not deleteChec...

SQL Server Read Only DataBases usage advantages & areas

Hello. We can set our DataBase read-only, and it restricts some commands like Auto-Shrink, Auto Statistics, and DBCC commands. But it also gives a high performance with limiting that features. We can use ALTER DATABASE dbName SET READ_ONLY command to set DB read only. But, why we should use Read Only Databases? What are the advantage...

Why timeout may occur in SqlConnection.Open()?

What are the cases when timeout occurs in SqlConnection.Open()? On one of our IIS boxes 10 seconds after AppProcess was recycled the following exception appeared: Type : System.Data.SqlClient.SqlException, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : Timeout expired. The timeout period e...

Migration tool from TSQL to PL/SQL?

We need to migrate our database from MSSQL to Oracle and we have over 100 stored procedures written in PL/SQL TSQL. I know its a long shot, but has anybody ever successfully used an automatic migration tool to do the work? I've seen some tools on the web, but I have no way to judge their ability to handle various code. Any personal exper...

What is the best way to make many versions ((Or history)) of Table's rows

Hi everyone, I'm trying to make my application support Logging but I'm very new at this approach. I were going to add new tables to my database for each table that i want to support logging to it and then deal wit that by my DAL "EF in my approach". But this will make me add a lot of work to both DB and DAL. ...

Can Personalization be done using SQL Server 2000?

I am using SQL Server 2000 and ASP.NET 3.5. I want to implement WebParts in my site. But while running my code it shows me an error : A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL ...

How do I use Varbinary(64) as a parameter in SQL Server Reporting Services?

I want to write a report using SQL Server Reporting Services. I want a plan_handle (which is varbinary(64) ) from the dynamic management view sys.dm_exec_query_stats to be a parameter in another report. But SQL Server Reporting Services doesn't support this type (varbinary(64)) very well. Looking for solutions, workarounds etc... ...

How to keep track of column updates?

I'm using SQL Server to store users uploaded songs. Each song has an id(simple auto increment number) and a name. I want to use URL Rewriting to query some song, like this: http://wwww.mysite.com/song/song_name The problem is that I also want to enable users to change their songs name and still use the old URL. I thought o...

Suspect someone is deleting records from my SQL Server '05 DB - any way to check?

Hey all, I think someone with shared access to my SQL Server '05 DB is deleting records from a table in a DB for their own reasons. Is there any audit table I can check to see manual delete queries which may have been run on the DB in the last X number of days? Thanks for your help. Ed ...

JDBC url with database containing spaces

I'm trying to connect to a SQL Server database using JDBC, the database I'm trying to connecto to contains a space, and unfortunately I have no control over the name, so I can't change it. The code I'm using is: String jdbcString = "jdbc:sqlserver://" + hostname + ":" + port + ";databaseName=Database Name"; try { connection...