sql-server-2005

My web site database is hacked.

My website has been attacked by some malicious script / title script src = http : // google-stats46.info/ur.php . This script is appended to any column(s) of some table automatically. I have removed this script. But after a few hours, it re-appeared in some tables. But this time it is / title script src = http : // google-stats45.inf...

How to read image from specific path in Sqlserver 2005 storeprocedure ?

I need to read the image from the specific path. I pass only path as parameter and that image will return by the procedures in image or byte format. ...

Error - Could not locate entry in sysdatabases for database

keep getting this error on this code: when I Connect to test Database with vb.net its show connection successfully Established. But when i want to Generate particular report with vb.net applocation its gives me following Error. Could not locate entry in sysdatabases for database 'test'. No entry found with that name. Make sure...

Adding one month to date if two values fall withinin same month, and then repeating the validation check (recursion?)

I have some rather dodgy data I'm looking at, and I've been tasked with finding out for how many consecutive months something has been going on for. However I have noitced that in some of my reference tables individual date values are being miscoded, and where there are multiple values in one month, the latest should be added into the ne...

Convert varchar colum to smalldatetime

I have a table with 800+ records. In this table I have a column named 'Data' of varchar (10) datatype which contains dates in 'dd.MM.yyyy' format.I want to convert it to smalldatetime. I've tried converting it using Enterprise Management Studio Express, but I receive this error: 'The conversion of char data type to smalldatetime data t...

its posible use impersonate sql server property on hibernate layer?

i makin an app on java and must to create the same impersonate or context swichtching for sql server property i wonder its posible use impersonate sql server property on hibernate layer? ...

Daily SQL Task to delete contents from a table

Hey I was wondering how I could set up a clean up task on a particular table to delete contents thats lets say a week old. I am using SQL Server 2005 ...

Printing From SQL Server Reporting Services 2008 on Windows Server 2003 R2

When I print from report manager in reporting services (2008) the quality of the output is terrible with fonts that look great on screen being very blurry and badly sized. Is there a known issue here? ...

Getting result of dynamic SQL into a variable

Hi, Executing dynamic SQL as follows in Stored Procedure: DECLARE @sqlCommand nvarchar(1000) DECLARE @city varchar(75) SET @city = 'London' SET @sqlCommand = 'SELECT COUNT(*) FROM customers WHERE City = @city' EXECUTE sp_executesql @sqlCommand, N'@city nvarchar(75)', @city = @city How do I use the count(*) column value as return valu...

Invalid class string in SQL Server 2005

I am using SQL Server 2005, and I made created a table and the foreign and primary keys but when I came to make the diagram of relationships to add new diagram I got an error msg invalid class string could anyone help me plz ...

encryption and decryption

how to encrypt the password in asp.net during inserting into database and how to compare it during login? ...

Online interpreter for SQL Server T-SQL code?

Is there any possibility to test T-SQL code on the internet? I mean that e.g many programming languages like Python has several online shell interpreters on the internet. Is there one for T-SQL? ...

UPDATE with a stored procedure on SQL Server 2005

Hello. I want to say UPDATE users SET field = my_sp() in SQL Server 2005. Apparently I can't do this and have to use some form of EXEC. Can anyone help me out and let me know how to do this? This should be some easy rep. ...

Where does a Server trigger save in SQL Server ?

Hi , A couple of days ago , I was practicing and I wrote some triggers like these : create trigger trg_preventionDrop on all server for drop_database as print 'Can not Drop Database' rollback tran go create trigger trg_preventDeleteTable on database for drop_table as print 'you can not delete any table' rollback tran But the pr...

CTE query plan for complex query - triple run of the same init query - why?

It's difficult to explain, but I'll try. As you see on query_plan picture attached (It is query plan for "All in one place" query described below), there are 3 almost the same "blocks" - my question is WHY? It seems to me that when I have "all in one" (see below) query the "Init" block (that is rather heavy) is run three times with di...

SQL Server: Do I need to use GO statements between batches?

I have seen people use GO statement between batches of SQL code, but AFAICS it is not mandatory (SQL Server 2008). What are the benefits using GO statements between batches/sets of SQL statements? ...

can i use self join on table for insert new data

if yes please give me just a example thankzzz ...

Sync Data Between Two Diff SQL Servers

I have two SQL servers that I need to have identical. Sync should occur maybe a couple times per day, automatically. The two servers have no "direct" connection between them, so no linked db etc. (They are on totally diff machines, networks, domains, with firewalls between etc) You can use the Internet though, like Web Service, FTP... ...

Get new ID before insert during transaction in .NET

I'm using ADO.NET to try to get the value I'm about to insert before I insert it in SQL Server 2005. SCOPE_IDENTITY() works fine after, but I'm also inside a transaction if that makes a difference. I literally need to select the next ID, and only the ID and have it available to C# before the insert. ...

deploy SQL Server Database with a Winforms app

I have created a SQL DB-based winforms application, and I want to deploy it on a client machine. The program is a single user desktop application. Opinions in this post suggest it's better to use SQLite or SQL Server Compact Edition in such scenarios. However, I prefer to use stored procedures, which are not supported in those product...