I have a year 2009, a month 11 and a day 12. All of these are being passed to me as integers. What I want to do is create a date from these. I want to use these as part of my where statement.
What is the best way to do it from either a clean code and most importantly a speed point of view?
I personally am using MS SQL, which I'm sure w...
I am working on a product that runs an SQL server which allows some applications to login and their logins are granted permission to run a stored procedure- AND NOTHING ELSE. The stored procedure is owned by an admin; the stored procedure takes a query and executes it, then the results are returned to the application.
Unfortunately I c...
For my asp.net website with forms authentication, I will use Windows integrated security to access a sql database. I will give DB permissions to the ASPNET or NETWORK SERVICE. Under what circumstances would I use SQL authentication instead?
...
I'm a developer and I often work remotely when I can rather than commuting to work. I would like to be able to take the dev database environment with me. I know I can access the database remotely, but it slow. I sometimes work where there's no wireless connection.
Any ideas?
...
This shouldn't be hard to do. I'd expect Enterprise Manager to show a folder of trigger and a list and an icon... but I don't see it anywhere. My google results get me answers where I have to write code. Are you kidding me? The only way is by writing code?
...
And if not, is there a way to tell when a trigger was disabled/enabled?
FOLLOWUP:
It's a rather interesting diagnostic case. I was only involved from the periphery, and the guy doing the diagnostics isn't a database guy.
Anyways, he had a trigger that would move data from one table to another. He did a comparison and not all the data ...
I have a "datadump" table that has a bunch of mixed performance-related data.
Something like:
MachID TestDate MachType Value1 Value2 ...
00001 01/01/09 Server 15 48
00001 01/02/09 Server 16 99
19999 01/01/09 Switch 32 4.9880
19999 01/02/09 Switch 32 5.8109
...
I'm new to SQL and relational databases and I have what I would imagine is a common problem.
I'm making a website and when each user submits a post they have to provide a location in either a zip code or a City/State.
What is the best practice for handling this? Do I simply create a Zip Code and City and State table and query against...
Does anyone know how to find the most recent backup for a database using SMO?
...
I have a table with a charge/credit column:
Item | PriceVal | CostVal | CHARGE_CODE
1 5 3 CH
2 8 5 CH
1 -5 -3 CR
3 7 1 CH
4 15 10 CH
1 5 3 CH
I've got the query I need to get th...
I just setup full-text search on my development database. I setup a new full-text index on a table and included 2 columns in the index. The first column is called 'description' and is a 'varchar(100)' and the other column is called 'notes' and is a 'text' column.
I am trying to perform a simple search like this:
select *
from myTable
w...
Hi folks,
i'm trying to restore our live DB onto our Dev box. To do this, I when onto production, TASKS -> backup Db. it created a 4Gig file. I zipped this down to 2.2Gig. download that to my dev server.
On my dev server, i create a new DB (called 'xxxxx') and then Tasks -> restore DB from file. I give it the .bak file name, overwrite ...
I have a stored proc that processes a large amount of data (about 5m rows in this example). The performance varies wildly. I've had the process running in as little as 15 minutes and seen it run for as long as 4 hours.
For maintenance, and in order to verify that the logic and processing is correct, we have the SP broken up into secti...
As the title says, I'm having issues connecting to MSSQL from a PHP Script.
The setup:-
PHP is running on an Apache Linux Server.
Microsoft SQL Server 2008 is on an XP Machine.
I've got Remote Connections turned on in the MSSQL Server.
The database bggs does exist.
The database is running (I can see a green arrow).
I have no firewall ...
I'm trying to do some basic paging in MSSQL. The problem I'm having is that I'm sorting the paging on a row that (potentially) has similar values, and the ORDER BY clause is returning "random" results, which doesn't work well.
So for example.
If I have three rows, and I'm sorting them by a "rating", and all of the ratings are = '5' - t...
30 million distinct phrases, not documents, ranging from one word to a 10 word sentence and I need to support word/phrase searching. Basically what where contains(phrase, "'book' or 'stack overflow'") offers.
I have an instance of SQL Server 2005 (32 bit, 4 proc, 4gb) going against several full text catalogs and performance is awful for...
I have a report, which was recently converted from SSRS2005 to SSRS2208.
The report header has a background, which is calculated depending on the page number. In the report footer there is an image and two text boxes, also calculated depending on page number.
The report preview in the Business Intelligence Development Studio displays c...
Why does the SQL Standard accept this? Which are the benefits?
If have those tables:
create table prova_a (a number, b number);
alter table prova_a add primary key (a,b);
create table prova_b (a number, b number);
alter table prova_b add foreign key (a,b) references prova_a(a,b) ;
insert into prova_a values (1,2);
You can insert thi...
I am writing a report, which exports nicely to PDF. However, it does not export to a Word document (.doc) properly.
(Margins get ignored in the header area, which messes up pages breaks, footer text is missing, etc.)
To work around this, I want to disable, enable and/or re-size a few items in my report depending on if it is rendered a...
We have 2 tables called TableToUpdate and Dates.
We need to update TableToUpdate's EndTimeKey column by looking from other table Dates. We run sql below to do this, but it takes to long to finish.
Table TableToUpdate has 6M records.
Table Dates has 5000 records.
How can we optimize it ?
Thanks for replies !
update TableToUpdate set
E...