Hello all,
I'm constructing a prototype site for my company, which has several thousand employees and I'm running into a wall regarding the implementation of a specific requirement.
To simplify it down with an example, lets say each user has a bank account with interest. Every 5 minutes or so (can vary) the interest pays out. When the...
How to implement the scalar MAX in Sql server (like Math.Max). (In essense I want to implement something like Max(expression, 0), to make negative values replaced by 0.)
I've seen in other threads solutions with
creating a scalar function (how's that with performance?)
case when expression > 0 THEN expression ELSE 0) (then 'express...
Before I delete/replace a stored procedure, I would usually do a string search of the name of the stored procedure in the working project to make sure no unsuspecting code is using it. Is there a better and more reliable way of doing this?
Oh and the code is in c# and i'm using vs2008
...
OleDbDataAdapter internal error: invalid row set accessor: Ordinal=6 Status=UNSUPPORTEDCONVERSION
All I'm doing is trying to do a simple select statement. The field in ordinal 6 is an NTEXT field. Are they telling me I can't use NTEXT fields in my database with OleDb providers? Is there any workaround here?
...
I am wondering if there is a good-performing query to select distinct dates (ignoring times) from a table with a datetime field in SQL Server.
My problem isn't getting the server to actually do this (I've seen this question already, and we had something similar already in place using DISTINCT). The problem is whether there is any trick...
I have 3 columns of data in SQL Server 2005 :
LASTNAME
FIRSTNAME
CITY
I want to randomly re-order these 3 columns (and munge the data) so that the data is no longer meaningful. Is there an easy way to do this? I don't want to change any data, I just want to re-order the index randomly.
...
What can I do wtih a binary data type in SQL Server to make my life easier?
I recently found out about this nifty feature
DECLARE @p0 varbinary(128)
SET @p0 = --?
SET CONTEXT_INFO @p0
How can I in a reasonable efficient manner store data that makes some sense in this binary slot? Oh, and then access that data in some reasonable way?
...
I am loading tables in my warehouse using SSIS. Since my SSIS is slow, it seemed like a great idea to build indexes on the tables.
There are no primary keys (and therefore, foreign keys), indexes (clustered or otherwise), constraints, on this warehouse. In other words, it is 100% efficiency free.
We are going to put indexes based on ...
I'm looking for what I think is called a data modeling program to map out all of our SQL Server tables (200+) into a large, poster-size image. We've put all of our legacy application tables into SQL Server 2005 and my boss is looking for a snazzy way of viewing the data... basically something to say "this is what we maintain".
I've see...
While studying for the 70-433 exam I noticed you can create a covering index in one of the following two ways.
CREATE INDEX idx1 ON MyTable (Col1, Col2, Col3)
-- OR --
CREATE INDEX idx1 ON MyTable (Col1) INCLUDE (Col2, Col3)
The INCLUDE clause is new to me. Why would you use it and what guidelines would you suggest in determining wh...
I am importing a SQL Server 2000 database to my SQL Server 2008 server.
I don't want to import any user/permission information, is there a way to ignore this?
The current restoration is causing me issues as it has users tied to the db.
...
how do you create a one to many relationship using SQL Server?
thank you
...
This is my first attempt at using Business Intelligence development studio.
I have set up the project and now trying to deploy my changes. When I run the project I get an error ensure that sql browser is running.
Done- setting up cubes & mining structure.
Checked that database instance is correct.
I have checked that sql2005 is running....
I have a bunch of tables that have DateUpdated columns.
How can I have those fields automatically set to DateTime.Now when the objects are persisted back to the data store when SaveChanges() is called.
I don't need to do it across the board with one piece of code. I would be OK with adding event handlers in all of the partial classes,...
I was reading over the documentation for query hints:
http://msdn.microsoft.com/en-us/library/ms181714%28SQL.90%29.aspx
And noticed this:
FAST number_rows
Specifies that the query is optimized for fast retrieval of the first number_rows. This is a nonnegative integer. After the first number_rows are returned, the query continues executi...
(This doesn't look like a programming question but it might boil down to a programming question.)
I'm using MS Access 2007 to view tables in a database (through an *.adp file) that lies on SQL Server 2000 and SQL Server 2005.
I use the Copy Database task in MS SQL Server Management Studio to copy the data from SQL Server 2000 (the "liv...
I have a sproc that was taking far more time than I expected.
I pulled out the SQL and ran it with just DECLARED variables for the parameters. It ran nearly instantaneously (versus a reliable 8 seconds with the sproc). This is the same SQL on same machine, returning the same data.
How can I figure out and fix what is causing the spro...
Greetings.
I was wondering how I create a cross table query via C# when the databases are unattached (development)
I know the .mdf files are temporarily attached to the database when you execute--but that's really the source of the confusion. If your DB connections are all to separate database files that cause them to be dynamically a...
I'm using this code in my report, to alternate row colours of grouped rows.
http://stackoverflow.com/questions/44376/add-alternating-row-color-to-sql-server-reporting-services-report/83832#83832
It works correctly on my development server (SQL Server 2008 Developer Edition), but not on the live server (SQL Server 2008 Express).
Is the...
hi friends
I have to update the primary key. When i am inserting in a data grid it newly inserting a record. I am unable to. What is the reason, pls help me.
...