Showing posts with label hii. Show all posts
Showing posts with label hii. Show all posts

Tuesday, March 27, 2012

Can we do the Validations in bcp format file

Hi
I need few clarifications. I am using bcp 9.0 tool to load the data into the
table in SQL Server 2005.
Can we do validations in bcp format file.
The validations like
1. if the datafile field data is "ABC" I want to insert the data into table
as "DEF" or if the datafile field data is "123" I want to insert the data
into table as "456" .
2. Format the date filed and insert the formated date data into table column
.
3. Assign default values or Constant values for the columns of the table,
the data for those fields are not exist in the date file
Thanks in Advance
Regards
VeeruVeeru (Veeru@.discussions.microsoft.com) writes:
> I need few clarifications. I am using bcp 9.0 tool to load the data into
> the table in SQL Server 2005.
> Can we do validations in bcp format file.
> The validations like
> 1. if the datafile field data is "ABC" I want to insert the data into
> table as "DEF" or if the datafile field data is "123" I want to insert
> the data into table as "456" .
> 2. Format the date filed and insert the formated date data into table
> column.
> 3. Assign default values or Constant values for the columns of the table,
> the data for those fields are not exist in the date file
I've answered this question in .tools. Please don't post the same question
independently to multiple newsgroups.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Thursday, March 22, 2012

can u help me to set dynamic database option to crystal reports

hi
I am having 120 crystal reports of 9 and when ever I want to change the DBuser I am facing problem and i have to change for all the 120 reports
IS THERE ANY EASY SOLUTION FOR ME..?
PL HELP ME...:thumb:Hi paste this code in all the view pages of the report and try ...this is working for me in XI verison.
Please do reply me after trying

'' New Code for Passing the DB in Run-Time for CR-XI
Set mainReportTableCollection = Session("oRpt").Database.Tables

For Each mnTable in mainReportTableCollection
With mnTable.ConnectionProperties
.Item("user ID") = DB_UID
.Item("Password") = DB_PWD
.Item("DSN") = CRYSTAL_RPT_DSN
.Item("Database") = DB_NAME
End With
' response.write mnTable.ConnectionProperties.Item("DSN")
mnTable.Location = DB_NAME & ".dbo." & mnTable.name
'mnTable.Location ="crbard.dbo." & mnTable.name
Next

Dim CRXSections, CRXSection, CRXobject, CRXSubreport, CRXsubreports, CrSubtable
Set CRXSections = session("oRpt").Sections
For each CRXSection in CRXSections
For each CRXObject in CRXSection.ReportObjects
If CRXObject.Kind = 5 then 'Subreport
Set CRXSubreport = CRXObject.OpenSubreport
for each crSubTable in CRXSubreport.Database.Tables
' StripLocation(crSubTable)
' crSubTable.SetLogonInfo CRYSTAL_RPT_DSN,DB_NAME , DB_UID, DB_PWD

With crSubTable.ConnectionProperties
.Item("user ID") = DB_UID
.Item("Password") = DB_PWD
.Item("DSN") = CRYSTAL_RPT_DSN
.Item("Database") = DB_NAME
End With
crSubTable.Location = DB_NAME & ".dbo." & crSubTable.name
'crSubTable.Location = "crbard.dbo." & crSubTable.name
next
End IF
next
next
'' Code End for Passing the DB in Run-Time for CR-XI

Can truncate but not delete

Hi
I have a 43,000 row table but can no longer delete the data from it all of a
sudden..it just hangs on the process and the processor shoots up to 100%. Bu
t
I have tried truncating this and it works, I know deleting logs every row
deleted but am not sure why I am getting this problem or what to monitor to
solve it.
Any help or advice would be great thanks
SammySammy
Do you have a WHERE clause in your DELETE statement?
Actually , DELETE and TRUNCATE commands are 'slightly' different in terms
how they do the job
DELETE command is fully logged (every row was deleted is recorded in TL) ,
as opposed TRUNCATE command which
logs only the deallocation of whole data pages
"Sammy" <Sammy@.discussions.microsoft.com> wrote in message
news:1B557178-E1BA-4D16-B4E8-2B9519856649@.microsoft.com...
> Hi
> I have a 43,000 row table but can no longer delete the data from it all of
> a
> sudden..it just hangs on the process and the processor shoots up to 100%.
> But
> I have tried truncating this and it works, I know deleting logs every row
> deleted but am not sure why I am getting this problem or what to monitor
> to
> solve it.
> Any help or advice would be great thanks
> Sammy|||Hi Uri,
No its just delete quotedetail it always worked before... but I get no
errors it just hangs so not sure what to check and how to solve this issue
"Uri Dimant" wrote:

> Sammy
> Do you have a WHERE clause in your DELETE statement?
>
> Actually , DELETE and TRUNCATE commands are 'slightly' different in terms
> how they do the job
> DELETE command is fully logged (every row was deleted is recorded in TL) ,
> as opposed TRUNCATE command which
> logs only the deallocation of whole data pages
> "Sammy" <Sammy@.discussions.microsoft.com> wrote in message
> news:1B557178-E1BA-4D16-B4E8-2B9519856649@.microsoft.com...
>
>|||So , do you have WHERE clause or you don't?
It is possible that blocks are occured because if you don't have an index on
the column in WHERE clause , SQL Server may lock entire table.
How many rows do you trying to delete?
"Sammy" <Sammy@.discussions.microsoft.com> wrote in message
news:6B563C5B-9D6E-44E5-AA43-404DA791730B@.microsoft.com...
> Hi Uri,
> No its just delete quotedetail it always worked before... but I get no
> errors it just hangs so not sure what to check and how to solve this issue
> "Uri Dimant" wrote:
>|||Here's a couple of things to check...
1. Is there another connection which has a lock on the table?
2. Is there a delete trigger on the table? This would be executing and the
problem could be there.
Regards
Colin Dawson
www.cjdawson.com
"Sammy" <Sammy@.discussions.microsoft.com> wrote in message
news:6B563C5B-9D6E-44E5-AA43-404DA791730B@.microsoft.com...
> Hi Uri,
> No its just delete quotedetail it always worked before... but I get no
> errors it just hangs so not sure what to check and how to solve this issue
> "Uri Dimant" wrote:
>|||Sammy (Sammy@.discussions.microsoft.com) writes:
> I have a 43,000 row table but can no longer delete the data from it all
> of a sudden..it just hangs on the process and the processor shoots up to
> 100%. But I have tried truncating this and it works, I know deleting
> logs every row deleted but am not sure why I am getting this problem or
> what to monitor to solve it.
> Any help or advice would be great thanks
Let's first rule out a few things it can't be:
o Blocking. Had it been a blocking issue, your processor would stay calm.
o Referencing foreign key. A delete operation can take a very long time
if there are referencing foreign keys that are not indexed, or if there
cascading deletes/updates. However, had there been referencing FKs,
SQL Server would not permit you to run TRUNCATE TABLE.
That leaves two options:
o There is a trigger on the table, and the trigger performs something
wild. TRUNCATE TABLE does not fire triggers, so it could not cause
this problem.
o The log file (or the data file) is full, and needs to autogrow. If the
the database is large, and you have the default 10% autogrow, this can
give quite an impact. As TRUNCATE TABLE just logs the extent
deallocations, it causes far less load.
Thus you should examine if you have triggers on the table, and run
and run DBCC SQLPERF ( LOGSPACE ) to determine how log space you have
in use.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||No triggers or other processes accessing the table, its a 44,000 row table
and delete quotedetail (no where clause in the delete command) does not work
but truncate table quotedetail works with no problems.
Have u any other ideas how to reslove this as I am stumped?
"Colin Dawson" wrote:

> Here's a couple of things to check...
>
> 1. Is there another connection which has a lock on the table?
> 2. Is there a delete trigger on the table? This would be executing and th
e
> problem could be there.
>
> --
> Regards
> Colin Dawson
> www.cjdawson.com
>
> "Sammy" <Sammy@.discussions.microsoft.com> wrote in message
> news:6B563C5B-9D6E-44E5-AA43-404DA791730B@.microsoft.com...
>
>|||Hi Erland I discovered it was part of a snapshot replication, I did not thin
k
it was part of replication as I could truncate the table but I guess its onl
y
merge and transactional replication that does not allow you to truncate the
tables. But I don't think this should affect my problem.
My processor queue length goes up to 25 when the delete command is run and
I think my processor might be having problems now and may need to be replace
d
to solve this issue.
"Erland Sommarskog" wrote:

> Sammy (Sammy@.discussions.microsoft.com) writes:
> Let's first rule out a few things it can't be:
> o Blocking. Had it been a blocking issue, your processor would stay calm.
> o Referencing foreign key. A delete operation can take a very long time
> if there are referencing foreign keys that are not indexed, or if there
> cascading deletes/updates. However, had there been referencing FKs,
> SQL Server would not permit you to run TRUNCATE TABLE.
> That leaves two options:
> o There is a trigger on the table, and the trigger performs something
> wild. TRUNCATE TABLE does not fire triggers, so it could not cause
> this problem.
> o The log file (or the data file) is full, and needs to autogrow. If the
> the database is large, and you have the default 10% autogrow, this can
> give quite an impact. As TRUNCATE TABLE just logs the extent
> deallocations, it causes far less load.
> Thus you should examine if you have triggers on the table, and run
> and run DBCC SQLPERF ( LOGSPACE ) to determine how log space you have
> in use.
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx
>|||Sammy (Sammy@.discussions.microsoft.com) writes:
> Hi Erland I discovered it was part of a snapshot replication, I did not
> think it was part of replication as I could truncate the table but I
> guess its only merge and transactional replication that does not allow
> you to truncate the tables. But I don't think this should affect my
> problem. My processor queue length goes up to 25 when the delete command
> is run and I think my processor might be having problems now and may
> need to be replaced to solve this issue.
Ah, so replication set in? That was interesting to hear, as I'm not
doing much replication myself. Good to know, the next time someone
else asks a similar question.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||See some details/background data on "Live-Lock" vs. "Dead-Lock" in SQL
Server:
http://www.dbforums.com/showthread...099#post4505099
It also gives some coverage on data accessibility in SQL Server.
You can download as a FREE-WARE SQL Server package that detects
Live-lock situations on SQL Server (and notifies production DBA, if
configured).
(SQL Server Live_Lock_Monitor).
It also continuously monitors/logs SQL Server Response time (and
notifies DBA if very slow response detected).
Note: SQL Server can "Freese" when it:
1) Automatically "Expands" any database (DB options set to "Autogrow"-
NOT recommended in production)
2) When programmer misses the join (cross product or Cartesian product)
3) when a number of processes are lined up to access some resource
(e.g. table, being heavily updated)
4) table scans against large tables done
5) a table is locked (reindexation, DBCC operation etc)
6) a lot of data is being "pumped" to the client side (i.e. programmer
writes:
SELECT * from Users (against tables with millions of rows)
and in a lot of other scenarios.
Most of them (not all) should be detected by the package (since actual
response time is measured).
Alexei Akimov

Monday, March 19, 2012

Can the Output parameter length be more than 8000 characters?

Hi!
I am running one SP - which needs to return strings, seperated by
delimitter. I am using output parameter of type Varchar (8000). I learned
that this is maximum length allowed.
Now what problem I am facing is, for a particular field, the delimitted text
is getting higher than 8000 characters and that is why the rest of the value
is getting truncated.
Can you guys let me know any better way of achieving this?
I will be extremely thankful to you.
Regards,
SachinYou'll have to select the data instead of using an output param... Or
upgrade to SQL Server 2005 and use VARCHAR(MAX) instead :)
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Sachin Vaishnav" <SachinVaishnav@.discussions.microsoft.com> wrote in
message news:880D2034-115A-4E86-9D38-97BD909BF564@.microsoft.com...
> Hi!
> I am running one SP - which needs to return strings, seperated by
> delimitter. I am using output parameter of type Varchar (8000). I learned
> that this is maximum length allowed.
> Now what problem I am facing is, for a particular field, the delimitted
> text
> is getting higher than 8000 characters and that is why the rest of the
> value
> is getting truncated.
> Can you guys let me know any better way of achieving this?
> I will be extremely thankful to you.
> Regards,
> Sachin|||Instead of Varchar(8000) ... how about using TEXT or NText as your datatype?
Best Regards
Vadivel
http://vadivel.blogspot.com
http://thinkingms.com/vadivel
"Sachin Vaishnav" wrote:

> Hi!
> I am running one SP - which needs to return strings, seperated by
> delimitter. I am using output parameter of type Varchar (8000). I learned
> that this is maximum length allowed.
> Now what problem I am facing is, for a particular field, the delimitted te
xt
> is getting higher than 8000 characters and that is why the rest of the val
ue
> is getting truncated.
> Can you guys let me know any better way of achieving this?
> I will be extremely thankful to you.
> Regards,
> Sachin|||Thanks. Using 2005 is not possible for me now. I will have to manage fromw
what I have already :)
Anyways, as per your other suggestion, the problem in that is, I am already
having one select returned out of the SP. So, there is no point in that also
.
Can some cursor type of output or XML type of output is useful to me?
I need to send it back to the API and the API is used by UI.
Help me,
Sachin
"Adam Machanic" wrote:

> You'll have to select the data instead of using an output param... Or
> upgrade to SQL Server 2005 and use VARCHAR(MAX) instead :)
>
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>
> "Sachin Vaishnav" <SachinVaishnav@.discussions.microsoft.com> wrote in
> message news:880D2034-115A-4E86-9D38-97BD909BF564@.microsoft.com...
>
>|||Stored procedures can return multiple rowsets... Why not use two?
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Sachin Vaishnav" <SachinVaishnav@.discussions.microsoft.com> wrote in
message news:DB3F424E-01C2-49DB-B7B7-99D22F91CD24@.microsoft.com...
> Thanks. Using 2005 is not possible for me now. I will have to manage fromw
> what I have already :)
> Anyways, as per your other suggestion, the problem in that is, I am
> already
> having one select returned out of the SP. So, there is no point in that
> also.
> Can some cursor type of output or XML type of output is useful to me?
> I need to send it back to the API and the API is used by UI.
> Help me,
> Sachin
> "Adam Machanic" wrote:
>|||"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:Ogxg9Nr7FHA.1416@.TK2MSFTNGP09.phx.gbl...
> Stored procedures can return multiple rowsets... Why not use two?
...or use multiple Output parameters.
When one reaches the 8000 character limit, insert the rest in the 2nd.
But I'd prefer Adam's solution, 2 recordsets.|||Hi!
Thanks a lot. Is it possible to have 2 RS from SP? Well, I was unable to get
once. Can I have some example of the same?
Thanks
Sachin
"Adam Machanic" wrote:

> Stored procedures can return multiple rowsets... Why not use two?
>
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>
> "Sachin Vaishnav" <SachinVaishnav@.discussions.microsoft.com> wrote in
> message news:DB3F424E-01C2-49DB-B7B7-99D22F91CD24@.microsoft.com...
>
>|||Sure...
CREATE PROCEDURE TWO_RESULT_SETS
AS
BEGIN
SELECT 1
SELECT 2
END
GO
EXEC TWO_RESULT_SETS
GO
DROP PROCEDURE TWO_RESULT_SETS
GO
--
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Sachin Vaishnav" <SachinVaishnav@.discussions.microsoft.com> wrote in
message news:FD089362-31C1-49B2-83B0-88ED1F9FD5FC@.microsoft.com...
> Hi!
> Thanks a lot. Is it possible to have 2 RS from SP? Well, I was unable to
> get
> once. Can I have some example of the same?
> Thanks
> Sachin
> "Adam Machanic" wrote:
>|||Thanks a lotl!
However, I know this. But i guess, the problem is perhaps, when I write 2
selects in the SP, if I am using ADODB.Recordset to retrieve the data, I
won't get the result of both the record set. Right?
So, can you suggest me how do I tackle that one? :)
Thanks again!
Regards,
Sachin
"Adam Machanic" wrote:

> Sure...
> --
> CREATE PROCEDURE TWO_RESULT_SETS
> AS
> BEGIN
> SELECT 1
> SELECT 2
> END
> GO
> EXEC TWO_RESULT_SETS
> GO
> DROP PROCEDURE TWO_RESULT_SETS
> GO
> --
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>
> "Sachin Vaishnav" <SachinVaishnav@.discussions.microsoft.com> wrote in
> message news:FD089362-31C1-49B2-83B0-88ED1F9FD5FC@.microsoft.com...
>
>|||Set rsSecond = rsFirst.NextRecordset()
cheers,
</wqw>

Friday, February 24, 2012

can somebody help my optimise my code please

Hi

I have the following SQL, which I am using to query our mainframe (some kind of IBM DB2 type thing)
Basically there are two tables joined by account number. One contains info about the customer, and the other contains details about transactions that have happened for each month. I am trying to get the total spend for last month and the month before. (I know I am not using anything from the CUS_ACC table at the mo, but I will need to)

SELECT PROD.CUST_ACC_NUM, Sum(SPEND) AS SUMSPEND, STMT_MONTH, STMT_YEAR
FROM PROD INNER JOIN CUST_ACC ON PROD.CUST_ACC_NUM=CUST_ACC.CUST_ACC_NUM

WHERE PROD.CUST_ACC_NUM=630822
And
(
(STMT_MONTH=Month(DateAdd("m",-1,Date())) And STMT_YEAR=Year(DateAdd("m",-1,Date())))
Or
(STMT_MONTH=Month(DateAdd("m",-2,Date())) And STMT_YEAR=Year(DateAdd("m",-2,Date())))
)
GROUP BY PROD.CUST_ACC_NUM, STMT_MONTH, STMT_YEAR;

now, as the query is at the moment, it takes tens of minutes to run for a single account (I will have to do it for about 3,000 accounts). However, if remove the line that starts with 'OR' and the line below it (i.e. only get last months sales) it runs in seconds.

Any ideas why?
Thanks
Kevinforget it, its working at full speed. hmmmmmm, very very strange

Sunday, February 19, 2012

can send email using dbmail

Hi

I can't send email using sp_send_dbmail stored proc

when I execute this stored proc in msdb I face no error but executing it in other databases raises an error saying this stored proc does not exist.

when I executed this query

select * from sys.transmission_queue

I recived no result set.

please tell me what to do.

thanks

pooyan.

yes,

sp_send_dbmail should be run in msdb

Sunday, February 12, 2012

Can not save relationship

Hi
I am using Sqlserver 2005 and in management I created some relations.
One of them fale with the below error.
I have tried to look for unmatched data and dublicates etc, but still keep
gettitng this error message.
What do you recommend me to do?
Thank you in advance
- Unable to create relationship 'FK_Transaktionsrader_Transaktionhuvud'.
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint
"FK_Transaktionsrader_Transaktionhuvud".
The conflict occurred in database "MbaseMuseumServerNetSQL", table
"dbo.Transaktionhuvud", column 'TransaktionhuvudTransaktionsnr'.
It would help us better assist you if you could include table DDL for both
tables; without it, we cannot help you. (For help with that refer to:
http://www.aspfaq.com/5006 and to
http://classicasp.aspfaq.com/general...-answered.html )
The less 'set up' work we have to do, the more likely you are going to have
folks tackle your problem and help you. Without this effort from you, we are
just playing guessing games.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Mattias" <Mattias@.discussions.microsoft.com> wrote in message
news:3EAD7DFC-C005-4415-A17F-5FD29EF8D4A2@.microsoft.com...
> Hi
> I am using Sqlserver 2005 and in management I created some relations.
> One of them fale with the below error.
> I have tried to look for unmatched data and dublicates etc, but still keep
> gettitng this error message.
> What do you recommend me to do?
> Thank you in advance
> - Unable to create relationship 'FK_Transaktionsrader_Transaktionhuvud'.
> The ALTER TABLE statement conflicted with the FOREIGN KEY constraint
> "FK_Transaktionsrader_Transaktionhuvud".
> The conflict occurred in database "MbaseMuseumServerNetSQL", table
> "dbo.Transaktionhuvud", column 'TransaktionhuvudTransaktionsnr'.
|||Hi and thanks for your reply.
I have the DDL for both tables ready here.
Can it be attached to the post or shall I send it separatly somewhere?
I tried to use sql code you recommend to generate inserts, sample data but I
receive the error below
"Could not find stored procedure sp_generate_inserts'." What do you
recommend me to do?
Mattias
"Arnie Rowland" wrote:

> It would help us better assist you if you could include table DDL for both
> tables; without it, we cannot help you. (For help with that refer to:
> http://www.aspfaq.com/5006 and to
> http://classicasp.aspfaq.com/general...-answered.html )
>
> The less 'set up' work we have to do, the more likely you are going to have
> folks tackle your problem and help you. Without this effort from you, we are
> just playing guessing games.
>
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
> "Mattias" <Mattias@.discussions.microsoft.com> wrote in message
> news:3EAD7DFC-C005-4415-A17F-5FD29EF8D4A2@.microsoft.com...
>
>
|||Please include (copy and paste) the DDL in a post.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Mattias" <Mattias@.discussions.microsoft.com> wrote in message
news:14FF1450-A7AB-4D25-BE5C-4D75B50845F7@.microsoft.com...[vbcol=seagreen]
> Hi and thanks for your reply.
> I have the DDL for both tables ready here.
> Can it be attached to the post or shall I send it separatly somewhere?
> I tried to use sql code you recommend to generate inserts, sample data but
> I
> receive the error below
> "Could not find stored procedure sp_generate_inserts'." What do you
> recommend me to do?
> Mattias
>
> "Arnie Rowland" wrote:
|||Ok here it comes!
Mattias
USE [MbaseMuseumServerNetSQL]
GO
/****** Objekt: Table [dbo].[Transaktionhuvud] Skriptdatum: 10/09/2006
16:13:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Transaktionhuvud](
[TransaktionhuvudTransaktionsnr] [int] IDENTITY(1,1) NOT NULL,
[Transaktionskategorinummer] [int] NULL,
[TransaktionhuvudTransaktionhuvudKontaktnr] [int] NULL,
[ForetagsregisterGRUNDNR] [int] NULL,
[TransaktionhuvudTransaktionhuvudAnstalldHandlagge snr] [int] NULL,
[TransaktionhuvudTransaktionhuvudAnstalldFramtages nr] [int] NULL,
[TransaktionhuvudTransaktionhuvudAnstalldAvsynasnr ] [int] NULL,
[TransaktionhuvudTransaktionhuvudAnstalldPackas nr] [int] NULL,
[TransaktionhuvudTransaktionhuvudAnstalldKurirn r] [int] NULL,
[UtskriftsstatusSTATUSNR] [int] NULL,
[BetalningsStatusSTATUSNR] [int] NULL,
[TransaktionhuvudRegistreringsdatum] [datetime] NULL,
[DatumPreliminarRetur] [datetime] NULL,
[UtstallningStartdatum] [datetime] NULL,
[UtstallningSlutdatum] [datetime] NULL,
[Utstallning] [nvarchar](70) COLLATE Finnish_Swedish_CI_AS NULL,
[TransaktionhuvudTransaktionhuvudKontaktTransporto rAvhamtningnr] [int] NULL,
[TransaktionhuvudTransaktionhuvudKontaktTransporto rReturnr] [int] NULL,
[TransaktionhuvudTransaktionhuvudTransportsattAvha mtningnr] [int] NULL,
[TransaktionhuvudTransaktionhuvudTransportsattRetu rnr] [int] NULL,
[TransaktionhuvudDefinitivRetur] [bit] NULL,
[TransaktionhuvudDatumDefinitivRetur] [datetime] NULL,
[TransaktionhuvudAnmarkningar] [nvarchar](max) COLLATE
Finnish_Swedish_CI_AS NULL,
PRIMARY KEY CLUSTERED
(
[TransaktionhuvudTransaktionsnr] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
[ITransaktionhuvud] FOREIGN
KEY([TransaktionhuvudTransaktionhuvudKontaktTransp ortorAvhamtningnr])
REFERENCES [dbo].[Kontakter] ([Kontaktnummer])
GO
ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud]
GO
ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
[ITransaktionhuvud1] FOREIGN
KEY([TransaktionhuvudTransaktionhuvudKontaktTransp ortorReturnr])
REFERENCES [dbo].[Kontakter] ([Kontaktnummer])
GO
ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud1]
GO
ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
[ITransaktionhuvud10] FOREIGN
KEY([TransaktionhuvudTransaktionhuvudAnstalldAvsyn asnr])
REFERENCES [dbo].[Anstallda] ([AnstalldaAnstalldnr])
GO
ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud10]
GO
ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
[ITransaktionhuvud11] FOREIGN
KEY([TransaktionhuvudTransaktionhuvudAnstalldPacka snr])
REFERENCES [dbo].[Anstallda] ([AnstalldaAnstalldnr])
GO
ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud11]
GO
ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
[ITransaktionhuvud12] FOREIGN
KEY([TransaktionhuvudTransaktionhuvudAnstalldKurir nr])
REFERENCES [dbo].[Anstallda] ([AnstalldaAnstalldnr])
GO
ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud12]
GO
ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
[ITransaktionhuvud13] FOREIGN KEY([TransaktionhuvudTransaktionhuvudKontaktnr])
REFERENCES [dbo].[Kontakter] ([Kontaktnummer])
GO
ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud13]
GO
ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
[ITransaktionhuvud2] FOREIGN KEY([BetalningsStatusSTATUSNR])
REFERENCES [dbo].[BetalningsStatus] ([BetalningsStatusSTATUSNR])
GO
ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud2]
GO
ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
[ITransaktionhuvud3] FOREIGN KEY([UtskriftsstatusSTATUSNR])
REFERENCES [dbo].[Utskriftsstatus] ([UtskriftsstatusSTATUSNR])
GO
ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud3]
GO
ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
[ITransaktionhuvud4] FOREIGN KEY([ForetagsregisterGRUNDNR])
REFERENCES [dbo].[Foretagsregister] ([ForetagsregisterGRUNDNR])
GO
ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud4]
GO
ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
[ITransaktionhuvud5] FOREIGN KEY([Transaktionskategorinummer])
REFERENCES [dbo].[Transaktionskategori] ([Transaktionskategorinummer])
GO
ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud5]
GO
ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
[ITransaktionhuvud6] FOREIGN
KEY([TransaktionhuvudTransaktionhuvudTransportsatt Avhamtningnr])
REFERENCES [dbo].[TRANSPORTSATT] ([TRANSPORTSATTNR])
GO
ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud6]
GO
ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
[ITransaktionhuvud7] FOREIGN
KEY([TransaktionhuvudTransaktionhuvudTransportsatt Returnr])
REFERENCES [dbo].[TRANSPORTSATT] ([TRANSPORTSATTNR])
GO
ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud7]
GO
ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
[ITransaktionhuvud8] FOREIGN
KEY([TransaktionhuvudTransaktionhuvudAnstalldHandl aggesnr])
REFERENCES [dbo].[Anstallda] ([AnstalldaAnstalldnr])
GO
ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud8]
GO
ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
[ITransaktionhuvud9] FOREIGN
KEY([TransaktionhuvudTransaktionhuvudAnstalldFramt agesnr])
REFERENCES [dbo].[Anstallda] ([AnstalldaAnstalldnr])
GO
ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud9]
USE [MbaseMuseumServerNetSQL]
GO
/****** Objekt: Table [dbo].[Transaktionsrader] Skriptdatum: 10/09/2006
16:17:38 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Transaktionsrader](
[TransaktionsraderTransaktionsraderTransaktionsrad ] [int] IDENTITY(1,1) NOT
NULL,
[TransaktionsraderTransaktionsnr] [int] NULL,
[TransaktionsraderTransaktionsraderAvgiftsnr] [int] NULL,
[TransaktionsraderTransaktionsraderAvgiftsnr2] [int] NULL,
[TransaktionsraderTransaktionsraderAvgiftsnr3] [int] NULL,
[TransaktionsraderTransaktionsraderAvgiftsnr4] [int] NULL,
[TransaktionsraderTransaktionsraderEmballagenr] [int] NULL,
[Artikelnummer] [int] NULL,
[Bildnr] [int] NULL,
[TransaktionsraderForetagsnr] [int] NULL,
[TransaktionsraderAntal] [int] NULL,
[ExaktPlacering] [nvarchar](200) COLLATE Finnish_Swedish_CI_AS NULL,
[TillfalligRetur] [bit] NOT NULL,
[DatumTillfalligRetur] [datetime] NULL,
[TransaktionsraderForsakringsvarde] [decimal](17, 6) NULL,
[TransaktionsraderDefinitivRetur] [bit] NOT NULL,
[TransaktionsraderDatumDefinitivRetur] [datetime] NULL,
[AterDeposition] [bit] NOT NULL,
[DatumHamtningUtlamning] [datetime] NOT NULL,
[Undervisningstypnr] [int] NULL,
[DatumVisningStart] [datetime] NULL,
[TidVisningStart] [datetime] NULL,
[DatumVisningSlut] [datetime] NULL,
[TidVisningSlut] [datetime] NULL,
[Amne] [nvarchar](50) COLLATE Finnish_Swedish_CI_AS NULL,
[AntalLektioner] [nvarchar](50) COLLATE Finnish_Swedish_CI_AS NULL,
[AntalPersoner] [nvarchar](50) COLLATE Finnish_Swedish_CI_AS NULL,
[VisningInstalld] [bit] NULL,
[DatumVisningInstalld] [datetime] NULL,
[VisningUtford] [bit] NULL,
[transkontaktnr] [int] NULL,
[TransraderAnstalldGuideAnstalldnr] [int] NULL,
[accessionsnummer] [nvarchar](20) COLLATE Finnish_Swedish_CI_AS NULL,
PRIMARY KEY CLUSTERED
(
[TransaktionsraderTransaktionsraderTransaktionsrad ] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
[FK_Transaktionsrader_Master] FOREIGN KEY([accessionsnummer])
REFERENCES [dbo].[Master] ([MasterAccessionsnr])
GO
ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT
[FK_Transaktionsrader_Master]
GO
ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
[ITransaktionsrader] FOREIGN KEY([Artikelnummer])
REFERENCES [dbo].[Artiklar] ([Artikelnummer])
GO
ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader]
GO
ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
[ITransaktionsrader10] FOREIGN KEY([transkontaktnr])
REFERENCES [dbo].[Kontakter] ([Kontaktnummer])
GO
ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader10]
GO
ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
[ITransaktionsrader2] FOREIGN
KEY([TransaktionsraderTransaktionsraderEmballagenr ])
REFERENCES [dbo].[Emballage] ([Emballagenr])
GO
ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader2]
GO
ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
[ITransaktionsrader3] FOREIGN
KEY([TransaktionsraderTransaktionsraderAvgiftsnr])
REFERENCES [dbo].[Avgifter] ([Avgiftsnr])
GO
ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader3]
GO
ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
[ITransaktionsrader4] FOREIGN
KEY([TransaktionsraderTransaktionsraderAvgiftsnr2])
REFERENCES [dbo].[Avgifter] ([Avgiftsnr])
GO
ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader4]
GO
ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
[ITransaktionsrader5] FOREIGN
KEY([TransaktionsraderTransaktionsraderAvgiftsnr3])
REFERENCES [dbo].[Avgifter] ([Avgiftsnr])
GO
ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader5]
GO
ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
[ITransaktionsrader6] FOREIGN
KEY([TransaktionsraderTransaktionsraderAvgiftsnr4])
REFERENCES [dbo].[Avgifter] ([Avgiftsnr])
GO
ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader6]
GO
ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
[ITransaktionsrader7] FOREIGN KEY([Undervisningstypnr])
REFERENCES [dbo].[UNDERVISNINGSTYP] ([Undervisningstypnr])
GO
ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader7]
GO
ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
[ITransaktionsrader8] FOREIGN KEY([Bildnr])
REFERENCES [dbo].[Bilder] ([Bildnr])
GO
ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader8]
GO
ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
[ITransaktionsrader9] FOREIGN KEY([TransraderAnstalldGuideAnstalldnr])
REFERENCES [dbo].[Anstallda] ([AnstalldaAnstalldnr])
GO
ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader9]
"Arnie Rowland" wrote:

> Please include (copy and paste) the DDL in a post.
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
> "Mattias" <Mattias@.discussions.microsoft.com> wrote in message
> news:14FF1450-A7AB-4D25-BE5C-4D75B50845F7@.microsoft.com...
>
>
|||Mattias,
Try this. Use your script and create the two tables on
another test server or some test database.
Then run the script to create the relationship you are
having problems creating - or use Management Studio if
that's how you were doing it.
If you can create the relationship and don't get an error
then that tells you it's likely related to the data in the
two tables violating the constraint. If you can't create the
relationship from Management Studio, hit the script button
(hopefully there is one in the GUI end...don't use that much
so I don't remember) and try just executing the script. If
you still get an error using the script and with no data,
then post the script here.
-Sue
On Mon, 9 Oct 2006 07:20:02 -0700, Mattias
<Mattias@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Ok here it comes!
>Mattias
>USE [MbaseMuseumServerNetSQL]
>GO
>/****** Objekt: Table [dbo].[Transaktionhuvud] Skriptdatum: 10/09/2006
>16:13:57 ******/
>SET ANSI_NULLS ON
>GO
>SET QUOTED_IDENTIFIER ON
>GO
>CREATE TABLE [dbo].[Transaktionhuvud](
>[TransaktionhuvudTransaktionsnr] [int] IDENTITY(1,1) NOT NULL,
>[Transaktionskategorinummer] [int] NULL,
>[TransaktionhuvudTransaktionhuvudKontaktnr] [int] NULL,
>[ForetagsregisterGRUNDNR] [int] NULL,
>[TransaktionhuvudTransaktionhuvudAnstalldHandlagge snr] [int] NULL,
>[TransaktionhuvudTransaktionhuvudAnstalldFramtages nr] [int] NULL,
>[TransaktionhuvudTransaktionhuvudAnstalldAvsynasnr ] [int] NULL,
>[TransaktionhuvudTransaktionhuvudAnstalldPackas nr] [int] NULL,
>[TransaktionhuvudTransaktionhuvudAnstalldKurirn r] [int] NULL,
>[UtskriftsstatusSTATUSNR] [int] NULL,
>[BetalningsStatusSTATUSNR] [int] NULL,
>[TransaktionhuvudRegistreringsdatum] [datetime] NULL,
>[DatumPreliminarRetur] [datetime] NULL,
>[UtstallningStartdatum] [datetime] NULL,
>[UtstallningSlutdatum] [datetime] NULL,
>[Utstallning] [nvarchar](70) COLLATE Finnish_Swedish_CI_AS NULL,
>[TransaktionhuvudTransaktionhuvudKontaktTransporto rAvhamtningnr] [int] NULL,
>[TransaktionhuvudTransaktionhuvudKontaktTransporto rReturnr] [int] NULL,
>[TransaktionhuvudTransaktionhuvudTransportsattAvha mtningnr] [int] NULL,
>[TransaktionhuvudTransaktionhuvudTransportsattRetu rnr] [int] NULL,
>[TransaktionhuvudDefinitivRetur] [bit] NULL,
>[TransaktionhuvudDatumDefinitivRetur] [datetime] NULL,
>[TransaktionhuvudAnmarkningar] [nvarchar](max) COLLATE
>Finnish_Swedish_CI_AS NULL,
>PRIMARY KEY CLUSTERED
>(
>[TransaktionhuvudTransaktionsnr] ASC
>)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
>) ON [PRIMARY]
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
>[ITransaktionhuvud] FOREIGN
>KEY([TransaktionhuvudTransaktionhuvudKontaktTrans portorAvhamtningnr])
>REFERENCES [dbo].[Kontakter] ([Kontaktnummer])
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud]
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
>[ITransaktionhuvud1] FOREIGN
>KEY([TransaktionhuvudTransaktionhuvudKontaktTrans portorReturnr])
>REFERENCES [dbo].[Kontakter] ([Kontaktnummer])
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud1]
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
>[ITransaktionhuvud10] FOREIGN
>KEY([TransaktionhuvudTransaktionhuvudAnstalldAvsy nasnr])
>REFERENCES [dbo].[Anstallda] ([AnstalldaAnstalldnr])
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud10]
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
>[ITransaktionhuvud11] FOREIGN
>KEY([TransaktionhuvudTransaktionhuvudAnstalldPack asnr])
>REFERENCES [dbo].[Anstallda] ([AnstalldaAnstalldnr])
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud11]
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
>[ITransaktionhuvud12] FOREIGN
>KEY([TransaktionhuvudTransaktionhuvudAnstalldKuri rnr])
>REFERENCES [dbo].[Anstallda] ([AnstalldaAnstalldnr])
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud12]
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
>[ITransaktionhuvud13] FOREIGN KEY([TransaktionhuvudTransaktionhuvudKontaktnr])
>REFERENCES [dbo].[Kontakter] ([Kontaktnummer])
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud13]
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
>[ITransaktionhuvud2] FOREIGN KEY([BetalningsStatusSTATUSNR])
>REFERENCES [dbo].[BetalningsStatus] ([BetalningsStatusSTATUSNR])
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud2]
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
>[ITransaktionhuvud3] FOREIGN KEY([UtskriftsstatusSTATUSNR])
>REFERENCES [dbo].[Utskriftsstatus] ([UtskriftsstatusSTATUSNR])
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud3]
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
>[ITransaktionhuvud4] FOREIGN KEY([ForetagsregisterGRUNDNR])
>REFERENCES [dbo].[Foretagsregister] ([ForetagsregisterGRUNDNR])
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud4]
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
>[ITransaktionhuvud5] FOREIGN KEY([Transaktionskategorinummer])
>REFERENCES [dbo].[Transaktionskategori] ([Transaktionskategorinummer])
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud5]
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
>[ITransaktionhuvud6] FOREIGN
>KEY([TransaktionhuvudTransaktionhuvudTransportsat tAvhamtningnr])
>REFERENCES [dbo].[TRANSPORTSATT] ([TRANSPORTSATTNR])
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud6]
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
>[ITransaktionhuvud7] FOREIGN
>KEY([TransaktionhuvudTransaktionhuvudTransportsat tReturnr])
>REFERENCES [dbo].[TRANSPORTSATT] ([TRANSPORTSATTNR])
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud7]
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
>[ITransaktionhuvud8] FOREIGN
>KEY([TransaktionhuvudTransaktionhuvudAnstalldHand laggesnr])
>REFERENCES [dbo].[Anstallda] ([AnstalldaAnstalldnr])
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud8]
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] WITH CHECK ADD CONSTRAINT
>[ITransaktionhuvud9] FOREIGN
>KEY([TransaktionhuvudTransaktionhuvudAnstalldFram tagesnr])
>REFERENCES [dbo].[Anstallda] ([AnstalldaAnstalldnr])
>GO
>ALTER TABLE [dbo].[Transaktionhuvud] CHECK CONSTRAINT [ITransaktionhuvud9]
>
>USE [MbaseMuseumServerNetSQL]
>GO
>/****** Objekt: Table [dbo].[Transaktionsrader] Skriptdatum: 10/09/2006
>16:17:38 ******/
>SET ANSI_NULLS ON
>GO
>SET QUOTED_IDENTIFIER ON
>GO
>CREATE TABLE [dbo].[Transaktionsrader](
>[TransaktionsraderTransaktionsraderTransaktionsrad ] [int] IDENTITY(1,1) NOT
>NULL,
>[TransaktionsraderTransaktionsnr] [int] NULL,
>[TransaktionsraderTransaktionsraderAvgiftsnr] [int] NULL,
>[TransaktionsraderTransaktionsraderAvgiftsnr2] [int] NULL,
>[TransaktionsraderTransaktionsraderAvgiftsnr3] [int] NULL,
>[TransaktionsraderTransaktionsraderAvgiftsnr4] [int] NULL,
>[TransaktionsraderTransaktionsraderEmballagenr] [int] NULL,
>[Artikelnummer] [int] NULL,
>[Bildnr] [int] NULL,
>[TransaktionsraderForetagsnr] [int] NULL,
>[TransaktionsraderAntal] [int] NULL,
>[ExaktPlacering] [nvarchar](200) COLLATE Finnish_Swedish_CI_AS NULL,
>[TillfalligRetur] [bit] NOT NULL,
>[DatumTillfalligRetur] [datetime] NULL,
>[TransaktionsraderForsakringsvarde] [decimal](17, 6) NULL,
>[TransaktionsraderDefinitivRetur] [bit] NOT NULL,
>[TransaktionsraderDatumDefinitivRetur] [datetime] NULL,
>[AterDeposition] [bit] NOT NULL,
>[DatumHamtningUtlamning] [datetime] NOT NULL,
>[Undervisningstypnr] [int] NULL,
>[DatumVisningStart] [datetime] NULL,
>[TidVisningStart] [datetime] NULL,
>[DatumVisningSlut] [datetime] NULL,
>[TidVisningSlut] [datetime] NULL,
>[Amne] [nvarchar](50) COLLATE Finnish_Swedish_CI_AS NULL,
>[AntalLektioner] [nvarchar](50) COLLATE Finnish_Swedish_CI_AS NULL,
>[AntalPersoner] [nvarchar](50) COLLATE Finnish_Swedish_CI_AS NULL,
>[VisningInstalld] [bit] NULL,
>[DatumVisningInstalld] [datetime] NULL,
>[VisningUtford] [bit] NULL,
>[transkontaktnr] [int] NULL,
>[TransraderAnstalldGuideAnstalldnr] [int] NULL,
>[accessionsnummer] [nvarchar](20) COLLATE Finnish_Swedish_CI_AS NULL,
>PRIMARY KEY CLUSTERED
>(
>[TransaktionsraderTransaktionsraderTransaktionsrad ] ASC
>)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
>) ON [PRIMARY]
>GO
>ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
>[FK_Transaktionsrader_Master] FOREIGN KEY([accessionsnummer])
>REFERENCES [dbo].[Master] ([MasterAccessionsnr])
>GO
>ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT
>[FK_Transaktionsrader_Master]
>GO
>ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
>[ITransaktionsrader] FOREIGN KEY([Artikelnummer])
>REFERENCES [dbo].[Artiklar] ([Artikelnummer])
>GO
>ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader]
>GO
>ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
>[ITransaktionsrader10] FOREIGN KEY([transkontaktnr])
>REFERENCES [dbo].[Kontakter] ([Kontaktnummer])
>GO
>ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader10]
>GO
>ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
>[ITransaktionsrader2] FOREIGN
>KEY([TransaktionsraderTransaktionsraderEmballagen r])
>REFERENCES [dbo].[Emballage] ([Emballagenr])
>GO
>ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader2]
>GO
>ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
>[ITransaktionsrader3] FOREIGN
>KEY([TransaktionsraderTransaktionsraderAvgiftsn r])
>REFERENCES [dbo].[Avgifter] ([Avgiftsnr])
>GO
>ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader3]
>GO
>ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
>[ITransaktionsrader4] FOREIGN
>KEY([TransaktionsraderTransaktionsraderAvgiftsnr2 ])
>REFERENCES [dbo].[Avgifter] ([Avgiftsnr])
>GO
>ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader4]
>GO
>ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
>[ITransaktionsrader5] FOREIGN
>KEY([TransaktionsraderTransaktionsraderAvgiftsnr3 ])
>REFERENCES [dbo].[Avgifter] ([Avgiftsnr])
>GO
>ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader5]
>GO
>ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
>[ITransaktionsrader6] FOREIGN
>KEY([TransaktionsraderTransaktionsraderAvgiftsnr4 ])
>REFERENCES [dbo].[Avgifter] ([Avgiftsnr])
>GO
>ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader6]
>GO
>ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
>[ITransaktionsrader7] FOREIGN KEY([Undervisningstypnr])
>REFERENCES [dbo].[UNDERVISNINGSTYP] ([Undervisningstypnr])
>GO
>ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader7]
>GO
>ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
>[ITransaktionsrader8] FOREIGN KEY([Bildnr])
>REFERENCES [dbo].[Bilder] ([Bildnr])
>GO
>ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader8]
>GO
>ALTER TABLE [dbo].[Transaktionsrader] WITH CHECK ADD CONSTRAINT
>[ITransaktionsrader9] FOREIGN KEY([TransraderAnstalldGuideAnstalldnr])
>REFERENCES [dbo].[Anstallda] ([AnstalldaAnstalldnr])
>GO
>ALTER TABLE [dbo].[Transaktionsrader] CHECK CONSTRAINT [ITransaktionsrader9]
>"Arnie Rowland" wrote:

Friday, February 10, 2012

Can not open reports...

Hi

I have a problem about opening a report.Could you please help me?

Problem is, the report that I have developed is opening from my account but it does not work on user's machine.However users and we are on the same network ,reports and our db are on the same server ,but users are on the different domain,and we have not make authorization yet, there is no restriction.

Thanks all

M.B

Hi,

What error (if any) do the users get?

Almost certainly sounds like a security issue of some kind.

Regards,

Gary.

Can not open reports...

Hi

I have a problem about opening a report.Could you please help me?

Problem is, the report that I have developed is opening from my account but it does not work on user's machine.However users and we are on the same network ,reports and our db are on the same server ,but users are on the different domain,and we have not make authorization yet, there is no restriction.

Thanks all

M.B

Hi,

What error (if any) do the users get?

Almost certainly sounds like a security issue of some kind.

Regards,

Gary.