Sp_msforeachdb I Know Its Undocummented Im Getting Desperate
Oct 1, 2007
sp_msforeachdb @command1= 'USE ? exec sp_Depends "dbo.style"'
So im trying to return everything that uses that dbo.style im getting this error I just want to show where that table is being used and suggestions. I know that feature is undocumented. This also doesnt seem to be searching all the Databases when I search it.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'master'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'tempdb'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'msdb'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'GoldMine_Sales_and_Marketing'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'CustomerConcerns'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'Aggregate'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'OLD_BUDGET'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'CreditCardData'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'DELSA'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'COZUM'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'DelSolNet'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'DelSolNet2'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'DYNAMICS'.
Object does not reference any object, and no objects reference it.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'HUNTB'.
In the current database, the specified object is referenced by the following:
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'MASDEV'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'MASDEVSmall'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'OLDOnlineOrdering'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'OnlineRMA'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'OnlineStore'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'DELSO'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'Reporting'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'SSE'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'STTHO'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'TMPLT'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'WHAVL'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'QSCHQ'.
In the current database, the specified object is referenced by the following:
In the current database, the specified object is referenced by the following:
In the current database, the specified object is referenced by the following:
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'SOLKD_DATA'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'SOLKD_NET'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'ALOHA_DATA'.
Server: Msg 15009, Level 16, State 1, Procedure sp_depends, Line 28
The object 'dbo.style' does not exist in database 'ALOHA_NET'.
View 6 Replies
ADVERTISEMENT
May 21, 2001
Hey, all...
I'm trying to modify the sp_msforeachdb proc (after copying it and renaming it, of course) to exclude system databases. It could be done in 7.0 by adding a "where name not in ('master', msdb', 'model', 'tempdb')" clause to the select in the cursor, but it doesn't work in the SQL 2000 version.
Does anyone have any ideas? Any insight would be greatly appreciated.
View 2 Replies
View Related
Oct 1, 2007
I have this chunk of code that you enter your table and it tells you what sp, views etc it is in. But it does not show if that table is used in an sp in a different DB. i was told that sp_msForeachdb may help but i have no idea how use it. Help please here is the code i have below
SET nocount ON
DECLARE @string VARCHAR(1000)
--SET @string = 'dbo.RetailSales_ByStore_ByCustomer_ByDay' --> This is your search criteria
SET @string = 'dbo.Store' --> This is your search criteria
DECLARE
@errnum INT,
@errors CHAR(1),
@rowcnt INT,
@output VARCHAR(255)
SELECT
@errnum = 0,
@errors = 'N',
@rowcnt = 0,
@output = ''
DECLARE @Results TABLE (
Name VARCHAR(55),
Type VARCHAR(12),
DateCreated DATETIME,
ProcLine VARCHAR(4000)
)
INSERT
INTO @Results
SELECT DISTINCT
'Name' = CONVERT(VARCHAR(55), SO.name),
'Type' = SO.type,
crdate,
''
FROM
sysobjects SO
JOIN syscomments SC
ON SC.id = SO.id
WHERE
SC.text LIKE '%' + @string + '%'
UNION
SELECT DISTINCT
'Name' = CONVERT(VARCHAR(55), SO.name),
'Type' = SO.type,
crdate,
''
FROM
sysobjects SO
WHERE
SO.name LIKE '%' + @string + '%'
UNION
SELECT DISTINCT
'Name' = CONVERT(VARCHAR(55), SO.name),
'Type' = SO.type,
crdate,
''
FROM
sysobjects SO
JOIN syscolumns SC
ON SC.id = SO.ID
WHERE
SC.name LIKE '%' + @string + '%'
ORDER BY
2,
1
SELECT
Name,
'Type' = CASE (Type)
WHEN 'P' THEN 'Procedure'
WHEN 'TR' THEN 'Trigger'
WHEN 'X' THEN 'Xtended Proc'
WHEN 'U' THEN 'Table'
WHEN 'C' THEN 'Check Constraint'
WHEN 'D' THEN 'Default'
WHEN 'F' THEN 'Foreign Key'
WHEN 'K' THEN 'Primary Key'
WHEN 'V' THEN 'View'
ELSE Type
END,
DateCreated
FROM
@Results
ORDER BY
2,
1
View 1 Replies
View Related
Feb 19, 2008
need help-------------
i understand sp_MSforeachdb system stored procedure can be used to do the same task on all the databases. but when i tried this what i does execute that task/command number of times the available databases on same database instead execute that task once on each database.
this is what i was doing
use master
exec sp_msforeachdb @command1 = "exec sp_grantdbaccess @loginame ='test',@name_in_db = 'test'"
GO
can some one ther please help me how i can execute this for each database
View 1 Replies
View Related
Oct 1, 2007
I know this is undocumented code and Im brand new to this but how would i use p_msForeachdb in conjunction with sp_depends
View 4 Replies
View Related
May 9, 2006
Hello,
I know that sp_MSForEachDB is not being supported, but I am wondering if someone would help me find out if I can use sp_MSForEachTable within sp_MSForEachDB.
The code below does not work, and I am wondering if the code is feasible.
Error Message - "cursor hCForEach already exist"
declare @var varchar(1000)
set @var =
'EXEC sp_MSForEachTable @command1='INSERT INTO #tblResults2
([name],[rows],[reserved],[data],[index_size],[unused])
EXEC sp_spaceused ''?''''
EXEC sp_MSForEachDB @command1=@var
View 4 Replies
View Related
Jun 29, 2000
Is this supported? Has anyone used it with success? Here's the code I'm using -
EXEC sp_Msforeachdb "DBCC shrinkdb ('?')"
View 1 Replies
View Related
Jan 6, 2007
Hi if I do exec sp_MSforeachDB '......etc'
and i get SP sp_MSforeachDB not found how do i reference it in order for the server to find it.
Because when we check in master we find the SP there but when we run the exec sp_MSforeachDB ...
we get SP not found
any help pls
View 20 Replies
View Related
Mar 13, 2008
I am using SQLExpress for Unit Testing my application. In the Unit Tests, I use a local database file that is attached automatically in SQLExpress when the Unit Test uses it.
FYI, in the Unit Test I use the following connection string :
"Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|MyUnitTestDatabase.mdf;Integrated Security=True;User Instance=False;Pooling=false"
By accident, the MyUnitTestDatabase.mdf file was marked as ReadOnly. So, after executing several times the unit Test, the attached databases appear in grey in the SQL Server Management Studio Express. That's normal ! The problem I want to report here occurs when I execute the following script in SQL Server Management Studio Express:
use master
go
sp_MSForEachDB 'Print ''?'''
go
In .SQLExpress, I currently have 8 databases (The three last databases are those attached by the unit tests. They are ReadOnly):
- master
- model
- msdb
- tempdb
- MyUnitTestDatabase (the original db copied and used by the Unit Tests. It's not ReadOnly)
- 1E6AA4A60F3733D37F016842D4626B8B_X34058MYSERVICETESTRESULTSX34058_N17400 2008-03-12 17_22_03OUTMYUNITTESTDATABASE.MDF
- ADA9F382DFBC95C8334EF95336C98274_X34058MYSERVICETESTRESULTSX34058_N17400 2008-03-12 17_13_57OUTMYUNITTESTDATABASE.MDF
- F00BF38C8BB8F07D37FCC4E918CF815E_X34058MYSERVICETESTRESULTSX34058_N17400 2008-03-12 17_10_04OUTMYUNITTESTDATABASE.MDF
When executed, the script mentioned above displays sometimes all the databases and sometimes only the 4 first databases ?!?!
I did a demo to various colleagues here, pressing F5 many times in the Script windows. It's seems taht it displays 4 names or 8 names "at random"... (I always wait for the message "Query executed successfully" before pressing again F5).
I have to understand the problem here because I use sp_MSForEachDB to detach all the databases at the end of the Unit Tests and it also fails from time to time...
Thx in advance for any tip that could help me in finding the origin of this problem
V.
PS. : FYI, here is the stored proc I use to automatically detach the databases at the end of the unit tests
declare @spid int
declare @killstatement nvarchar(10)
IF @database like '%TESTRESULTS%'
BEGIN
-- Declare a cursor to select the users connected to the specified database
declare c1 cursor for select request_session_id
from sys.dm_tran_locks
where resource_type='DATABASE' AND DB_NAME(resource_database_id) = @database
open c1
fetch next from c1 into @spid
while @@FETCH_STATUS = 0
begin
-- Don't kill the connection of the user executing this statement
IF @@SPID <> @spid
begin
-- Construct dynamic sql to kill spid
set @killstatement = 'KILL ' + cast(@spid as varchar(3))
exec sp_executesql @killstatement
end
fetch next from c1 into @spid
end
close c1
deallocate c1
exec msdb.dbo.sp_delete_database_backuphistory @database
exec master.dbo.sp_detach_db @database, 'true'
END
END
Possibly I was not detaching the databases in a "clean way" and my system databases are now corrupted ? Is such a case, what should I do in addition to the code here above to correctly detach the databases ?
View 3 Replies
View Related
Jul 19, 2007
Hi all I've written an app using VWDE and SSE 2005 but it wont work on my hosts. I'm sure the connection string is correct and my hosts say it's all setup ok over there. I get this message: The SSE Provider did not find the database file specified
in the connection string. At the configured trust level (below High
trust level), the SSE provider can not automatically create the
database file. And my hosts says that the db should be fine but some of the VB might not work, this is the line that's causing the issues (red): Line 15: Session("username") = loggedInNameLine 16: Line 17: a = Roles.GetRolesForUser(loggedInName)Line 18: Line 19: For Each j In aThis works fine in SSE 2005, should it work on SQL Server too? Can anyone suggest an alternative? ThanksMark
View 21 Replies
View Related
Aug 26, 2002
Can someone help me. here is a diagram of what I need:
http://www.sfasource.com/stuff/relationship.gif
Thanks in advance,
Kevin
View 1 Replies
View Related
Jul 20, 2005
Hello all,I am a total newbie to SQL. I created this sp and then with C++,called it. My return value was 100 (which it was)CREATE PROCEDURE sp_StoreIPs@IPSource varchar(16),@IPTarget varchar(16),@TimeDate varchar(20),@Name varchar(250)asdeclare @iReturn intSet @iReturn = 100return @iReturnGOThen when I added a INSERT statement like ...CREATE PROCEDURE sp_StoreIPs@IPSource varchar(16),@IPTarget varchar(16),@TimeDate varchar(20),@Name varchar(250)asdeclare @iReturn intInsert into LookUP (IPSource, IPTarget,TimeDate, Name) Values(@IPSource,@IPTarget,@TimeDate,@Name)Set @iReturn = 100return @iReturnGOMy return value was 0. I am assuming the the INSERT statement isreturning the 0 but how can I get around this?ThanksRalph Kraussewww.consiliumsoft.comUse the START button? Then you need CSFastRunII...A new kind of application launcher integrated in the taskbar!ScreenShot - http://www.consiliumsoft.com/ScreenShot.jpg
View 2 Replies
View Related
Aug 1, 2006
after we download sp1 and hit runj, we got "Unspecific Error Occur" popup window, with message:The following unexpected error occur:" then without any detail. here is the hotfix log:
Please help
08/01/2006 14:33:51.967 ================================================================================
08/01/2006 14:33:51.967 Hotfix package launched
08/01/2006 14:33:51.967 Successfully opened registry key: SOFTWAREMicrosoftWindowsCurrentVersion
08/01/2006 14:33:51.967 Successfully read registry key: CommonFilesDir, string value = C:Program Files (x86)Common Files
08/01/2006 14:33:51.967 Successfully opened registry key: SOFTWAREMicrosoftWindowsCurrentVersion
08/01/2006 14:33:51.967 Successfully read registry key: ProgramFilesDir, string value = C:Program Files (x86)
08/01/2006 14:33:52.014 Successfully opened registry key: SOFTWAREMicrosoftWindowsCurrentVersion
08/01/2006 14:33:52.014 Successfully read registry key: CommonFilesDir, string value = C:Program Files (x86)Common Files
08/01/2006 14:33:52.014 Successfully opened registry key: SOFTWAREMicrosoftWindowsCurrentVersion
08/01/2006 14:33:52.014 Successfully read registry key: ProgramFilesDir, string value = C:Program Files (x86)
08/01/2006 14:33:52.014 Local Computer:
08/01/2006 14:33:52.014 Target Details: ISSQL05
08/01/2006 14:33:52.014 commonfilesdir = C:Program Files (x86)Common Files
08/01/2006 14:33:52.014 lcidsupportdir = e:1af2e497cde069647713331033
08/01/2006 14:33:52.014 programfilesdir = C:Program Files (x86)
08/01/2006 14:33:52.014 supportdir = \ISSQL05e$1af2e497cde06964771333
08/01/2006 14:33:52.014 supportdirlocal = e:1af2e497cde06964771333
08/01/2006 14:33:52.014 windir = C:WINDOWS
08/01/2006 14:33:52.014 winsysdir = C:WINDOWSsystem32
08/01/2006 14:33:52.014
08/01/2006 14:33:52.014 Enumerating applicable products for this patch
08/01/2006 14:33:53.530 The patch installation could not proceed due to unexpected errors
08/01/2006 14:33:53.530
08/01/2006 14:33:53.530 Product Status Summary:
08/01/2006 14:33:53.780 Hotfix package closed
View 3 Replies
View Related
Apr 29, 2002
A database with 1 mdf and 2 ldf has been detached from SQL Server 7.0 . Then removed the log files ( they are gone , unable to recover ) and there's no backup at all . Now I want to attach the database with the same mdf , but got error msg - 'Device activation error'. It seems like it's looking for one of the log files.
Is there any way to recover the db ?
I guess NOT , isn't it ?
I don't understand why it doesn't work with sp_attach_single_file_db and sp_attach_db . I actually tested it with a dummy database with 1 log file , and it worked - a new log file was recreated. Thus I performed in production server. Don't understand why it doesn't work.
thanks in advance.
View 4 Replies
View Related
Jul 2, 2003
I have been down for 10 days now and don’t know where else to turn. If you can’t help, pls point me to where I can get help.
Here are the facts I have posted several times to the MS SQL NGs.
(Server: Win2K Adv Server, SQL 2K w/sp3a,
Wkstn: Win2K pro, SQL 2K w/sp3a)
1) SQL server is running and I can access all the dbs when on the server.
2) All the workstations login to the server just fine. Server is configured for Active Directory.
3) SQL server has only the default instance installed and is in mixed authentication mode.
4) I have registered SQL Server in the Active Directory, (right click on the server node in the SQL Server Enterprise Manager and select the Properties item from the popup menu … Active Directory tab etc - as per the article "SQL Server 2000 Active Directory Integration”.
5) When in EM on the workstation, I try to create a sql server registration
a) With Windows authentication - but I get this error:
SQL server registration failed because of the connection failure
displayed below. Do you wish to register anyway?
Login failed for user '(null)'. Reason: Not associated with a trusted SQL server connection.
b) With user = sa and pwd = sa (both are the correct values and case)
SQL server registration failed because of the connection failure
displayed below. Do you wish to register anyway?
Login failed for user 'sa'
5) I have checked out
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B269587 and done
everything it says.
Help - I haven't been able to connect for several days.
I have tried deleting the registrations several times - same results.
I have tried uninstalling sql 2K and reinstalling 3x and tested before and
after installing sp3a - same results.
Anyone have any ideas?
View 10 Replies
View Related
Feb 12, 2008
I have been asked to see what I can recover from a development server whose database became suspect during a power failure.
One developer from another group who's time is limited tried to repair the database using checkdb, but it is still suspect.
There are no recent backups of anything whatsoever. Needless to say, we are lacking in DBA skills here. At this point, we don't care whether we get the data back, but we are desperate to recover the table definitions, user-defined functions and stored procedures -- if not all of them than most of them; if not most of them than some.
What are our options here?
Are their any good third-party tools to help us with this problem?
View 20 Replies
View Related
Mar 29, 2007
hello ppl.......
've installed sql 2005 xpress with advanced services......also installed the toolkit that came along..
all 'm interested in is to perform certain data mining operations on the adventureworks db..
;ve also installed the advn works db.........
now here is the prob.......
jus like how the sql online book instructed me i first started off with the datamining tutorial..where i was told to first OPEN BIDS select new PROJECT then make sure that the analysis Services template was selected and then go ahead with selection of the particular sln file....
the problem is that I DON'T SEE ANY ANALYSIS SERVICE TEMPLATE....all i c is a REPORT template..
i really need help guys..... 'm new to .net really feeling helpless...
please hurry guys....
thx a ton..
hanish
View 5 Replies
View Related
Jul 20, 2005
Hi All,I am close before throwing the machine out of the window.I tried to establish a linked server on our SQL2000 server pointing to a DB.EXEC sp_addlinkedserver@server = 'DB2',@srvproduct = 'IBM OLE DB Provider for DB2 Servers',@provider = 'IBMDADB2',@provstr='DSN=JDE_PROD;UID=XXXX;PWD=XXX;DATABASE=J DE_PROD;'EXEC sp_addlinkedsrvlogin 'DB2', false, NULL, 'XXX', 'XXXX'If I query the LS using query analyzer or the Enterprise Manager both startto hang, never responding again.To be honest I am quite new to this topic but I read a lot and also tried alot ;)Some articles talk about SNA Servers to be installed first, others aboutsome client tools.I am confused by now...Could anybody please be so kind and tell me how to connect the DB2 as alinked server?Is my statement wrong, and if so how should it look like? Why does theapplication start to hang? Do I really need to install additional softwareto do so?Our DB2 expert also taked about software necessary to access the DB2mainframe. Any ideas?Thanks a lot in advance and belive me, any hints are highly appreciated ;)Seize the DayAndyAndreas BretlJoin Bytes!
View 4 Replies
View Related
May 11, 2007
After try and error for several months, finally my SQL2000 LS works.
i gave my self a little celebration for that.
but after running well for a day, just one day !
this morning it give me Out of Sync.
error messages:
failure /4305
activity : Load
[Microsoft SQL-DMO (ODBC SQLState: 42000)]
Error 4305: [Microsoft][ODBC SQL Server Driver][SQL Server]The log in this backup set
begins at LSN 7000000026200001, which is too late to apply to the database. An earlier
log backup that includes LSN 6000000015100001 can be restored.
[Microsoft][ODBC SQL Server Driver][SQL Server]RESTORE LOG is terminating abnormally.
activity : Copy
failure / 32
The process cannot access the file because it is being used by another process.
i just dont understand, how come the load & copy process failed, after it works for a day.
View 6 Replies
View Related
Mar 5, 2007
Hi ,
Technically i am a network administrator, and know very little about SQL 2005, but it has come under my responsibility to manage this box and a lot depends on fixing this problem for me.
Error:
Service Broker needs to access the master key in the database 'Prototype'. Error code:25. The master key has to exist and the service master key encryption is required.
Also, i get the following both in windows event viewer and SQL logs;
Error:
Source: Logon
Message
Error: 18456, Severity: 14, State: 5.
Login failed for user 'logadmin'. [CLIENT: 192.168.1.2] Event ID 18456;
Login failed for user 'admin'. [CLIENT: 192.168.1.34] Event ID 18456
Symptoms:
While users are working and try to run a new query, their credentials are not accepted anymore. The account they are using is has "sysadmin" rights.
Once they restart the machine, they can run multiple queries, and then the same thign over again.
Please help me with this one, for i have pretty much exhausted google etc. I mean there are various blogs with same prblem but not a straighforward fix.
I would appreciate your help very very much.
Best Regards,
Umer.
View 3 Replies
View Related
Aug 31, 2006
I hope anyone can help me with this. I am having problems connecting to the aspnet database. It
all started when I noticed that I could not log in to my webapplication
anymore under debug mode, although I was able to log in when remotely
accessing the website. I got the error message that the machineaspnet
user did not have access to the database: "Login failed for user
'GM-FEDORSASPNET' "This was highly peculiar and rather annoying so I tried several things to straighten this out, but it only made things worse!I
read that this had to with permissions of the database in question, al
though I could not understand why permissions suddenly had changed. I
tried to change the rights by attaching it to Management Studio Express
and defining an aspnet login, but that failed because a login under
that name was not accepted. I tried to make a copy of aspnet.mdf, delete the original and rename the copy to aspnet.mdf. When that didn't work, I then deleted the aspnet.mdf, counting on it that it would be regenerated automatically, but alas. I located the aspnet_regsql.exe tool to regenerate the database, but got the following error message: System.Web.HttpException:
Unable to connect to SQL Server database. --->
System.Data.SqlClient.SqlException: An error has occurred while
establishing a connection to the server. When connecting to SQL Server
2005, this failure may be caused by the fact that under the default
settings SQL Server does not allow remote connections. (provider: Named
Pipes Provider, error: 40 - Could not open a connection to SQL Server)What can I do?
View 4 Replies
View Related
Jan 18, 2008
Good morning all. I need some help with a stored proc that is driving me up a wall. It's probably something stairing me right in the face but I can't see it!
I keep getting the following error on the procedure that I'm working on:
SQL-DMO (ODBC SQLSTATE: 42000)
ERROR 156: Incorrect syntax near keyword 'AS'
Must declare the variable '@signid'
Must declare the variable '@signid'
Here's the code:
CREATE PROCEDURE [dbo].[ws_savesignature2db]
@xml as text='',
@image as image='',
@imageformat as varchar(20)='',
@imagename as varchar(40)='',
@imagesize as int=0,
AS
insert into signaturetable
([image], imageformat, imagename, imagesize)
values
(@image, @imageformat,@imagename,@imagesize)
/*
if your XML field datatype is Text or nTEXT, use the code below in Sql Server 2000.
If you use Sql Server 2005, you can use varchar(max) or nvarchar(max) which will be
much easier and you do not need the code.
*/
select @signid = @@IDENTITY
DECLARE @ptrval binary(16)
SELECT @ptrval = TEXTPTR([xml])
FROM ws_signature
WHERE signid= @signid
if @ptrval is not null
WRITETEXT ws_signature.xml @ptrval @xml
GO
Any help you can give would be a life saver!!!!
Thanks in advance.
Jim
View 3 Replies
View Related
Aug 5, 2007
I own a DELL dimesnsion 4600 desktop. I purchased it with windows xp HOME although I have upgraded to windows xp professional. I am trying to install Office Enterprise 2007 with the disk i purchased. My computer will not pick it up though. I know the cd works because I tried it on another computer but didnt intsall it. That computer read the disk. My computer will not. any help? desperate need
View 1 Replies
View Related
Jul 20, 2005
Does anyone have any basic, simple scripts of sp's that I can give mycomputer operators to use to monitor for serious conditions on our sqlservers? We are new in the ms-sql arena, a small shop and we cantreally purchase any tools to monitor these servers, but we need somebasic checks that we can use to make sure a server is performing in areasonable fashion, no blocks, cpu<xx%, memory not pegged, IO working,etc...and we need to be able to do this without bugging ourprogrammers every time we are wondering why things are slowwnig down.We are a split shop between as400s and sql servers, and our operationsstaff has no problem performing this type of duty on the 400s. I thinksince the sql servers are so easy to deploy into production, the ideaof how to monitor these things health got lost in the shuffle andallowing the programmers to do it just serves to destabilize ourenvironment.Please help! Our shop has turned to chaos since we went live withMSSQL centric applications and everytime one programmer "resolves anissue" some other programmers application starts to act up.
View 6 Replies
View Related