Hi, I have found that SP2 doesn't execute from within SP1 when SP1 is executed.
Below is the structure of SP1:
ALTER PROCEDURE SP1 AS BEGIN
Declare c1 cursor....
open c1 fetch next from c1 ...
while @@fetch_status = 0 Begin
...
Fetch Next from c1 end
close c1
deallocate c1
exec sp2
end
...
I need a programmatic way of creating a SQL Server ODBC Data Source. I can do this by directly accessing the Registry. It would be better if this could be done via an available (SQL Server/Windows) API to protect against changes in the registry keys or values with updated SQL Server drivers.
Accepted Answer Note: Using SQLConfigDataSour...
Hi, How can I reset the @@FETCH_STATUS variable or set it to 0 in a stored procedure?
...
The application I am currently working on generates a lot of SQL inline queries. All generated SQL is then handed off to a database execution class. I want to write a parsing service for the data execution class that will take a query like this:
SELECT field1, field2, field3 FROM tablename WHERE foo=1 AND bar="baz"
and turn it into so...
I'm trying to perform a bitwise NOT in SQL Server. I'd like to do something like this:
update foo
set Sync = NOT @IsNew
Note: I started writing this and found out the answer to my own question before I finished. I still wanted to share with the community, since this piece of documentation was lacking on MSDN (until I added it to the C...
I'm looking for a good tool to script specific data from my database.
In phpmyadmin I was able to write a query and just hit the "export" button to generate insert scripts. I have not yet found anything for MS SQL server that will do this.
It would be great if the tool also offered me the option to do identity inserts or even do delete...
What is the best way to deal with storing and indexing URL's in SQL Server 2005?
I have a WebPage table that stores metadata and content about Web Pages. I also have many other tables related to the WebPage table. They all use URL as a key.
The problem is URL's can be very large, and using them as a key makes the indexes larger and s...
I'm working on an application for a charitable student organization. The application will track participation and fund-raising for (primarily) student participants in an event. One of the things we'd like to do is collect some demographic information about students who register for the event from our enterprise directory to use in eval...
I'll go first.
I'm 100% in the set-operations camp. But what happens when the set logic
on the entire desired input domain leads to a such a large retrieval that the query slows down significantly, comes to a crawl, or basically takes infinite time?
That's one case where I'll use a itty-bitty cursor (or a while loop) of perhaps most d...
I have this query in sql server 2000:
select pwdencrypt('AAAA')
which outputs an encrypted string of 'AAAA':
0x0100CF465B7B12625EF019E157120D58DD46569AC7BF4118455D12625EF019E157120D58DD46569AC7BF4118455D
How can I convert (decrypt) the output from its origin (which is 'AAAA')?
...
I use SQL Server Management Studio 2005(SSMS) for most of my T-SQL and general SQL DB maintenance, but one thing that I would love to change is the level of detail the title bar gives you about each instance of SSMS you have open.
I would love to be able to see the connected server from the active tab at the very least.
e.g.
Any i...
In SQL Server 2005, is there a way of deleting rows and being told how many were actually deleted?
I could do a select count(*) with the same conditions, but I need this to be utterly trustworthy.
My first guess was to use the @@ROWCOUNT variables - but that isn't set, e.g.
delete
from mytable
where datefield = '5-Oct-2008'
se...
Please note that the same question already has been asked in http://stackoverflow.com/questions/111341/combine-multiple-results-in-a-subquery-into-a-single-comma-separated-value, but the solution involves creating a function. I am asking if there is a way to solve this without having to create a function or a stored procedure.
I have ...
I need to copy several tables from one DB to another in SQL Server 2000, using C# (VS 2005). The call needs to be parameterized - I need to be able to pass in the name of the database to which I am going to be copying these tables.
I could use DTS with parameters, but I can't find any sample code that does this from C#.
Alternatively,...
In SQL Server 2005, is there a way for a trigger to find out what object is responsible for firing the trigger? I would like to use this to disable the trigger for one stored prodecure.
Is there any other way to disable the trigger only for the current transaction? I could use the following code, but if I'm not mistaken, it would affect...
My database contains three tables called Object_Table, Data_Table and Link_Table. The link table just contains two columns, the identity of an object record and an identity of a data record.
I want to copy the data from DATA_TABLE where it is linked to one given object identity and insert corresponding records into Data_Table and Link_T...
I am currently working on a project that will store specific financial information about our clients in a MS SQL database. Later, our users need to be able to query the database to return data from the clients based on certain criteria (eg. clients bigger then a certain size, clients in a certain geographical location) and total it to us...
What is the best way to get the names of all of the tables in a specific database on SQL Server?
...
I have an application where whenever a file is uploaded to a directory, I have to call SSIS to parse the XML file.
Can I call a SSIS directly from a .NET Windows service?
...
I have a polling service that checks a directory for new files, if there is a new file I call SSIS.
There are instances where I can't have SSIS run if another instance of SSIS is already processing another file.
How can I make SSIS run sequentially during these situations?
Note: parallel SSIS's running is fine in some circumstances, wh...