Hi all,
I am new to stackoverflow, and this is my first question:
I would like to create a SSIS task on SQL 2005 server that queries a specific email account on an Exchange 2003 server, and creates a report.
The report currently contains the amount of emails received, average time of reply, and emails with reply time that have gone ov...
in my table am storing one column(smalldatetime).
i need to retreive records by giving just date- and search the column specified above.
Ex:
10/6/2010 4:01:00 PM - this is the actual value in Column.
And i just want to search records from table by givin today's date. ..???
ALTER PROCEDURE [dbo].[spDisplayAllOpenPrepaidSales]
@pr...
Now I know you can't directly compare NULL to anything (as null is unknown) so how would I achieve the following:
select *
from Material as m
where MtrlCode = 826 and
Exposlimit <> 'compareMe'
Where Exposlimit MAY be NULL or it may not be.
'compareMe' may also be NULL.
Therefore how do I compare the two? Bo...
How do you look up a default global table locking hint?
-- Questions
Are there any DMV/DMF (Dynamic Management View/Function) that return such information?
And also, is there a way to change the default lock hint?
Currently I am adding nolock hint almost everywhere to prevent locks.
I'd like to avoid doing so by changing the d...
I am a member only of the db_datareader role on a database, and I cannot see rows in sysobjects for stored procedures that I know exist.
Additionally, in SQL Server Managedemnt Studio, expanding the Programmability -> Stored Procedures node in Object Explorer does not show any stored procedures.
Is this due to insufficient permissions?...
How can I order the data and then filter it in TSQL (SQL Server)?
I've tried something like this:
SELECT [Job].*,
ROW_NUMBER() OVER (ORDER BY [Job].[Date]) AS RowNum
FROM [Job]
ORDER BY Rank
WHERE RowNum >= @Start AND RowNum < @End
Doesn't work. I also tried to use a subquery, which throws:
The ORDER BY clause is invalid ...
I have read some articles about using spatial optimized tables. Actually I use stored latitude and longitude as varchar comma-separated (lat;lng).
Could you suggest the best way to perform this change and enumerate the advantages. It's really necessary for a large project or only move to SQL Server 2008?
thanks.
...
In a SQL Server 2005 database that is replicated using log shipping, will changes to the following be automatically reflected in the replicated database?
Tables
Stored Procedures
Views
Functions
Object-level permissions
Database roles
...
I have the below LINQ to SQL method that takes an inordinate amount of time to execute yet its SQL counterpart is quite simple and fast. Am I doing something wrong in the LINQ part? I am just trying to return some data to display, read-only, in a Data Grid.
I understand that if the tool doesn't fit don't use it and as such I could j...
I would like a list of all new or modified records created after a specific date in all tables in a SQL Server database.
I am using SQL Server 2005 and ssms.
Is there a way to do this with one query, or some other tool?
How could I do this for one table?
...
Hello,
I have a SQL Server 2005 database with two tables: Order, LineItem. Each LineItem has a field called LineItemID and OrderID. I have a query that is getting all of the Order records in my database. With each Order record, I would like to retrieve a comma delimited list of LineItemIDs associated with the Order.
Is there a way to d...
I need a SP to return multiple sets of results. The second set of results would be based on a column of the first set of results.
So:
declare @myTable1 table(field0 int,field1 varchar(255))
insert into @myTable1 select top 1 field0, field1 from table1
declare @myTable2 table(field0 int,field3 varchar(255))
insert into @myTable2
selec...
I need to have a table in T-SQL which will have the following structure
KEY Various_Columns Flag
1 row 1 F
2 row_2 F
3 row_3 T
4 row_4 F
Either no rows, or at most one row can have the Flag column with the value T. My developer claims...
Hi,
I have some data on my table like:
DAY | QTY | Name
1/1/2010 | 1 | jack
5/1/2010 | 5 | jack
2/1/2010 | 3 | wendy
5/1/2010 | 2 | wendy
my goal is to have a SP requesting a period of time (example: '2010-1-1' to '2010-1-5'), and get no gaps.
Output example:
DAY | QTY | Name
1/1/2010 | 1 | jack
2/1/2010 | 0 |...
In SQL Server 2005, can I issue an SQL query to list all FK constraints on tables within the DB, and show the delete rule? (ie nothing, cascade, set null, or set default)
The output I'm looking for is something akin to:
FK_NAME ON_DELETE
==================================
FK_LINEITEM_STATEMENT CASCADE
FK_ACCOUNTREP_...
Subquestioning [2]
While copying Resource.mdf [1], I noticed that:
1)
It is possible to copy Resource.mdf without stopping SQL Server instance (I attached one having copied from running instance and it works after attaching) .
1a)
Should I understand that it as general possibility for all read-only databases or is it only in some v...
Hi,
I am trying to use proxy account for non sysadmin to grant them exec permission on xp_cmdshell.
What I did is:
USE [master]
GO
CREATE CREDENTIAL [proxyaccount] WITH IDENTITY = N'domain\user', SECRET = N'password'
GO
USE [master]
GO
CREATE CREDENTIAL [proxyaccount] WITH IDENTITY = N'domain\user', SECRET = N'password'
GO
USE [msdb]
...
HI
I have 5 different database and a Master DB with same Schema .I am looking for a tool which can check any changes( new row insertion ) has happened since my last update and Sync with my Master DB . Is there any tool available for this
...
i have an stored procedure wich return a Dataset(Table) how i can use the result of this stored procedure in a select statement?
i need something like this
Select T1.* from Dummy T0
INNER JOIN
(EXEC [dbo].[SPGetResults] '900',300,'USD') T1 ON T1.aKey=T0.aKey
i ' am using sql server 2005
...
I am working on SQL Server 2005 and I have come accros the issue that I have run the multiple update query on the single table one by one. As it takes lots of time to execute one by one I came to know that by using "GO" I can run the query one by one. Like this
Update Table A ....
GO
Update Table A
GO
Update Table A
I am not sure ...