How to modify a table name without drop it and recreate it using T SQL. Suppose the SSMS is not installed or reachable.
View Complete Post
I am trying to convert a stored procedure to a table valued function and the performance has taken a HUGE hit and I was wondering if there was anything that can be done about it. Since a table valued function can not use #temp tables it must be converted
to a @temp table variable.
Here are some steps I have already taken...
The original stored proc starts off by populating a #temp table via "Select x Into #temp ..."
Leaving it a stored proc for now, I explicitly created the #temp table and did an "Insert Into ... Select From" to more closely model how it must work when using a @temp table variable. There was no discernible performance difference.
Still leaving it as a stored proc, I then swapped out the #temp table with the @temp table variable and now, all of the sudden, the performance drops from sub-second to over a minute!!!
The temp table only has one field defined as an int and it is distinct, so I tried making the field the Primary Key to see if that would help and it did not.
The temp table is created by scanning a table with around 11,000 rows and the temp table itself has about 4400 rows in it (if it makes a difference to anyone).
Does anyone have any suggestions (or hope) for me?
I am followint the insructions of this walkthrough of VS2003
adn in a part say this
Now i am using VS2008
When i try to drag and drop i can not made it is maybe because of the differences between 2003 and 2008 versions
how can do it in VS2008?
I'm trying to drop some tables and I created a curser to do so.
The table name is a parameter.
I get an error message when I run this code in the curser.
Is there any way to run this code in a different way.
I'm trying to drop databases as well where database name is a paramerter, can I do so?
@FullDatabaseName How to modify the drop-downlist in i top-meny How can I modify the drop-down-list i the top-meny so that i shows all the lists, sites ang pages within that entering?
I have a group of developers that are creating stored procedures, in them they are dropping a table and re-creating the table and then continuing with the processing. My question is if there is any difference between the effect of dropping a table
and truncating the table on database fragmentatiom.
my one table consists of fields (id, flying from, flying to). thus i have one drop down for flying from and another drop down for flying to. i'm hoping to cascade them so 2nd drop down values are dependant on the values from 1st drop down. is it possible to do this using a single table? or must i use two tables and link the id's from both? and do i write anyting in the SelectedIndexChange event? thanks...
the sqldatasource code looks like this:
<asp:DropDownList ID="ddlFlyingFrom" runat="server" DataSourceID="SqlDataSource1" DataTextField="FlyingFrom" DataValueField="Id" AutoPostBack="True" OnSelectedIndexChanged="ddlFlyingFrom_SelectedIndexChanged"> </asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString %>" SelectCommand="SELECT [Id], [FlyingFrom] FROM [Flights]"></asp:SqlDataSource> &nb
I have made a new sql user and add him to my database role called MyRole,then i add permissions on the rolles in dbo schema permissions options,all of my data tables are in default dbo schema.But when i try to modify my data table i can't it say somthing
"You are not logged on as the database owner or system administrator.You might not be able to save changes to tables that you do not own.
Certain edits require CREATE TABLE permission."
I'm used to Dreamweaver where this is possible. I find it hard to believe that I would need to use a 1 column gridView control.
Is there a way to drag one field from the db Explorer window onto my page and NOT get a grid view?
Or alternatively, I used to be able to put something like this in ASP classic (years ago!) <%= Eval("User") %>
Any help would be SO appreciated.
I have a stored procedure that builds a table. I need to delete the table before running it or I get an object already exists error. How do you code Drop Table in C# code behind. I have am calling the SP with execute non-query statement.
Can any one help me on the below error.I have a transactional replication (pull). All of a shudden it failed to transfer the data. The error message isThe concurrent snapshot for publication 'Woolworths Petrol - Filtered' is not available because it has not been fully generated or the Log Reader Agent is not running to activate it. If generation of the concurrent snapshot was interrupted, the Snapshot AI tried to reinitialize the subscriber and it pops up the below message. Cannot drop the table 'table_name' because it is being used for replication. (Source: MSSQLServer, Error number: 3724)I don't want to drop the table.Please help.CHIN
I'm almost there.
The problem: Using smo, I'm having trouble re-creating a DefaultConstraint on a column after dropping it.Where this stems from: I need to change a column from nvarchar(x) to nvarchar(max).
(The ms help is useless, showing no examples for working with default constraints. No searches show people using smo to solve this.)
The conceptual problem is that you can't change a column's size if a "DefaultConstraint" exists on the column. You must drop the DefaultConstraint, then change the size of the column, and then re-create the DefaultConstraint.
Variables not shown: The variable "AColumn" below has been populated with a smo column object (Name:"SsGradeString"), and the variable "Size" is the desired size to change the column to.
The error occurs on AColumn.AddDefaultConstraint(DName), error message:"Column SsGradeString already has a default."
I tried doing Table.Alter, Column.Alter, DefaultConstraint.Alter (after the .Drop), but I get: "Cannot access properties or methods for the Microsoft.SqlServer.Management.Smo.DefaultConstraint '[DF_ADVSessions_SsGradeString]', because it has been dropped."
'preserve existing values for re-creation of DefaultConstraint'NOTE: AColumn is the column we are working with and Size is the new size to set.