I'm writing a background service that needs to process a series of jobs, stored as records in a sqlserver table. The service needs to find the oldest 20 jobs that need to be worked (where status = 'new'), mark them (set status = 'processing'), run them, and update the jobs afterward.
It's the first part I need help with. There could be ...
I'm adding a very simple view (or trying to) to my entities object model. The database is in sql server 2008. I'm on .net 3.5 (sp1) using C#.
The view has two fields: color and colorcount, a Varchar(50) and a count(*) respectively.
When I do Update Model from Database, and select the view to add, it runs (it updated tables, adding ...
My MS SQL Server stored procedure is:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_close]
@DATE NVARCHAR(8)
AS
BEGIN
SELECT appointment_datas.appointment_date
,appointment_datas.appointment_no
,costumer_datas.costumer_name
,appointment_datas.appointment_type
,personel_datas.personel_ADI
FRO...
What's the best way to pass a temp table to a C# stored procedure (SQL 2008)? Am I stuck passing the temp table name as text and running a select from C#?
I was hoping to use Table Value Parameters, but they don't appear to be supported in C# sprocs.
...
Earlier mdf file was in app_Data folder, and application was working fine.
When I attached mdf file into sql server. I can execute queries. But when I try to use it from asp.net application it give following exception.
Cannot open user default database. Login failed.
Login failed for user 'domain\username'
...
hi!
As a newb, I already know that I will be berated for asking this question, but I did not find the answer on the site here and could use some help...
I have a table that lists data by the day, and by type. For example
Transaction | Date | Type
-----------------------------
Updat | 11/7/2008 | Cash-out
Update | 11/10/2008 ...
I'm creating a DTS package. After specifying the source, destination, and tables, I get the Save, schedule, and replicate package step, which has a Save DTS Package checkbox.
If I check the box to save, I get these options:
SQL Server
SQL Server Meta Data Services
Structured Storage File
Visual Basic File
Can anyone give a good exp...
We document our SQL Server database by creating table and column level Description extended properties. We usually enter these via SSMS.
My question is this. I'm creating a C# application where I'd like to read the extended properties for a particular table and its associated columns.
Can someone show me how I might go about doing thi...
I'm running an ASP.NET app in which I have added an insert/update query to the [global] Page_Load. So, each time the user hits any page on the site, it updates the database with their activity (session ID, time, page they hit). I haven't implemented it yet, but this was the only suggestion given to me as to how to keep track of how man...
I need to convert a database column in a (MSSQL) database table into UNIX time_t. The problem is that this column does not have a timezone and some dates are from GMT (+0000) and some from BST (+0100). I am working on UK times.
Is there a reliable way to convert unzoned datetime into UNIX time_t? I'm currently using
SELECT *,DATEDIFF(s...
So I set up SQL Server Session State using SQL Server 2008 and the temp database and today I decided to look into the data in the tables only to find this in the ASPStateTempApplications table:
AppId AppName
538231025 /lm/w3svc/1/root
611758131 /lm/w3svc/3/root
802488340 /lm/w3svc/4/root
-940085065 /lm/w3svc/4/root/webapp
68...
I have this SQL now:
CREATE PROCEDURE dbo.sel_Track_HitsLast30Days(
@projectID int
)
AS
BEGIN
DECLARE @FirstDay smalldatetime, @NumberOfMonths int, @priorMonth smalldatetime
set @priorMonth = (SELECT CAST(
(
STR( YEAR( dateadd(m,-1, getDate()) ) ) + '/' +
STR( MONTH( dateadd(m,-1, getDate()) ) ) + '/' +
STR( DAY( dateadd(m,-1, getDate(...
I need a stored procedure or script which will script out all database level permissions- including permissions to xp_cmdshell for any objects as well as permissions to a sql proxy account.
Thanks!
...
Hi,
I have a list of books obtained from the database. When a user selects a book, I'd like it to retrieve the information for that book and display it on screen. However, I'd like to keep the ID of the book hidden from the client-side, so what would be the best way to transfer the ID of the selected book? I think my brain has melted,...
I have a local SQL 2000 database. My Winform app suddenly died when trying to all a stored proc that has not changed. Here's teh error message:
Server: Msg 7404, Level 16, State 2, Procedure RecordCurrentUser2, Line 45
The server could not load DCOM.
Then, I noticed that when I try to alter the SP using Query Analyzer, I would get the ...
How can I make my SQL statements not to appear in Profiler ?
They contain sensitive information and I don't want them to
show in Profiler.
Thanks for the replies !
...
I maintain a couple of older sites running SQL Server 2000 and 2005. On my old XP box I was using SQL Server Enterprise Manager to access them.
I'm now on a Windows 7 box. Is that product still available for download/install and will it run on Windows 7? I can't seem to find a download for that specific component.
Or is there an alte...
Hello All
Is there any free tool to generate SQL insert Script in order of dependency.
Thanks
...
I've created a self-signed cert for testing encryption between my web application and the SQL Server.
When attempting to query the database using "Encrypt=Yes;" in the connection string, I receive the following message:
A connection was successfully established with the server, but then an error occurred during the pre-login handsha...