My company needs to write a query that determines when data is being entered inaccurately. We have a table in our db called "ProductChanges". It looks (something) like this -
Product User ChangeDate OldValue NewValue
2344 John 24/01/10 10:00 2344 4324
6435 Greg 28/01/10 13:30 ...
Hi,
I have this question for quite a long time...
I have seen many discussions about granting role based access for Databases... But with respect to asp.net web apps... The web app is any way going to connect to the database, with the ID specified in connection string, irrespective of the user connected to the application... (except f...
In SQL Server, what is the difference between a @ table, a # table and a ## table?
...
I have a bunch of data that is stored in a few tables and serves as a template when a new customer or such is created.
I know i could do a select and copy all the properties and execute a save, however some of the fields are large retrieving to and from the db doesn't seem the most optimal idea.
I have also thought about writing a cus...
Hello, just wondering if how can we retrieve a data from stored procedure, who's return value is not in a row. I've run the stored procedure and it doesn't return any rows but return some data >.< just like this photo. could anyone know how to retrieve return value @rtncode in .NET?
Thanks!
...
Is there a SQL Server 2000 functional equivalent to MySQL's ON DUPLICAT KEY clause? This Answer led me to look at the Instead of Trigger construct, but the sample looks clunky, and the functionality would be hidden in the trigger, and not be directly in the stored proc.
FWIW: I am trying to create a stats table for per-minute summaries,...
Using VB.Net and SQL Server
I want to compare the textbox value with table row value by using if condition
Code
If textbox1.text = cmd
cmd = New SqlCommand("Select name from table1", con) Then
cmd.ExecuteNonQuery()
cmd = SqlCommand
The above code is showing error in if condition. I don't know how to compare the textbox value with t...
Hi all,
I have a Problem in Retrieving records by giving from and to date. I want to fetch record for date Feb 08 2010, and I should use To and From date fields. I tried:
select * from dbo.BuzzMaster
where date >= '2/7/2010'
and date <= '2/8/2010'
Output:
Not able to retrieve records for date '2/8/2010'
I get the record for d...
I tagged this question "impossible" because after a lot of googling, i have not find any trace\reference to a possible answer.
I'm asking if there is some way\dirtytrick (possibly cheap) to access Microsoft Sql Server from z/OS mainframe (COBOL programs) and have the result in 3270 terminal emulation; i know that 3270 is a pretty old sys...
Hi everybody
Does anybody know how can I proxy SQL Server requests through another application.
I have desktop based application and I do not want the application to directly connect to SQL Server.
...
Is there a reason to check for null in the last using? Seems to me like it's most likely not gonna be needed?
using (var connection = new SqlConnection(connectionString))
{
using (var command = new SqlCommand(commandString, connection))
{
using (var reader = command.ExecuteReader())
{
if (reader != null) {
// Use...
I would like to know if anyone out in the industry has had experiance in migrating from Interbase to MS Sql Server.
Migrating the tables & data is not a big concern, but triggers & stored procs will not be so easy.
Any advice?
...
Problem
I got two related tables, with a foreign key that doesn't enforce FK contraints. The "child" table should be allowed to specify a "parent" key, which is either NULL or non-existing ID.
My data access is built using Linq2Sql and it generates a one-to-many relation in the model of my tables.
The problem comes in some cleanup cod...
I've got the problem that
select datepart(ww, '20100208')
is returning as result week 7 in SQL Server 2000. But 08.02.2010 should be week 6 according to the ISO 8601 specification! This is causing problems in delivery week calculations.
What should I do to get week number values according to ISO 8601?
...
Hi,
I have a table in SQL Server 2005 containing 10000054 records; these records are inserted through a bulk insert operation. The table does not contain a primary key and I want to have one. If I try to modify the table's structure, adding a new column, PK, set as int with isidentity, the management console gives me a warning:
"Chan...
I have a table with 200,000 records. I want delete some data like below :
DELETE FROM Table Where IdColumn IN ( SelectedID )
SelectedID fill with my desirable data identities that contains 5000 records. there are 2 approach:
1- I insert 20,000 identity as SelectedID that contains identities of desired 5000 records.
2- I insert only ...
I was in search of a SQL Script , in order to determine , if there is any data(row count ideally) in any of the tables in a given database.
The idea was to re incarnate the database , in case if there are any rows existing(in any of the database) .
The database being spoken of is SQLSERVER.
Could Someone suggest a sample script.?
th...
Hi,
Does SQL Server 2005 support ANY or EVERY with HAVING?
Suppose I have two tables Training(TrainingID, TrainingCloseDate) and TrainingDetail(TrainingDetailID,TrainingID,LKClassCode,CompletionDate). For one TrainingID, there can be multiple values in TrainingDetail with different LKClassCode. I need to find all the TrainingIDs which...
I have sql reporting services installed in my system.
I can access it through the url http://localhost/Reports_SQLEXPRESS/
But the strange thing is I am not able to view this virtual directory in my IIS management console. I need to set the permissions for this virtual directory, but it cannot be found.
What might be the problem?
...
What is the importance of schema in sql server?
Where this schema help me?
Is it important for security reasons?
...