I have modified a stored procedure today but after that I realised that it is wrong. So I want revert it back. Is there any way to get the previously modified stored procedure or else last date's stored procedure.I dont have any back up also. pls reply soooooon.
Thanks n regards.
Imthiyaz
...
In an Access Project (ADP), with a SQL backend, what are the minimum permissions required for Access to be able to update records returned from a view bound to a form, yet prevent a direct SELECT on the underlying table? For instance:
Table: Table1
Columns: ID, Column1, Column2, Column3, Column4
View: View1
SELECT ID, Column1, Column2...
I am doing some performance tests using .Net 3.5 against SQL Server. I am doing an insert of 1 million records. When I wrap this inside a transaction (either serializable, RepeatabelRead or ReadUncommited) it runs in under 80 seconds on my system. When I remove the transaction it runs in roughly 300 seconds. I would expect that using no ...
I am using a timetabling system with SQL Server 2000 backend I need to list events with tutors and rooms next to them this can be more than 1 so could do with turning the multiple rows of rooms and tutors into + separated lists. I have used the code below in the past:
DECLARE @Tutors as varchar(8000)
SELECT @Tutors = isnull(@Tutors + '...
Is possible to pass type as param in SQL function?
thank in advance.
...
Is it possible to create a CLR function mapped to a method of the nested type?
CREATE FUNCTION [dbo].[MyClrFunc] (@s NTEXT)
RETURNS NTEXT
AS EXTERNAL NAME [MyAsm].[MyNamespace.MyClass+MyInnerClass].MyFunc;
the SQL Server keep feeding me with the same error:
MyNamespace.MyClass+MyInnerClass
...
Hi All, I have a MS SQL query that joins multiple tables and an example of the results are:
EmailAddress Column2
--------------------- ----------------
[email protected] Value1
[email protected] Value2
[email protected] Value5
What I reall...
Does anyone know why.
CREATE PROCEDURE My_Procedure
(@Company varchar(50))
AS
SELECT PRD_DATE
FROM WM_PROPERTY_DATES
WITH (NOLOCK)
WHERE PRD_COMPANY = @Company
GO
Gives me an error message in SQL management studio:
Msg 102, Level 15, State 1, Procedure My_Procedure, Line 1
Incorrect syntax near 'GO'.
...
Hi,
I am trying to import a column of dates from a spreadsheet in Excel 2003 into SQL Server 2005 using SSIS. I am in the UK so want dates formatted as dd/MM/yyyy.
Unfortunately, the column in the spreadsheet contains a mixture of dates stored as strings in dd/MM/yyyy (with Excel 'General' formatting) as well as dates using Excel 'Dat...
If I were to have 2 tables, call them TableA and TableB. TableB contains a foreign key which refers to TableA. I now need to add data to both TableA and TableB for a given scenario. To do this I first have to insert data in TableA then find and retrieve TableA's last inserted primary key and use it as the foreign key value in TableB. I t...
Hi,
I'm wondering if it is possible to run multiple DDL statements inside a transaction. I'm specially interested on SQL Server, even though answers with other databases (Oracle, Postgre at least) could also be interesting.
I've been doing some "CREATE TABLE" and "CREATE VIEW" for the created table inside a transaction and there seems ...
Example Schema:
RowID Quantity ModifiedPrice GroupPrice CustomPrice SalePrice
----------------------------------------------------------------------------
1 5 20.00 0 15.00 17.00
2 2 14.00 7.00 22.00 0
3 9 10.00...
Hello everyone,
I am using SQL Server 2008. I have a table which is composed of three columns, ID as string type, createtime as DataTime type and status as int.
I want to select the record among all records whose status value is 10 and at the same time createtime is the most earlist. Any ideas how to write such query?
BTW: ID is clust...
Hi,
I have a SQL Server 2005 database that has been deleted, and I need to discover who deleted it. Is there a way of obtaining this user name?
Thanks, MagicAndi.
...
I'm part of a team building an ADO.NET based web-site. We sometimes have several developers and an automated testing tool working simultaneously a development copy of the database.
We use snapshot isolation level, which, to the best of my knowledge, uses optimistic concurrency: rather than locking, it hopes for the best and throws an ...
If I have an SQL Server table with a clustered index on a datetime field, that is set to DateTime.Now (from C#) before inserts, should the index be ascending or descending to avoid reorganization of the table?
Thanks.
...
Hello everyone,
Here is my current implementation of a stored procedure which returns Order status for a given Order ID. There are two situations,
there is matched Order ID and I will retrieve the related status,
there is no matched Order ID (i.e. non-existing Order ID).
My confusion is, how to implement the two functions elegantl...
I have within my Sql Server 2008 database a trigger which will run on insert and update to populate a calendar table with dates calculated from the date info in the first table. (i.e. start date, end date, repeating sequence information).
I am using ASP.Net MVC using Linq to Sql to access the Database. My first view is collecting the da...
Some guys where I work are setting up a new database server for SQL Server. The server has a system drive that also stores backups and a single RAID 5 array for the database files. The RAID 5 array is logically partitioned into 2 drives. One is for the actual database files (MDF) and the other is for the transaction logs (LDF). The quote...
I need a different random number for each row in my table. The following seemingly obvious code uses the same random value for each row.
SELECT table_name, RAND() magic_number
FROM information_schema.tables
I'd like to get a INT or a FLOAT out this. The rest of the story is I'm going to use the random number to create an random dat...