I have two tables:
Table1 = Schools
Columns: id(PK), state(nvchar(100)), schoolname
Table2 = Grades
Columns: id(PK), id_schools(FK), Year, Reading, Writing...
I would like to develop a query to find the schoolname which has the highest grade for Reading.
So far I have the following and need help to fill in the blanks:
SELEC...
hi, i want to insert value of one col to another on inserting new row in sql.
how do i? there is any way to do this by default value(constraint)?
...
How to write stored procedure in SQL Server 2008 that generates 3 million random no in two columns in integer datatype.
...
Hi all
Our ASp.net application is getting error as below"
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied "
I can connect with Enterprise manager management studio and Query analyzer without any issue.
It was running these applications with out any issue long time. last one week we are getting this er...
Sirs,
I have the following physical model below, resembling an class table inheritance like the pattern from Fowler (http://martinfowler.com/eaaCatalog/classTableInheritance.html)
CREATE TABLE [dbo].[ProductItem] (
[IdProductItem] INT IDENTITY (1, 1) NOT NULL,
[IdPointOfSale] INT NOT NULL,
[IdDiscountRul...
In my application I have two queries which will be quite frequently used. The Where clauses of these queries are the following:
WHERE FieldA = @P1 AND (FieldB = @P2 OR FieldC = @P2)
and
WHERE FieldA = @P1 AND FieldB = @P2
P1 and P2 are parameters entered in the UI or coming from external datasources.
FieldA is an int and highly n...
hi
i have C# program (in Visual studio 2005) and i try to connect and
work with sql-server 2008.
the connect is success but i get this error:
this server version is not supported. you must have Microsoft SQL server 2005 Beta 2 or later
what can i do ?
thank's in advance
...
The application I'm using tries to connect SQL Server named instance running on a dedicated database server. Here's the error I'm getting:
The TCP/IP connection to the host <instance_name>, port 1433 has failed. Error: Connection refused: connect.
Is the firewall blocking my access or what? Should I dedicate a different port for this...
Is there a way to grant execute permissions for a role or a user using GUI (not T-SQL)? I'm using SQL Server 2008 SP1.
...
I'm trying to do the following for my IIS logs table:
ALTER TABLE [W3CLog]
ADD [LogTime] AS [date] + ([time] - '1900-01-01') PERSISTED
However, SQL Server 2008 tells me:
Computed column 'LogTime' in table 'W3CLog' cannot be persisted because the column is non-deterministic.
The table has this definition:
CREATE TABLE [dbo].[W3CLog]...
This is on Microsoft SQL Server. We have a query where we are trying to join two tables on fields containing numeric data.
One table has the field defined as numeric(18,2) and the other table has the field defined as decimal(24,4). When joining with the native data types, the query hangs and we run out of patience before it will finish ...
I had this script which worked in sql server 2005
-- t-sql scriptlet to drop all constraints on a table
DECLARE @database nvarchar(50)
DECLARE @table nvarchar(50)
set @database = 'dotnetnuke'
set @table = 'tabs'
DECLARE @sql nvarchar(255)
WHILE EXISTS(select * from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where constraint_catalog = @datab...
Hello,
I got question about IDENTITY_INSERT. When you change it to ON, SQL Server automatically changes AUTOINC_NEXT value to the last inserted value as identity.
So if you got only one row with ID = 1 and insert row with ID = 100 while IDENTITY_INSERT is ON then next inserting row will have ID = 101. I'd like it to be 2 without need ...
I have a SSIS package I am trying to schedule. I create a new job under SQL Server Agent. On the Command line tab of the jobstep, I choose "Edit the command-line manually".
The changes are retained as I switch from tab to tab within the job step but whenever I exit and save the job, the changes are lost.
Any ideas what's going on?
I'm...
I have a SSIS 2008 package that calls about 25 other SSIS packages.
Each of those child packages loads a specific file into a table. But sometimes one or more of these input files will be missing.
How can I let a child package fail (because a file is missing) but let the rest of the parent package keep on running?
I've tried increasi...
My MVC site (sql08 back-end - nHibernate in the middle) asks for a company name when a user creates a new account. My business rules dictate that i accept whatever the user enters but into a field named CompanynameProvisional. Management needs to confirm that entry so we can enforce a One-to-Many relationship. (a single company can have ...
I want my SSIS package to stop completely after handling the first error.
I have tasks that run in the Package OnError event handler, but then I want the package to exit. Unfortunately, I have not been able to get this to happen.
Even worse, when I get a warning, since I don't have an OnWarning handler, it propagates up to OnError, wh...
Hi, I am having an issue where my DB restore and shrink operations are going REALLY slow. When I run “select * from sys.dm_exec_requests” I am able to find the row representing my operation. Most of the time it looks like the “percent_complete” field is not increasing, and the “wait_type” field says “PAGEIOLATCH_SH”. Does anyone know ...
First of all "Northwind" and "AdventureWorksDW2008" databases attached without problem, but "AdventureWorks2008" fails with the following error.
//
Msg 5120, Level 16, State 105, Line 1
Unable to open the physical file "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Documents". Operating system error 2: "2(The syste...
I have a requirement to copy whatever data is getting inserted or updated to a log table to show who updated and when. I was thinking of using triggers for the same. The reason being the insert needed not be only stored procedure but can also be packages. Can I use extended events for the same ?.
...