Automatic Number

Jun 6, 2001

I don't know very much about Sql Server and need help.
I have two primary keys called AirlineCode e ID in the same table.
This id is an automatic number. So I don't need to input this value, since
it's created automatic. What I need is this ID be created automatic but
for each new AirlineCode the ID starts as 1 again. For example :
If I put AirlineCode = 220 then ID starts as 1. In another row AirlineCode is
also 220, then ID is 2. But in another row AirlineCode = 500, then this
automatic number come back to 1.
then the rows can be like this :

AirlineCode ID
220 1
220 2
500 1
220 3
300 1
500 2

I think I have to create a script to make this, but I don't kwon how...
Ask someone to help-me

Best Regards

Marcelo

View 1 Replies


ADVERTISEMENT

Automatic Number Problem

Jul 20, 2005

Hi, i have imported an access database into sqlserver 2000. In access,i have some table fields which were using automatic number asdatatype. But i see that there is not a datatype in sqlserver likeautomatic no. I have to enter id numbers to my tables for each recordsautomatically. Would anybody help me about solving this problem? Anyidea? Thanks

View 5 Replies View Related

Automatic Number Increment In Ms Sql 2005

Jan 24, 2007

will it be possible to increase number as below automatically000000010000000200000003....whenever the row is inserted, number will be increased like aboveformat.which data type should I select and do some other setting to recordlike that?thanks

View 4 Replies View Related

The Number Of Requests For XXXServerXXXUser Has Exceeded The Maximum Number Allowed For A Single User

Oct 15, 2007



I have created a local user on Report Server Computer and the user has the administrative rights.
When i try to connect Report Server (http://xxx.xxx.xxx.xxx/reportserver) with this user's credantials. (ReportServer directory security is set -only- to Basic Authentication. ).
I get the following error.


Reporting Services Error
--------------------------------------------------------------------------------

The number of requests for "XXXServerXXXUser" has exceeded the maximum number allowed for a single user.
--------------------------------------------------------------------------------
SQL Server Reporting Services


Then i try to login using a different user with administrative rights on the machine, i can logon successfully.
The system is up for a month but this problem occured today?!? What could be the problem?!?

View 2 Replies View Related

How To Enter More Number Of Rows In A Table Having More Number Of Columns At A Time

Sep 24, 2007

Hi

I want to enter rows into a table having more number of columns

For example : I have one employee table having columns (name ,address,salary etc )
then, how can i enter 100 employees data at a time ?

Suppose i am having my data in .txt file (or ) in .xls

( SQL Server 2005)

View 1 Replies View Related

Transact SQL :: How To Select A Number Less Or Equal Than A Supplied Number

Jun 23, 2015

Got this query and I need the following result;

declare @NumberToCompareTo int
set @NumberToCompareTo = 8
declare @table table
(
number int
)
insert into @tableĀ 
select 4

[Code] ....

The query selects 4 and 5 of course. Now what I'm looking for is to retrieve the number less or equal to @NumberToCompareTo, I mean the most immediate less number than the parameter. So in this case 5

View 4 Replies View Related

How To Change A Decimal Number To Percent Format Number?

Oct 8, 2006

in my sql, i want to change a decimal number to percent format number, just so it is convenient for users. for example there is a decimal number 0.98, i want to change it to 98%, how can i complete it?

thks

View 4 Replies View Related

Limitations In Term Of Number Of Tasks And Number Of Columns

Jun 5, 2007

Hi,

I am currently designing a SSIS package to integrate data into a data warehouse fact table. This fact table has about 70 columns among which 17 are foreign keys for dimension tables.

To insert data in that table, I have to make several transformations and lookups. Given the fact that the lookups I have to make are a little complicated, I have about 70 tasks in my Data Flow.
I know it's a lot, but I can't find a way to make it simpler. It seems I really need all these tasks.

Now, the problem is that every new action I try to make on the package takes a lot of time. At design time, everything is very slow. My processor is eavily loaded each time I change a single setting in one of the tasks, and executing the package in debug mode takes for ages. If I take a look at the size of my package file on disk, it's more than 3MB.

Hence my question : Are there any limitations in terms of number of columns or number of tasks that can be processed within a Data Flow ?

If not, then do you have any idea why it's so slow ?

Thanks in advance for any answer.

View 1 Replies View Related

Automatic SQL Backup

Feb 9, 2008

Hi,
We are working on creating an automatic backup tool for our web application.  Our goal is to run a script that "zips" the virtual host/application directory.  We have the script to zip the application directory, but is there a way to run a SQL Backup and then zip the output easily?  This is where we are struggling.
 Any Suggestions are appreciated
Brent

View 1 Replies View Related

Automatic Rollback

May 1, 2001

I am getting an automatic rollback in a transaction that fails to insert a row, via a trigger, due to a duplicate key. The transaction is automatically rolled back and unless the error correctly handled a 'partial update' occurs. Why in the example below is the transaction automatically rolled back (statements 1 to 3) and is there any way of knowing what errors generate an auto rollback. For example if the duplicate key error occurs on the insert into table B below, and not the triggered update, then no auto rollback occurs.

Begin Tran -- 1
insert into A values ('A1') -- 2 updates OK
insert into B values ('B1') -- 3 updates OK
-- triggers insert into B_Hist -- 4 Fails with Duplicate Key error
insert into C values ('C1') -- 5 updates OK
Commit Tran -- 6 3902 error No corresponding Begin

Thanks.

View 3 Replies View Related

Automatic Updation

Jul 14, 2000

Hi all,
I am using the odbc connector to get a local table. I want that table to get populated every night automatically. How can i do that? Also i want to check if any existing record is updated/changed in the dsn database. Any help is highly appreciated.
Thanks,
Jeff.

View 1 Replies View Related

Automatic Recovery

Mar 28, 2001

Dear Friends,
I want to Automatically take Backup at 7:00 p.m cutoff Time.and automatically restore the database..to a temporary database,generate my report and delete the database.
Friends,this backup & restore should not require any user interface..it should me automatic.
Plz can anyone help me out.

Regards
Salim g belim

View 1 Replies View Related

Automatic Updates

Jun 23, 2004

I have two sql 2000 server tables one is active and one is terminated (I inherited this db) and I was thinking of having the active table automatically update the terminated table when an employee is terminated. Access is at the front end and in the form of the active table theres a drop down text box that has the employement status(active, terminated, on leave...etc) so when the status turns into terminated i want the acitve table to send those records to the terminated table, ( the data in both tables are not exactly the same). looking into a trigger or stored procedure. This is the first time I've done this so I'm doing some reasearch on how to handle it. Any suggestions

View 14 Replies View Related

Automatic Updates

Jun 25, 2004

well as I get further into this project of automatic updates I'm fining more and more barriers. The combo list box which indicates whether the employee is terminated or active might be a problem with sql since you cant create a Row source and a Row source type in a sql table. that combo box exsist in the properties of the form. The Row Source Type is a Value List. Shoot :(

View 4 Replies View Related

Automatic Job Monitoring

Jul 16, 2006

I'm a SQL Server 7/2000 DBA and manages about 40 servers in different networks. Every morning I check through the Enterprise Manager if all Jobs (backup, maintenance, etc.) have run successfully. This check costs me 1 hour per day.

Because of a reorganization I've got some new college's and lost some college's. My new college's think this is to much work, so it should be automated. They only want the failed jobs to report an error on a website or something like that, and don't want to check 40 servers. I don't agree in this, because I'm affraid I'm going to miss some errors.

How do you do your checks every morning?

Thanks,

Marco

View 2 Replies View Related

Automatic Update

Apr 22, 2008

hi,

i have:

create table tbl_order
(
id int
,price float
,quantity int
,product nvarchar(50)
,date_of_order smalldatetime
,date_of_change smalldatetime
)

insert into tbl_order (id, price, quantity, product, date_of_order) values (1, 23.21, 2, 'A+B', getdate())
insert into tbl_order (id, price, quantity, product, date_of_order) values (2, 22.21, 2, 'A+B+C', getdate())


and i want to make automatic update:
-if new order is made, i want to update field date_of_change with getdate().

i want to put it in a job with some trigger or something that will recognize instant new insert.

thank you in advance,

View 4 Replies View Related

Automatic Failover

May 25, 2008

Hi there,
I am testing the db mirroring, making sure it will auto failover. I've stopped the SQL services on my principal and then I looked at the mirror db is says it's restoring. It stayed like that for 10 min before I enabled the mirroring again. Anyone knows why it's not failing over??????


Here's my setup: SQL 2005 Standard, Server 1 Principal, Server 2 Mirror & Witness.

View 4 Replies View Related

Automatic Scheduling

May 17, 2007

I have initiated database backup plan in 2005,occuring every 2 days.backup plan worked for the first 2 schedules,later backup plans is not working.I have checked the time and date setups,its all fine.how to solve.

View 1 Replies View Related

Automatic ID In A Primary Key?

Feb 11, 2008

CREATE TABLE [dbo].[tblProve](
[ID][varchar](50)NOT NULL,
[tempCountrys][varchar](100) NULL,

CONSTRAINT [PK_tblProve] PRIMARY KEY CLUSTERED
([ID] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO

I have a table "dbo.tblProve" that have a Primery Key ID of type
varchar(10) and this primary key have a Default value or Binding like this:
([dbo].[fnc_ProveNewID]())

This function "dbo.fnc_ProveNewID()" finds the max(ID) in the same table and creates the next ID.

When I insert a record into the table dbo.tblProve the function creates the new ID automatically (this is the format of the ID '0000000001' or '000000010' etc. ). But when I insert a lot of records from a Select Query it displays this message below:

Msg 2627, Level 14, State 1, Line 2
Violation of PRIMARY KEY constraint 'PK_tblProve'. Cannot insert duplicate key in object 'dbo.tblProve'.
The statement has been terminated.

Is there any way to create a new ID into a table automatically without to be inserted by the user or client?.

View 8 Replies View Related

SQL Automatic Growth

Jul 23, 2005

We use SQL 2000 and our database is configured to grow automatically by10%. Currently 96% of our database is used. At what point will thedatabase expand - what is the trigger point?

View 2 Replies View Related

Automatic Fields

Nov 15, 2006

Hi,it's possibile to define table fields for automatic Last_Update_Date and forCreation_date using column formula??Thanks !!!

View 2 Replies View Related

Automatic Process

Jul 20, 2005

I need to automatically generate via SQL, export to Excel and e-mailedto other people montly. what should I setup in the sql server?

View 3 Replies View Related

Automatic Update

Nov 5, 2007


I hope that a someone has answer for me.
I want create a new database in sql server and import the database tables of Dynamics CRM and of other application (Accountview) import so that I can make a link of these two databases. My question is it possible that this database update or refresh automatic and how?
The database of Dynamics CRM manages by sql server. But the database of accountview is not manages by sql server. I make a link with odbc driver for Accountview database.
Can someone help me please?

View 4 Replies View Related

Automatic Email

Oct 18, 2006

Dear Freind,
Its all boutt Dts.I have already created a DTSpackage and Activex script in VBscript to retrieve some particular names ...and i want to send those names through E mail.But the email should be automatic(using sql Sheduler ).Real Problem is...How can i write the code to access the DTS object from ASP.Net with VB? and How can shedule...please help me...i am hopefully waiting..........thanks in advance

View 2 Replies View Related

Automatic Width

Dec 28, 2006

Hello :
It is possible to define the width of the cells of table dynamically (not Statics)?

Thank's.

View 1 Replies View Related

Automatic RTRIM????

Aug 3, 2007

Could anyone explain why this happens:


-- All outputs works but only the first should

select 'works' where '1' = '1'

select 'works' where '1' = '1 '

select 'works' where '1 ' = '1'


Seems to me like trailing blanks are automatically trimmed, why?

View 6 Replies View Related

Automatic Installation

Mar 21, 2007

I have a small desktop application that is distributed in CD.
The client installs the application without any attendance, therefore I need that everything is completely automatic.
Is it possible to install SqlServer Express in that way?

View 6 Replies View Related

Automatic PDF Output

Jul 3, 2007

Normally if I want a report in PDF I have to first view the report in the web browser, then select export as PDF and save the PDF file.

Is there a way to avoid the first step (web browser viewing) and have the report immediatly in PDF as soon as I click the "View Report" button? (without using email/file subscription)

Thank you,
Roberto

View 1 Replies View Related

Automatic Failover... Help

Jan 25, 2007

Hi there,

We've recently set up a Principle, Mirror and Witness configuration with the Mirror and Witness in a separate building to the Principle. All three are part of the same domain (DMZ) and are different servers, the buildings are connected via a fiber optic cable. All servers and SQL Server instances are logged in with the same domain admin account DMZesAdmin.

Mirroring is all set-up and the databases are synchronized. Every once in a while some (not all, normally 6 out of 15) databases will switch roles and become active on the mirror. The SQL Server mirroring monitor job then reports:

Date  25/01/2007 12:37:01
Log  Job History (Database Mirroring Monitor Job)

Step ID  1
Server  DMZSQL01
Job Name  Database Mirroring Monitor Job
Step Name  
Duration  00:00:02
Sql Severity  16
Sql Message ID  32038
Operator Emailed  
Operator Net sent  
Operator Paged  
Retries Attempted  0

Message
Executed as user: DMZesadmin. An internal error has occurred in the database mirroring monitor. [SQLSTATE 42000] (Error 32038).  The step failed.

I have no idea, what causes the failover, it could be a slow network or a bad set-up, can anyone give me some ideas of what to do to track down the problem or any experience of what could be causing this, it happens randomly every day or three. No warning and if I go to the mirror and failover back to the principle again then it's all just fine. However I don't want half my databases working on 1 server and half on the other.

Any ideas?

Thanks
Ed



 

UPDATE:

I've just been looking at the logs on my Mirror and at the same time it reports in this order

Error: 1479, Severity: 16, State: 1.

The mirroring connection to "TCP://DMZSQL01.dmz.local:5022" has timed out for database "WARCMedia" after 10 seconds without a response.  Check the service and network connections.

Database mirroring is inactive for database 'WARCMedia'. This is an informational message only. No user action is required.

Recovery is writing a checkpoint in database 'WARCMedia' (41). This is an informational message only. No user action is required.

The mirrored database "WARCMedia" is changing roles from "PRINCIPAL" to "MIRROR" due to Failover.

Database mirroring is inactive for database 'WARCMedia'. This is an informational message only. No user action is required.

...

 

This looks like a time out, is there any way to set the TimeOut threashold for Database mirroring or set retry intervals??

View 5 Replies View Related

Automatic Refreshing

May 9, 2007

I am wondering if it is possible to have a report generated by RS refresh periodically automatically. This could be realized by inserting a few lines of JavaScript to the report including the reload() function, but I do not know if there is anyway to do such thing.



Thanks in advance for any tip!

View 5 Replies View Related

Automatic Data Fill-up

Oct 28, 2006

Hello guys! I am relavtively new to ASP.NET programming ang was just starting out on my first project. I am using ASP.NET2.0 technology by using Visual Web Developer 2005 Express Edition and of course with SQL 2005 Express Edition. I would like to develop a database for our IP addresses, so one field of my table in a SQL data is the field for IP addresses.I would like to write a program wherein after clicking the button, that field will be automatically filled up with IP addresses (e.g, from 192.168.0.0 to 192.168.0.255).How do I accomplish this kind of dynamic filling up of fields? Thanks a lot! 

View 1 Replies View Related

Automatic Query Generator

Apr 6, 2007

In my final project, the biggest time consuming issue was writing a query, when there are 15 fields on the average than it is certainly not easy to write an SQL statement and run it (through code)

So I want to know, is there any automatic query generator ?
that could work like:
1) We enter all control names 1 by 1
2) we enter postfix text ( like .Trim(), .ToString() ) etc
3) Result should be automatically generated query

Is there any software/program for that ???

Infact it is very easy to develop myself, but I dont want to waste the time if such tool (most probably) already exists

View 1 Replies View Related

How To: Scheduled Automatic Update?

Jun 6, 2007

Hi I'm currently running a complex MSSQL query (using SqlDataSource server control) everytime a web page is loaded to display a single value.  How ever, this data only needs to be updated every 24 hours, therefor remains the same all day.  I'm trying to figure out a way where by the MSSQL query runs once a day and the value is inserted directly somehow into my aspx page, or, failing that is inserted into an MSSQL database.I also have full root access to my server.thanks  

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved