Hello, Everyone.
While I do not completely understand why I can't seem to find the stored procedure I am looking for by name straight from the collection, I did come up with a solution.
If you use Linq, you can find your item.
StoredProcedure storedProcedure =...
Hello, Everyone.
I am using Sql Management Objects (SMO) in Visual Studio 2012 C#.
I am attempting to instantiate a new StoredProcedure object from the db.StoredProcedures Collection.
When I try to find a stored procedure in the [dbo] schema. It works fine.
StoredProcedure sproc =...
Hello, Everyone.
I resolved this a while back. I came here to post another question and thought I would update this post for future search engine users.
This won't compile out of the box since I am passing in variables to the method, but hopefully it will help someone in the future...
Hello, All.
I have a query where I am looking for tables that end in _AM.
SELECT sch.[name] AS SchemaName, tab.[name] AS TableName
FROM sys.Tables AS tab
JOIN sys.Schemas AS sch
ON tab.schema_id = sch.schema_id
WHERE tab.[name] LIKE '%_AM'
AND sch.[name] = 'dbo'
I get back:
dbo...
Hello, Everyone.
I am new to SMO, so I do not know the accepted methodologies.
From my attempts, it appears that I am way off track on how to use this set of tools. Suggestions and guidance appreciated.
This is the error.
"An unhandled exception of type...
Thank you, gmmastros. That is perfect.
fredericofonseca
I googled these before posting. Just didn't find anything about clustering.
This gets me my primary keys
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tab
JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE AS col...
I was curious if there was a way to query in tsql whether or not a table's key in clustered or not using table_name or object_id or whatever is best?
Here is a table that has a clustered primary key set. I know that there are tables in my database that are Not clustered on the pk and I will...
Hello, Everyone.
I am trying to do some automated re-creation of some tables in Sql Server 2008.
When you right click a table, you can choose 'Script table as' and get everything you need to know to re-create the table.
I was curious if there was a way to do this using tsql that I could read...
Certainly looks like it worked.
Scripted table.
CREATE TABLE [dbo].[BendInspection](
[BendInspectionID] [int] IDENTITY(1,1) NOT NULL,
[TemplateVersionID] [uniqueidentifier] NOT NULL,
[ReportTypeID] [int] NOT NULL,
[ReportID] [uniqueidentifier] NOT NULL,
[GeneralInformationInspectionDate]...
Good day everyone.
My boss said to me 'Do not put a clustered index on the identity. I want to look at the data later and decide what to cluster on.'
I have a snippet of code. It functions, but I am not sure that I completely grasp what is happening when I run it.
Here is my snippet that I...
Hello, All.
I have an html table. The first column is a drop list with the days of the week in it Sunday through Saturday. Second column is two text boxes for start time and end time. The other column is a drop list (true/false). In the html, each row (other than the header) has a GUID for...
Hello, Everyone.
For years I went to the File Menu and chose Help->About and that would tell me everything about my version on the About Page.
Then Outlook switched to the Ribbon and Tabs and got rid of the File Menu.
At that point, I would click the File Tab and 'Help' was an option there...
Thank you for your input everyone.
@bborissov. Yes, the sql certainly runs in the EXEC() but it does not return the record set to the stored proc. I need to manipulate the table.
@gk53. Very good point.
@SaltyTheFrog. Thank you. I will see how this affects race conditions for nearly...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.