sql-server

Getting started with SQL Server Reporting Services

I'd like to set up SQL Server Reporting Services but I don't know where to start. The books out there are okay but don't seem to fit what I need to do. That is, I want to set up my ASP.NET 3.5 application to be able to view reports I create, both in a web report viewer and downloadable as PDF/Excel. What are the basic steps to do this?...

ASP.NET C# Search in a SQL Server Database Table

I'm building a portal, which isn't a blogging engine, but is quite similar to one. In SQL Server, I have a database containing a table that is the basis for the "posts". This Posts table includes the following columns: ID Author(s) Tags Title Markdown post content This is my first time building such a portal, and I'd like to impleme...

SQL Server Data Dude dpproj - on deploy can't change owner to sa

I have a CLR function that requires TRUSTWORTHY ON and owner of the db = 'sa' in order to function correctly. In my deploy script I am calling this code: Use MySecurityDB go EXEC dbo.sp_changedbowner @loginame = N'sa', @map = false go Use MyMainDB go EXEC dbo.sp_changedbowner @loginame = N'sa', @map = false go AL...

Login Failed for User 'NT AUTHORITY/NETWORK SERVICE' when using EntityDataSource with ASP:ListView

Hello All, I have receive the infamous Login Failed for User 'NT AUTHORITY/NETWORK SERVICE' when I try to run a page that contains and EntityDataSource and Listview. Here's Stack Trace: [SqlException (0x80131904): Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException...

How to make up for changed Sql Server database password

There is a website made using .net, the maker has gone and we can't find him. For a long time we don't know the password of the sql server database, today I tried to reset the password and then found the website can't connect to the database! However I've got the .cs and .aspx and .dll files, I checked the code and find it getting connec...

access and sql server realtime synchronization

i have a security application that stores its data in a access database.now i'm required to make a realtime synchronization (replication) between that access database and a new database in sql server 2005. these two database are the same. any suggestion?! ...

Lock whole database?

I have really odd user requirement. I have tried to explain to them there are much better ways of supporting their business process and they don't want to hear it. I am tempted to walk away but I first want to see if maybe there is another. Is there anyway that I can lock a whole database as opposed to rowlock or tablock. I know I can p...

Is there a way to get the fields names of a table created in a function / stored procedure?

Hello... when I need the columns of an existing table I use the query: SELECT c.[name] FROM (SELECT * from syscolumns) c INNER JOIN (SELECT [id] from sysobjects where name= 'tableName') o on c.[id]=o.[id] I need the fields of a table that I create during runTime: select a.ID, b.lName, b.fName into #T fro...

What should be the table contain updated row for update trigger...

Hi everyone, A while ago i read the article for Trigger in SQL Server, and it said that i can use the Logical Table "Updated" for updated rows... And i got error: System.Data.SqlClient.SqlException: Invalid object name 'Updated'. After a while of google, i found out some more post that said only 2 logical tables available are: Insert...

Cannot use text, ntext, or image columns in the 'inserted' and 'deleted' tables.

Cannot use text, ntext, or image columns in the 'inserted' and 'deleted' tables. What should be the workaround in this case? :( ...

ASP.NET SQL Server report writer that will work under medium trust

I am looking for recommendations on a reporting alternative that I can use in my ASP.NET applications, against a SQL Server 2008 database, that will run under a "Medium Trust" security option. I have all my clients hosted under my Rackspace/Mosso cloud solution, and have run into this stumbling block. I'd hate to have to go back to a d...

two basic questions about MySQL

Hello everyone, I am a developer previously working on SQL Server and Windows platform. I am learning MySQL on Windows platform. I have two basic questions which does not find definite answer yet, Does MySQL support T-SQL to write store procedure? If not, are there similar technologies to T-SQL in MySQL world (I am referring to stable...

recommend MySQL book for developer?

Hello everyone, I am a developer previously working on SQL Server and Windows platform. I am learning MySQL on Windows platform to feel the power of free and open software, and also spirit of it. :-) My requirements to learn, I am working on .Net (C#) and native (C++) programming language on Windows platform, I want gurus here recomm...

SQL Server: How do I get the value for the row I inserted?

My SQL Server table has, between other, these columns. AutoID which has IdentitySpecification set to True and GuidKey which has the default value of (newid()) AutoID GuidKey 1 f4rc-erdd 2 gedd-rrds Is there any way of getting the GuidKey from the row inserted? I need something like the Scope_Identity(), with the di...

get max from table where sum required

Suppose I have a table with following data: gameId difficultyLevel numberOfQuestions -------------------------------------------- 1 1 2 1 2 2 1 3 1 In this example the game is configured for 5 questions, but I'm looking for a SQL statement that will work f...

invalidCastException was unhandled by user code

when i tried to compile my asp.net web site project, i got this error. invalidCastException was unhandled by user code protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand("Sp_Kullanici_Ekle ", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@ad", SqlDbTyp...

On which field was the keyword found? SQL Searching

I'm trying to make a detailed search engine for my web site. The keywords are being searched in multiple fields and tables. For example, using keywords: uludag university These keywords are being searched in the education, address, contactname, and contactsurname fields in my Members table. I have to do it so because there must b...

SQL: How do I use parameter for TOP like in SELECT TOP @amount?

In the vs2008 query builder, I’m trying to make a query that gets a parameter for the "TOP" Command, but it won't let me, and it say's "Error in top expression" Works: SELECT TOP 5 * FROM dbo.SomeTable WHERE SomeColumn = SomeValue Doesn't Work: SELECT TOP @param1 * FROM dbo.SomeTable WHERE SomeColumn = SomeValue ...

sql Query help - little help

Short database description "Ships": The database of naval ships that took part in World War II is under consideration. The database has the following relations: Classes(class, type, country, numGuns, bore, displacement) Ships(name, class, launched) Battles(name, date) Outcomes(ship, battle, result) Ships in classes are arranged to a...

SQL Server Query Optimization: Where (Col=@Col or @Col=Null)

Not sure where to start on this one -- not sure if the problem is that I'm fooling the query optimizer, or if it's something intrinsic to the way indexes work when nulls are involved. One coding convention I've followed is to code stored procedures like such: declare procedure SomeProc @ID int = null as select st.ID,st.Col1,st....