Custom Stored Procedures With Replication

Oct 20, 1998

Has anyone used custom stored procedures with multiple tables? or can you only use them with one.

View 1 Replies


ADVERTISEMENT

Custom Stored Procedures! New To SQL!

May 14, 2008



I just got all of my data ported from DBF Files to my database in SQL. Now I'm writing stored procedures (trying).

I have a table with the following Columns. I'm using SQL Management Studio.
EmployeeName, Date, Punch(minutes after midnight), Type of Punch, Department

EmployeeA, 5/1/08, 479, RI, Finance
EmployeeA, 5/1/08, 720, MO, Finance
EmployeeA, 5/1/08, 780, MI, null
EmployeeA, 5/1/08, 1020, RO, null
EmployeeA, 5/2/08, 480, RI, Finance
EmployeeA, 5/2/08, 722, MO, Finance
EmployeeA, 5/2/08, 770, MI, null
EmployeeA, 5/2/08, 1019, RO, null
EmployeeA, 5/3/08, 477, RI, Finance
EmployeeA, 5/3/08, 730, MO, Finance
EmployeeA, 5/3/08, 800, MI, null
EmployeeA, 5/3/08, 1031, RO, null
EmployeeB, 5/1/08, 492, RI, Finance
EmployeeB, 5/1/08, 722, MO, Finance
EmployeeB, 5/1/08, 776, MI, null
EmployeeB, 5/1/08, 1022, RO, null
EmployeeB, 5/2/08, 482, RI, Finance
EmployeeB, 5/2/08, 730, MO, Finance
EmployeeB, 5/2/08, 760, MI, null
EmployeeB, 5/2/08, 1011, RO, null
EmployeeB, 5/3/08, 480, RI, Finance
EmployeeB, 5/3/08, 725, MO, Finance
EmployeeB, 5/3/08, 775, MI, null
EmployeeB, 5/3/08, 1020, RO, null

Type of punch is going to be RI - Regular IN, RO - Regular Out, MI - Meal In, or MO - Meal Out. I need a stored procedure that for each date it takes that person's ((RO - MO)+(MI - RI))/60 to get their Hours worked so that in the end, I have something that looks like.

EmployeeA, 5/1/08, 8(hrs)
EmployeeA, 5/2/08, 8.1(hrs)

EmployeeA, 5/3/08, 8.3(hrs)
EmployeeB, 5/1/08, 7.7(hrs)
EmployeeB, 5/2/08, 7.9(hrs)
EmployeeB, 5/3/08, 8.1(hrs)

I'm new to SQL Stored Procedures, but not to coding. Any hints, links, code that can get me on the right track?
Thanks in advance!!

Alternatively I think it's bad practice, but for ease of display, is it possible to set the columns up such that:

Employee, Department, 5/1/08, 5/2/08, 5/3/08

EmployeeA, Finance, 6, 6.1, 5.2
EmployeeA, Marketing, 2, 1.9, 3.8
EmployeeB, Finance, 4.9, 2, 6.1
EmployeeB, Operations, 3.1, 6, 1.9

In this example each employee can work in multiple departments. Also, each day that the database is updated, the new date is added as a column. Thanks!

-Curt


View 18 Replies View Related

Editing Tables & Writing Custom Stored Procedures

Feb 26, 2007

Hi all,

I’m currently writing a web application on student exam timetables, I’m using SQL Server 2005 as the back-end for the database.

At present, the case states that if a student is in one examination, he/she can’t attend, or be allocated another examination while the first examination is in place, which would result in a clash

The way I’m going to target this is by writing a stored procedure in SQL Server 2005 to return an error code, which I’ll translate using ASP,NET, however at present I’m having difficulty writing the SQL code. This is because…

I’m using SQL Server 2005 Management Studio; I created the tables using MS Access and upsized them using the wizard. I can now access my database, but having difficulty editing my tables and with code…

Any ideas??

Thank-you

View 2 Replies View Related

Replication And Stored Procedures

Feb 16, 2000

I'm new to Replication and trying to understand some basic concepts. What I really want to do is replicate a View such that it shows as a table in the subscriber database, but it appears as though I cannot do that. First, is that correct? Second, since it appears as though Stored Procedures can be replicated, I was wondering if I could accomplish the same thing via that route. However, I am unclear: does the SP itself replicate? Does replication execute the SP? If the SP simply does a query, are the query results replicated?

I know that I can replicate subsets of tables; limiting rows and columns. This is part of what I wanted the view to do, however I also wanted to be able to include joins.

Thanks for any help anyone can provide this newbie!

View 1 Replies View Related

.Net Stored Procedures & Replication

Oct 25, 2007

.Net Stored Procedures & Replication

Can you do it? I have some transformation and business logic I need to place in the transactional replication process.

Just curious if its possible.

BTW, I know I should not be doing transformation during transactional replication. At the moment the client wants realtime updates to a central repository thought transactional replication.

Thanks in advance!

Bryan

View 1 Replies View Related

Stored Procedures And Replication Question

Oct 22, 2001

Hello all. I have a question, but first the setting.

I have one Publisher pushing out to 4 subscriptions, all are SQL 2000 Servers. The tables all replicate like they are supposed to. My issue is that if I make changes to a stored procedure, I have to physically go to each subscription and make the same changes. I included the stored procedures when I set up the publication.

Now the question, is there an easier way? I want to be able to make the changes on the publisher and the changes to replicate to the other servers.

Thanks!!!!!

Kameron

View 1 Replies View Related

Transactional Replication - Stored Procedures

Nov 22, 2007

I have a system with three replications:
merge replication between SERVER and CLIENT
transactional replication from SERVER to CLIENT
transactional replication from CLIENT to SERVER

SERVER is always distributor.

Everything has been running fine for over a week now, but today something went wrong with the second transactional replication (from CLIENT to SERVER). SERVER is distributor and CLIENT is publisher. The subscription is push.

When I view the synchronization status, the following error message appears:
"Could not find stored procedure 'sp_MSins_dbosessions'."

Indeed, when I look at the stored procedure, it has been renamed to
'sp_MSins_dbosessions_msrepl_ccs'.

I don't know why, when or how this renaming happened, but it happened for every stored procedure that is used for this transactional replication (the other replications are still working fine)

Any help or remarks are highly appreciated.

Roel

View 11 Replies View Related

Merge Replication And Stored Procedures

Sep 19, 2007

Hi,

I created a .sdf file thru merge replication.

On the step of publication, in the articles object there is an option to select from 1) Tables,views 2) and stored procedures from the databse.

How these two are diferent from each other?
My aim is to use Stored procedures extensively so that I can avoid SQL code in device.

When we use this .sdf file in active sync,we only getting the tables, and no sp's and views.

Is it possible to accept sp's and view from sdf in pocketPC?

I am using SQL server2005 on server , Windows SQL Mobile 2005 in pocket pc 2003 using Compact Framework 2.0
Please advice..

aneesh

View 6 Replies View Related

Replication Is Renaming My Stored Procedures On Client Only

Sep 19, 2006

I am new to replication but I have a question, I have my server which is using a transaction replication process and a client with using SQL Express with replication turned on. I have the identical DB on both nodes yet when I subsrcibe to the server from the client, data is transfer but for some reason, all of my stored procedures are renamed with sp_MSDel_DBOxxxx. How do I keep SQL from renaming these SP's? The server maintains the origial names to the SPs its just happening on my client.



Thanks

View 5 Replies View Related

How To Implement The Replication With The System Stored Procedures Or TransactSQL?

Jun 8, 2004

how to implement the replication with the System Stored Procedures or the Transact-SQL ?

i want to encapsula my replication and make it be reusable and ease to use.So i want to do the replication in a script file.how can i do this?

Thanks.

View 9 Replies View Related

Replication System Stored Procedures Parameter Defaults ?

Oct 27, 2005

Hi there

View 5 Replies View Related

Setting Up Publication For Merge Replication Using Stored Procedures

Aug 2, 2006

Hello.I am trying to use Transact SQL to prepare publication for replication (SQL Server 2000 SP4 and SQL Mobile). I can easily create publication, add filters etc. but there is one thing which I can't find : parameter which tells me subscriber type and allow me to change subscriber type for publication. I don't know where I can change (or even if I can change) this property.
If someone made publication for mobile devices and replication with filters,resolvers etc. will it be a problem to share experiences here? Maybe some sample code with script or something what will guide me. Thanks in advance. Maciej Wysocki

View 4 Replies View Related

MSSQL 7 Replication - Creating Of Standard Sp_MS... Stored Procedures

Aug 15, 2001

I am running MS SQL Server 7 with SP3 installed and am having some problems getting replication to work correctly. I want to replicate all tables from one database to another database on the same server. I can setup replication, add publications and add subscriptions without any problem and all goes well until the replication process starts when the job aborts because it cannot find the sp_MSins..., sp_MSupd... or the sp_MSdel... stored procedures. I have used the New Publication wizard to create a Transactional publication, published all tables and allowed the wizard to use the default stored procedures which it says will be created when the subscribers are initialized but although I have created push subcriptions the stored procedures are never created and hence the replication fails whenever the job runs.

I have SA access to the databases concerned and as far as I am aware the jobs are running as my login - can anybody help me out as this is beginning to drive me nuts.

Thanks

Chris

View 1 Replies View Related

SQL Server Admin 2014 :: Replication Could Not Find Or Execute Stored Procedures

Jul 20, 2015

Replication-Replication Distribution Subsystem: agent PRODDATA6 failed. Could not find stored procedure 'sp_MSdel_dboActiveTask_msrepl_ccs'.

Replication-Replication Transaction-Log Reader Subsystem: agent PRODDATA6. The process could not execute 'sp_replcmds' on 'PRODDATA6'.

Replication-Replication Distribution Subsystem: agent PRODDATA6. Could not find stored procedure 'sp_MSupd_dboActiveTask'.

Looks like these sp's got deleted?

View 1 Replies View Related

Oracle Stored Procedures VERSUS SQL Server Stored Procedures

Jul 23, 2005

I want to know the differences between SQL Server 2000 storedprocedures and oracle stored procedures? Do they have differentsyntax? The concept should be the same that the stored proceduresexecute in the database server with better performance?Please advise good references for Oracle stored procedures also.thanks!!

View 11 Replies View Related

Stored Procedures 2005 Vs Stored Procedures 2000

Sep 30, 2006

Hi,



This Might be a really simple thing, however we have just installed SQL server 2005 on a new server, and are having difficulties with the set up of the Store Procedures. Every time we try to modify an existing stored procedure it attempts to save it as an SQL file, unlike in 2000 where it saved it as part of the database itself.



Thank you in advance for any help on this matter



View 1 Replies View Related

Custom Procs For Replication

Mar 20, 2006

SQL Server 2000 Enterprise

Hello,

I have a test publication of two tables. Both tables are supposed to use a custom update stored procedure
(you know, "Replace UPDATE commands with this stored procedure call:")
When updating Table1 the system calls my custom stored stored procedure.

Here is a small excerpt captured by the Profiler when updating Table1:

exec usp_FNLC_MSupd_Table1 'Jun 24 2005 12:00:00:000AM', NULL, 100081142, 0x01

Looks good. I see that my custom update proc was used (usp_FNLC_MSupd_Table1).


Now, when updating Table2 (Table2 is pretty identical to Table1) Profiler sends this back and the update on the subscriber fails:

exec sp_executesql N'delete from "Table2" where "Dates3ID" = @P1 insert into "Table2" values (@P2, @P3) ', N'@P1 int,@P2 int,@P3 datetime', 8, 8, 'Mar 24 2006 12:00:00:000AM'

Then..

exec sp_executesql N'insert into "Table1" values (@P1, @P2) ', N'@P1 int,@P2 datetime', 8, 'Mar 24 2006 12:00:00:000AM'
Go

This is what the distribution agent throws back:

Insert Error: Column name or number of supplied values does not match table definition.
(Source: DFBPBSO (Data source); Error number: 213)

So, why isn't the article Table2 using my custom update proc? All I do is updates, no deletes or inserts. No matter what I do for this article, it will not use the custom update proc.

I need help, please. Thank you in advance,
L

View 3 Replies View Related

All My Stored Procedures Are Getting Created As System Procedures!

Nov 6, 2007



Using SQL 2005, SP2. All of a sudden, whenever I create any stored procedures in the master database, they get created as system stored procedures. Doesn't matter what I name them, and what they do.

For example, even this simple little guy:

CREATE PROCEDURE BOB

AS

PRINT 'BOB'

GO

Gets created as a system stored procedure.

Any ideas what would cause that and/or how to fix it?

Thanks,
Jason

View 16 Replies View Related

Custom Resolver For Merge Replication

Sep 7, 2006

Hi there!




I'm trying to create a custom resolver for merge replication exactly like in the MS example.


It seems to work, but only ONE time. If I change, insert or delete a
record in a table the second time, the subscriber monitor comes with
the following errors:




Error messages:

Attempted to read or write protected memory. This is often an
indication that other memory is corrupt. (Source: MSSQL_REPL, Error
number: MSSQL_REPL-2147199411)



The Merge Agent encountered an error when executing code in the
'UpdateHandler' method implemented in the business logic handler
'D:Program FilesMicrosoft SQL Server90COMMyResolver.dll'. Ensure
that the overridden 'UpdateHandler' method has been properly
implemented in the business logic handler. (Source: MSSQL_REPL,
Error number: MSSQL_REPL-2147199411)



This last error is of course dependant on my action (update, delete, insert).

My code is -exactly- like the example (I just stripped out the log message).



Does anyone know why I am "trying to read or write protected memory" ?



The thing is that I'm trying to create an application that detects if a
table changes. Is this the right way to do this anyway or are there
better solutions?



Any help is appreciated! Thanks!

View 13 Replies View Related

Merge Replication - Examples For Custom Conflict Resolvers?

Oct 30, 2006

I have gone through BOL and various online resources including this one and I can't find any examples on how to use custom conflict resolvers to generate a result row which is a combination of the rows to be merged.

BOL says it can be done, but suitable examples are missing. I have found various posts requesting examples from up to a year ago, but can see no replies with relevant information

In particular I would like to see examples of

1) A stored procedure based custom conflict resolver

2) A business logic handler written in VB .Net

Here's hoping

aero1

View 16 Replies View Related

Custom Bootstrap Installer For SQL Express SP 2 With Replication Features Added

Mar 26, 2008

I'm trying to create a custom bootstrapper for SQL Express SP 2 Which enables the replication features of SQL Express. I read an article telling me that I could use the same command line arguments in the bootstrapper as does SQL Server 2008 unattended installation

How to install SQL Server 2008 from the command prompt :

http://msdn2.microsoft.com/en-us/library/ms144259(SQL.100).aspx


Arron Stebners WebLog suggests using the following:

http://blogs.msdn.com/astebner/archive/2006/03/19/555326.aspx

SQLEXPR32.EXE -q /norebootchk /qn reboot=ReallySuppress addlocal=all instancename=SQLEXPRESS SCCCHECKLEVEL=IncompatibleComponents:1;MDAC25Version:0 ERRORREPORTING=2 SQLAUTOSTART=1

What I€™m trying to do is something like this with my parameters:

-q /norebootchk /qn reboot=ReallySuppress addlocal=all SECURITYMODE=SQL SCCCHECKLEVEL=IncompatibleComponents:1;MDAC25Version:0 FEATURES=SQL SQLSVCACCOUNT="NT AUTHORITYSYSTEM" SQLSVCPASSWORD="<password>" SQLSYSADMINACCOUNTS="sa" AGTSVCACCOUNT="NT AUTHORITYNetwork Service" INSTANCEDIR="C:Program FilesMicrosoft SQL Server" SQLBACKUPDIR="C:Program FilesMicrosoft SQL ServerBackup" INSTALLSQLDATADIR="C:Program FilesMicrosoft SQL Servermssql.1mssqldata" /instancename=SQLEXPRESS /SQLSVCStartuptype=2 SQLAUTOSTART=1 ERRORREPORTING=2 ADDUSERASADMIN=0

This fails with an error code 110:

Here is the full install log:

The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [ProcessorArchitecture] = Intel {string}
Property: [VersionNT] = 5.1.2 {version}
Running checks for package 'Windows Installer 3.1', phase BuildList
The following properties have been set for package 'Windows Installer 3.1':
Running checks for command 'WindowsInstaller3_1WindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.1': true
Result of checks for command 'WindowsInstaller3_1WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
'Windows Installer 3.1' RunCheck result: No Install Needed
Running checks for package '.NET Framework 3.5', phase BuildList
Reading value 'Install' of registry key 'HKLMSoftwareMicrosoftNET Framework SetupNDPv3.51033'
Read integer value 1
Setting value '1 {int}' for property 'DotNet35InstallSuccess'
The following properties have been set for package '.NET Framework 3.5':
Property: [DotNet35InstallSuccess] = 1 {int}
Running checks for command 'DotNetFX35dotNetFx35setup.exe'
Result of running operator 'ValueEqualTo' on property 'DotNet35InstallSuccess' and value '1': true
Result of checks for command 'DotNetFX35dotNetFx35setup.exe' is 'Bypass'
'.NET Framework 3.5' RunCheck result: No Install Needed
Running checks for package 'SQL Server 2005 Express Edition SP2 (x86) Build for Project Endeavor', phase BuildList
Running external check with command 'C:DOCUME~1CarrollDLOCALS~1TempVSD381.tmpSQLEXPRESS_PROJECT_ENDEAVORSqlExpressChk.exe' and parameters ''
Process exited with code 1
Setting value '1 {int}' for property 'SQLExpressInstalled'
The following properties have been set for package 'SQL Server 2005 Express Edition SP2 (x86) Build for Project Endeavor':
Property: [SQLExpressInstalled] = 1 {int}
Running checks for command 'SQLEXPRESS_PROJECT_ENDEAVORSQLEXPR.EXE'
Result of running operator 'ValueEqualTo' on property 'SQLExpressInstalled' and value '0': false
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionNT' and value '5.1': true
Result of checks for command 'SQLEXPRESS_PROJECT_ENDEAVORSQLEXPR.EXE' is 'Bypass'
Running checks for command 'SQLEXPRESS_PROJECT_ENDEAVORSQLEXPR.EXE'
Result of running operator 'ValueEqualTo' on property 'SQLExpressInstalled' and value '0': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.1': false
Result of running operator 'ValueEqualTo' on property 'AdminUser' and value 'false': false
Result of running operator 'ValueExists' on property 'Version9x': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.1.2': false
Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'Intel': false
Result of checks for command 'SQLEXPRESS_PROJECT_ENDEAVORSQLEXPR.EXE' is 'Install'
Running checks for command 'SQLEXPRESS_PROJECT_ENDEAVORSQLEXPR.EXE'
Result of running operator 'ValueEqualTo' on property 'SQLExpressInstalled' and value '0': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.2': true
Result of checks for command 'SQLEXPRESS_PROJECT_ENDEAVORSQLEXPR.EXE' is 'Bypass'
'SQL Server 2005 Express Edition SP2 (x86) Build for Project Endeavor' RunCheck result: Install Needed
EULA for components 'SQL Server 2005 Express Edition SP2 (x86) Build for Project Endeavor' was accepted.
Copying files to temporary directory "C:DOCUME~1CarrollDLOCALS~1TempVSD381.tmp"
Copying from 'C: empEndeavorInstallerSQLEXPRESS_PROJECT_ENDEAVORSQLEXPR.EXE' to 'C:DOCUME~1CarrollDLOCALS~1TempVSD381.tmpSQLEXPRESS_PROJECT_ENDEAVORSQLEXPR.EXE'
Verifying file integrity of C:DOCUME~1CarrollDLOCALS~1TempVSD381.tmpSQLEXPRESS_PROJECT_ENDEAVORSQLEXPR.EXE
WinVerifyTrust returned 0
File trusted
Running checks for package 'SQL Server 2005 Express Edition SP2 (x86) Build for Project Endeavor', phase BeforePackage
Running external check with command 'C:DOCUME~1CarrollDLOCALS~1TempVSD381.tmpSQLEXPRESS_PROJECT_ENDEAVORSqlExpressChk.exe' and parameters ''
Process exited with code 1
Setting value '1 {int}' for property 'SQLExpressInstalled'
The following properties have been set for package 'SQL Server 2005 Express Edition SP2 (x86) Build for Project Endeavor':
Property: [SQLExpressInstalled] = 1 {int}
Running checks for command 'SQLEXPRESS_PROJECT_ENDEAVORSQLEXPR.EXE'
Result of running operator 'ValueEqualTo' on property 'SQLExpressInstalled' and value '0': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.1': false
Result of running operator 'ValueEqualTo' on property 'AdminUser' and value 'false': false
Result of running operator 'ValueExists' on property 'Version9x': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.1.2': false
Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'Intel': false
Result of checks for command 'SQLEXPRESS_PROJECT_ENDEAVORSQLEXPR.EXE' is 'Install'
'SQL Server 2005 Express Edition SP2 (x86) Build for Project Endeavor' RunCheck result: Install Needed
Verifying file integrity of C:DOCUME~1CarrollDLOCALS~1TempVSD381.tmpSQLEXPRESS_PROJECT_ENDEAVORSQLEXPR.EXE
WinVerifyTrust returned 0
File trusted
Installing using command 'C:DOCUME~1CarrollDLOCALS~1TempVSD381.tmpSQLEXPRESS_PROJECT_ENDEAVORSQLEXPR.EXE' and parameters '-q /norebootchk /qn reboot=ReallySuppress addlocal=all SECURITYMODE=SQL SCCCHECKLEVEL=IncompatibleComponents:1;MDAC25Version:0 FEATURES=SQL SQLSVCACCOUNT="NT AUTHORITYSYSTEM" SQLSVCPASSWORD="Bade#doo" SQLSYSADMINACCOUNTS="sa" AGTSVCACCOUNT="NT AUTHORITYNetwork Service" INSTANCEDIR="C:Program FilesMicrosoft SQL Server" SQLBACKUPDIR="C:Program FilesMicrosoft SQL ServerBackup" INSTALLSQLDATADIR="C:Program FilesMicrosoft SQL Servermssql.1mssqldata" /instancename=SQLEXPRESS /SQLSVCStartuptype=2 SQLAUTOSTART=1 ERRORREPORTING=2 ADDUSERASADMIN=0'
Process exited with code 110
Status of package 'SQL Server 2005 Express Edition SP2 (x86) Build for Project Endeavor' after install is 'InstallFailed'

View 5 Replies View Related

How To Search And List All Stored Procs In My Database. I Can Do This For Tables, But Need To Figure Out How To Do It For Stored Procedures

Apr 29, 2008

How do I search for and print all stored procedure names in a particular database? I can use the following query to search and print out all table names in a database. I just need to figure out how to modify the code below to search for stored procedure names. Can anyone help me out?
 SELECT TABLE_SCHEMA + '.' + TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'

View 1 Replies View Related

Using A Stored Procedure To Query Other Stored Procedures And Then Return The Results

Jun 13, 2007

Seems like I'm stealing all the threads here, : But I need to learn :) I have a StoredProcedure that needs to return values that other StoredProcedures return.Rather than have my DataAccess layer access the DB multiple times, I would like to call One stored Procedure, and have that stored procedure call the others to get the information I need. I think this way would be more efficient than accessing the DB  multiple times. One of my SP is:SELECT I.ItemDetailID, I.ItemDetailStatusID, I.ItemDetailTypeID, I.Archived,     I.Expired, I.ExpireDate, I.Deleted, S.Name AS 'StatusName', S.ItemDetailStatusID,    S.InProgress as 'StatusInProgress', S.Color AS 'StatusColor',T.[Name] AS 'TypeName',    T.Prefix, T.Name AS 'ItemDetailTypeName', T.ItemDetailTypeID    FROM [Item].ItemDetails I    INNER JOIN Item.ItemDetailStatus S ON I.ItemDetailStatusID = S.ItemDetailStatusID    INNER JOIN [Item].ItemDetailTypes T ON I.ItemDetailTypeID = T.ItemDetailTypeID However, I already have StoredProcedures that return the exact same data from the ItemDetailStatus table and ItemDetailTypes table.Would it be better to do it above, and have more code to change when a new column/field is added, or more checks, or do something like:(This is not propper SQL) SELECT I.ItemDetailID, I.ItemDetailStatusID, I.ItemDetailTypeID, I.Archived,     I.Expired, I.ExpireDate, I.Deleted, EXEC [Item].ItemDetailStatusInfo I.ItemDetailStatusID, EXEC [Item].ItemDetailTypeInfo I.ItemDetailTypeID    FROM [Item].ItemDetails IOr something like that... Any thoughts? 

View 3 Replies View Related

How To Save Stored Procedure To NON System Stored Procedures - Or My Database

May 13, 2008

Greetings:

I have MSSQL 2005. On earlier versions of MSSQL saving a stored procedure wasn't a confusing action. However, every time I try to save my completed stored procedure (parsed successfully ) I'm prompted to save it as a query on the hard drive.

How do I cause the 'Save' action to add the new stored procedure to my database's list of stored procedures?

Thanks!

View 5 Replies View Related

Displaying Custom Properties For Custom Transformation In Custom UI

Mar 8, 2007

Hi,

I am creating a custom transformation component, and a custom user interface for that component.

In
my custom UI, I want to show the custom properties, and allow users to
edit these properties similar to how the advanced editor shows the
properties.

I know in my UI I need to create a "Property Grid".
In
the properties of this grid, I can select the object I want to display
data for, however, the only objects that appear are the objects that I
have already created within this UI, and not the actual component
object with the custom properties.

How do I go about getting the properties for my transformation component listed in this property grid?

I am writing in C#.

View 5 Replies View Related

Stored Procedure Being Saved In System Stored Procedures

Apr 7, 2006

We recently upgraded to SQL Server 2005. We had several stored procedures in the master database and, rather than completely rewriting a lot of code, we just recreated these stored procedures in the new master database.

For some reason, some of these stored procedures are getting stored as "System Stored Procedures" rather than just as "Stored Procedures". Queries to sys.Objects and sys.Procedures shows that these procs are being saved with the is_ms_shipped field set to 1, even though they obviously were not shipped with the product.

I can't update the sys.Objects or sys.Procedures views in 2005.

What effect will this flag (is_ms_shipped = 1) have on my stored procedures?

Can I move these out of "System Stored Procedures" and into "Stored Procedures"?

Thanks!

View 24 Replies View Related

How Can I Call One Or More Stored Procedures Into Perticular One Stored Proc ?

Apr 23, 2008

Hello friends......How are you ? I want to ask you all that how can I do the following ?
I want to now that how many ways are there to do this ?



How can I call one or more stored procedures into perticular one Stored Proc ? in MS SQL Server 2000/05.

View 1 Replies View Related

SSIS And Stored Procedures Results Stored In #Tables

Mar 26, 2008

Hello
I'm start to work with SSIS.

We have a lot (many hundreds) of old (SQL Server2000) procedures on SQL 2005.
Most of the Stored Procedures ends with the following commands:


SET @SQLSTRING = 'SELECT * INTO ' + @OutputTableName + ' FROM #RESULTTABLE'

EXEC @RETVAL = sp_executeSQL @SQLSTRING


How can I use SSIS to move the complete #RESULTTABLE to Excel or to a Flat File? (e.g. as a *.csv -File)

I found a way but I think i'ts only a workaround:

1. Write the #Resulttable to DB (changed Prozedure)
2. create data flow task (ole DB Source - Data Conversion - Excel Destination)

Does anyone know a better way to transfer the #RESULTTABLE to Excel or Flat file?

Thanks for an early Answer
Chaepp

View 9 Replies View Related

MS SQL Stored Procedures Inside Another Stored Procedure

Jun 16, 2007

Hi,
 Do you know how to write stored procedures inside another stored procedure in MS SQL.
 
Create procedure spMyProc inputData varchar(50)
AS
 ----- some logical
 
 procedure spMyProc inputInsideData varchar(10)
AS
   --- some logical
  ---  go
-------

View 5 Replies View Related

Calling Stored Procedures From Another Stored Procedure

May 8, 2008

I am writing a set of store procedures (around 30), most of them require the same basic logic to get an ID, I was thinking to add this logic into an stored procedure.

The question is: Would calling an stored procedure from within an stored procedure affect performance? I mean, would it need to create a separate db connection? am I better off copying and pasting the logic into all the store procedures (in terms of performance)?

Thanks in advance

John

View 5 Replies View Related

Calling A Stored Procedure Inside Another Stored Procedure (or Nested Stored Procedures)

Nov 1, 2007

Hi all - I'm trying to optimized my stored procedures to be a bit easier to maintain, and am sure this is possible, not am very unclear on the syntax to doing this correctly.  For example, I have a simple stored procedure that takes a string as a parameter, and returns its resolved index that corresponds to a record in my database. ie
exec dbo.DeriveStatusID 'Created'
returns an int value as 1
(performed by "SELECT statusID FROM statusList WHERE statusName= 'Created') 
but I also have a second stored procedure that needs to make reference to this procedure first, in order to resolve an id - ie:
exec dbo.AddProduct_Insert 'widget1'
which currently performs:SET @statusID = (SELECT statusID FROM statusList WHERE statusName='Created')INSERT INTO Products (productname, statusID) VALUES (''widget1', @statusID)
I want to simply the insert to perform (in one sproc):
SET @statusID = EXEC deriveStatusID ('Created')INSERT INTO Products (productname, statusID) VALUES (''widget1', @statusID)
This works fine if I call this stored procedure in code first, then pass it to the second stored procedure, but NOT if it is reference in the second stored procedure directly (I end up with an empty value for @statusID in this example).
My actual "Insert" stored procedures are far more complicated, but I am working towards lightening the business logic in my application ( it shouldn't have to pre-vet the data prior to executing a valid insert). 
Hopefully this makes some sense - it doesn't seem right to me that this is impossible, and am fairly sure I'm just missing some simple syntax - can anyone assist?
 

View 1 Replies View Related

Custom Paging On Stored Procedure

Oct 12, 2007

Hello,       I receive this error "Incorrect syntax near 'GetGalleryPaged'." I'm trying to use custom paging on a stored procedure. .......       Dim mySqlConn As New SqlConnection(ConnStr)        Dim objDA As New SqlDataAdapter("GetGalleryPaged", mySqlConn)        objDA.SelectCommand.Parameters.Add("@startRowIndex", SqlDbType.Int, 1)        objDA.SelectCommand.Parameters.Add("@@maximumRows", SqlDbType.Int, 9)        Dim objDS As New DataSet()        Dim objPds As PagedDataSource = New PagedDataSource        objDA.Fill(objDS, "Gallery") <<----error here        mySqlConn.Close()        objPds.DataSource = objDS.Tables(0).DefaultView        objPds.AllowPaging = True....... ALTER PROCEDURE dbo.GetGalleryPaged (     @startRowIndex int,      @maximumRows int)AS    SELECT     idgallery, g_picpath    FROM             (        SELECT idgallery, g_picpath, ROW_NUMBER() OVER (ORDER BY idgallery DESC) AS RowRank            FROM Gallery    ) AS GalleryWithRowNumber    WHERE     RowRank > @startRowIndex AND RowRank <= (@startRowIndex + @maximumRows)    ORDER BY idgallery DESC  cheers,imperialx 

View 5 Replies View Related

Automating A Custom Stored Procedure

Jul 13, 2000

Can I automate a stored procedure I made myself?
If so could someone kindly tell me how as I have tried to no avail.
Thanks in advnace

View 1 Replies View Related







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