I'm just reading my company's code guidelines and it says to never treat variables as a constant in sql server, use literals instead. The reasoning is that sql server can't build a good execution plan when you're using variables in the query.
Anybody know if this is still true? We're using MSSQL 2005 and this document may have been wr...
Let me preface by saying I am not knocking .Net (it helps me earn my living)...
I recently heard of a site were the developer/owner bragged that he had minimal hardware to support his site (plentyoffish.com). This site is listed as being in the top 50 in terms of traffic on Alexa. I am struggling to wrap my head around how something li...
We are trying to build a Help Desk ticketing system just for intranet. Deciding upon the ASP .NET (C#) with Visual Studio 2008 Express (think we have a full version floating around if we need it). Nothing fancy, couple of pages grabbing NTLM information, system information and storing it along with their problem in a database. Goal is to...
What is a stored procedure? How do they work? What is the make-up of a stored procedure (things each must have to be a Stored Procedure)?
...
I'm trying to determine at runtime what the SqlDbType of a sql server table column is.
is there a class that can do that in System.Data.SqlClient or should I do the mapping myself? I can get a string representation back from
SELECT DATA_TYPE, CHARACTER_MAXIMUM_LENGTH
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_CATALOG = '{0}' AND T...
Here is my scenario:
I have implemented set logic in my C# framework. Sets can contain a large quantity of objects, perhaps even up to 1 million in the worse case. Assume sets just contain lists of objects called Doc. Because of the potential large number of objects, I would like to give the developer a choice of how to create and us...
We have customers who, for unassailable reasons, cannot use SQL Server's built-in backup features because it backs up the entire database. These customers need to breakup and backup the database into subsets of who owns the data so the appropriate parties can backup their own data according to their own rules. My question is two-fold:
...
I would like to use the ASP.NET Membership Provider security framework but would like it to use SQL Server schema's. So instead of having tables such as aspnet_Membership I would prefer it to be something like sec.Membership. Has anyone tried this and got it to work?
...
After laying out my schema diagram in SQL Server (both 2000 and 2005), I want to print a copy to paper. When I go to print, SQL seems intent on recalculating the pagination (and getting it very wrong).
I'm simply printing to the default printer - an HP Officejet. I've tried forcing a repagination before manually adjusting it. Saving an...
Why does SQL 2008 all of a sudden want to drop my tables when I go to change the column type from say int to real? This never happened in SQL 2005 to my knowledge. Any insight would be helpful please.
...
I am using Linked server For Tansaction
example
Alter Proc [dbo].[usp_Select_TransferingDatasFromServerCheckingforExample]
@RserverName varchar(100), ----- Server Name
@RUserid Varchar(100), ----- server user id
@RPass Varchar(100), ----- Server Password
@DbName varchar(100) ----- Server database ...
I have developed my ASP.net application with SQL Server 2005 which as installed version
of .net Framework 2.0.
Please some one suggest what are the hardware requirements (windows server) to host in Production server and its configuration
to host the application.
The total number of users around 10,000 per second
around 10,000 requests...
I'm trying to setup a sqlserver 2005 that will be accessed using C++ and ODBC (the data read will be sent in XML files). So, I want to read data from the database (preferably utf-8), compose a XML file and send it.
I have been browsing around and i haven't found a way to setup the database and the tables for using utf-8 (as in MySQL). I...
Here is my sample data:
1;a;b;c;; 2;d;e;f;; 3;g;h;i;;
4;j;k;l;; 5;m;n;o;;
6;p;q;r;;
Here is my sample format file (BCP 9):
9.0
7
1 SQLCHAR 0 0 "" 0 x Latin1_General_CI_AS
2 SQLCHAR 0 0 ";" 2 i Latin1_General_CI_AS
3 SQLCHAR 0 0 ";" 3 s Latin1_General_CI_AS
4 SQLCHAR 0 0 ";" 4 t Latin1_General_CI_AS
5 SQLCHAR 0 0 ";" 5 u Latin1_Genera...
Hey all,
I am working with another coder on a website that is accessing SQL Server (2008 Express) through some web services he created (involving mostly LINQ to SQL), and the UI is in Silverlight. I've been working on another part of the system, but just got his latest code, and am trying to run it on my machine, but am getting an erro...
I need to iterate through the fields on a table and do something if its value does not equal its default value.
I'm in a trigger and so I know the table name. I then loop through each of
the fields using this loop:
select @field = 0, @maxfield = max(ORDINAL_POSITION) from
INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = @TableName
while ...
Apologies if I get the terminology wrong. How do I define a constraint in MSSQL Server 2005 to enforce uniqueness in one column depending on another column?
E.g. considering the last two columns:
1 A 1
2 A 2
3 A 2 <- Disallow because '2' has already appeared alongside 'A'
4 B 1
5 B 2
...
Is the following stored procedure code robust for multi-user application. It is working fine. I was wondering if there is any better way to do it and if there is any performance issues.
The proc has three sql statements together like 1.Updating hardware status in Allocation Table 2. Calculating Next appropriate Primary Key value for new...
I need to use DbTransactions (on a single db) but I am not sure about how to make sure it will keep working when I deploy to the production environment.
What are the requirements for an application to be able to use SQL DbTransactions?
Are they allowed by default in SQLServer (and what's the deal with MSDTC)?
...
I have backed up and restored a MS SQL Server 2005 database to a new server.
What is the best way of recreating the login, the users, and the user permissions?
On SQL Server 2000's Enterprise Manager I was able to script the logins, script the users and script the user permissions all seperately. I could then run one after the other a...