|
You can use dynamic SQL but I would not suggest that. Create the stored procedures. It is easy to use cut and past for creating all you need, and if one table changes you only change on procedure.
Another way would be to pass the table name into the procedure and have an IF ELSE IF structure within the procedure to update the tables.
|
|
|
|
|
I Think You Should Add One More Column To Your Main Table As Type
Now Your Table Structure Is (Code,Name,ID,Type)
Now In Type Column You Can Insert Feeling Or Zone.
And Now One One Insert Update And Delete Procedure Can Do The Same, As You Required.
-------------------------------------------------------------------
Another Approach
You Should Pass Table Name To Your Procedure And Create Dynamic Query.
To Execute That Dynamic Query Use SP_ExecuteSQL
Hope This Will Help You.......
|
|
|
|
|
I an not able to start the SQl Server Agent in SQL Server 2008. When i opened SQL Server configuration and found there is no option to start it.When i changed the property from network service to local service it throws error "The service cannot be started either because it is disabled or because it has no enable device associated to it."
Please somebody help me
modified 10-Aug-13 16:02pm.
|
|
|
|
|
This thread [^]turned up when I searched Google
I have the same setting on my local machine but I don't need Agent so have never enabled it!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello!
I will create a view on a Firebird database server by using the Execute Statement "ON EXTERNAL DATA SOURCE".
I found this document on firebirdfaq.org: http://www.firebirdfaq.org/faq16/
and also this: http://tech.groups.yahoo.com/group/firebird-support/message/114481
Unfortunately my SQL-skills are not good enough to solve this task by my selves.
I tried this:
SELECT * FROM(
FOR EXECUTE STATEMENT
'select code, name from TMaster where group = 'A' '
ON EXTERNAL DATA SOURCE '[IP Adrress]:\Data\DB\master.fdb' AS USER 'u' PASSWORD
'p' ROLE 'R'
into :code, :name do suspend ;)
Certainly that doesn't run.
Please can anybody give me some interesting advises?
I look forward to all suggestions!
Kind regards
Christoph
I'm a novice from Germany.
modified 10-Aug-13 14:45pm.
|
|
|
|
|
You are going from firebird to firebird right?
When you say it doesn't "run" what do you mean exactly?
|
|
|
|
|
Hi!
Thanks a lot for your reply!
You are going from firebird to firebird right?
Yes I do.
When you say it doesn't "run" what do you mean exactly?
It is not possible to compile my SQL example:
SELECT * FROM(
FOR EXECUTE STATEMENT
'select code, name from TMaster where group = 'A' '
ON EXTERNAL DATA SOURCE '[IP Adrress]:\Data\DB\master.fdb' AS USER 'u' PASSWORD
'p' ROLE 'R'
into :code, :name do suspend ;)
I got a SQL-Error in Line 2. If I try to compile without the select command I got the error in line 1.
I suppose my way to use the "FOR EXECUTE STATEMENT" is not correct. Or do I have problems with my Firebird version? (I don't know my current version at the moment, tomorrow)
I'm a novice from Germany.
|
|
|
|
|
My version is ok (2.5.2)
So my SQL must be incorrect. Is my example basicly possible?
I'm a novice from Germany.
|
|
|
|
|
My name is sanjay i had done bsc in computer science and also a course in oracle currently pursuing mca and wants to enter in database jobs. Can anyone suggest me.
Thanks,
Sanjay
|
|
|
|
|
This is a technical forum. You need to research your local area to find out what jobs are available. Try newspapers, recruitment agencies, friends etc.
Use the best guess
|
|
|
|
|
There are also web sites like Dice and Monster.
|
|
|
|
|
I know, but perhaps the OP does not.
Use the best guess
|
|
|
|
|
Just trying to expand on what you said. Debated on under yours or OP.
|
|
|
|
|
It can be difficult to get into the jobs market just based on a qualification so my advice when starting out is take a job that you will generally enjoy - if you make money a defining criterion for your first job you are probably going to find difficulty in getting a job.
Be prepared to work your way up - starting in a shop(which is what I did) is not necessarily a bad place if you keep your IT skills up to date and help out where you can in IT/database/programming.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Hi am new to SQL Server and i need to make a reporting
i have this thable e.g
Name RecieptNo
Charles 0001
Charles 0002
Charles 0003
Harry 0004
Harry 0005
The report need to look like this
Name RecieptNo
_____________________
Charles 0001
0002
0003
____________________
Harry 0004
0005
can any one help with the query for this one?
|
|
|
|
|
So do the formatting of the data in the report. DO NOT try and make the database do the UIs job.
The query into the database should get you all the data required in the report, it is then up to you to format the report the way you need it to look, this has nothing to do with the query.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
OLAP hung on Cube Full Process:
Building indexes for the <measure group="" name=""> partition has started.
Observation:
a. Cube Size - if my Date dimension contains only say 5 or 10 days of history, then this problem goes away. If I build the cube with say 25-35 days of history, then Cube Full Process hung on above statement (and CPU goes flat/zero afterwards)
b. When put Analysis Service on SQL Profiler,
Building indexes for the <Measure Group Name> partition has started. is the last statement captured on profiler but after which CPU goes flat and nothing seems to be happenning (no error/warning captured)
c. Even if server has more physical memory, Analysis Service does not take all the memory available (It's configured to use 80% of avail memory)[^]
Any idea? Thanks
dev
|
|
|
|
|
What OS is it, and how much memory do you have on the server?
Be excellent to each other. And... PARTY ON, DUDES!
Abraham Lincoln
|
|
|
|
|
What would be the best way to handle storing revisions of an assessment where a user may edit and save and then final finish the creation of an assessment. Here we would like to keep all revisions.
|
|
|
|
|
Use Word and turn on revisions... SMACK ouch
Add a RevisionID field to your table and manually increment it when the user checks out the version.
In your UI allow the user to "check out" a copy of the data (make another record in your table), allow the user to save the copy of the next revision and they are not allowed to check it out again until they either commit the revision or discard it.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi All,
I have a stored procedure that is inserting some values in Master and details table and I am getting the following error. Some times I am getting this error but some times I am not getting this error. When I am inserting detail table values I am checking everything if I am inserting any values that are not there in the Master table, but I am not getting any sign that I am inserting any values that are not there in Master table.
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Identifier_Entity". The conflict occurred in database "IdentityResolutionService", table "dbo.Entity", column 'EntityId'.
My scenario is: I have Entity table, Identifier table, Entity is the master table Identifier is the detail table. I am actually taking data from another table called Students to load all the students of a state, sid, dsid and ssn are the columns that are important from the students table. One sid may have multiple dsids depending upon year, school district etc, one ssn one sid. Now I have taken Rank on the SID to load all this data from Students table to Staging table. Now I have taken all the distinct SIDs and put it into Master table.
In the Identifier table when I am loading the SIDs, DSIDs and SSNs, I have taken the corresponding Rank value for that row, instead of creating one. I explained this only because there is no way that I can miss the Foreign key relationship. But one thing when I am loading the Entity values I am making it as Auto increment off, insert statement and then making it on because there is another application that is using the same table as auto increment on. But another thing is as the user doesn't have alter table permissions, I have created a Stored Proc which takes table name and insert statement as parameters so that I can make auto increment off and run the insert command in the parameter and makes auto increment on. After doing this I make auto increment on. This stored procedure runs under proxy user account.
Then I run insert into Identifier table, some how the insert into Identifier table is failing with the above error message. What could be the reason. Some time it works, some time doesnt. Is it because of dynamic sql or proxy user or the huge amount of data that is being processed because of all the students in a state, like around 4 or 5 million records am processing. In the Identifier table it is having more than 10 million records or am I doing any mistake. Because of its hugeness I am unable to debug the Stored Proc also very well the reason is it runs for an hour or something. All the time is going just in testing.
Is there any other reasons apart from unavailable values in master-detail tables for Foreign key constraint failure.
Please understand me and help me whatever you can, that would really great.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
indian143 wrote: I am loading the Entity values I am making it as Auto increment off,
I suspect this is the cause of the problem, I can't see any reason for removing the IDENTITY attribute and the error message points directly to this as issue.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Can I put my code here
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
indian143 wrote: I explained this only because there is no way that I can miss the Foreign key relationship
But the error is telling you SPECIFICALLY that that assumption is wrong.
Hypothetically how do you know that, for instance, the SSN was never entered wrong? Or that someone didn't make up a SSN?
The error is telling you that either you must clean the existing data before using it or you must use another key.
|
|
|
|