Tell me please what's the best way to copy db structure to another server?
I'm trying to generate a script in Management Studio and then run that script on the remote machine. And I hate that thing. It works unpredictable, you have to fix manually a lot of crap in the generated script. I guess that isn't the best solution.
Then I tried...
Hi, database/SQL novice here.
I have a table with a column called, for example, "EmployeeID". I want a query that will, for each distinct employeeID, return the number of rows that have that as their ID. I hope it's clear what I'm trying to do and someone will know how to help!
I don't think it should matter, but just in case, I'm usin...
Could someone please define what is meant by a schema provider? I'm familiar with DB schema (in this context, I take them to mean a named, logical container for DB objects). Why would a schema provider be useful? From a high level, how do they operate?
The context here is SQL Server 2008.
...
I need to give a new login read access to all 300 databases on a server. How can I accomplish this without checking 300 checkboxes in the user mapping area?
...
I am having trouble running a simple sql query in Microsoft SQL Server 2005 to create a database and im not sure why.
When I run this query
CREATE DATABASE 4444-virtual2
I receive this error
Incorrect syntax near '4444'.
Is there anything in particular that I must specify if I am creating a database table with numeric values in...
Am attempting to use SSIS flat file source to read a log file being actively written to. Looping and waiting for the file to be released is not practical as this is an active log file held by a service.
Ideally, I'm looking for a setting upon the flat file source, similar to the C# code below. If not that, what route can I take to rea...
I have several query results that use one or more aggregate functions and a date GROUP-BY so they look something like this:
Date VisitCount(COUNT) TotalBilling(SUM)
1/1/10 234 15765.21
1/2/10 321 23146.27
1/3/10 289 19436.51
The simplified SQL for the above is:
SELECT
...
I'd like to find all referencing tables in my db that have a foreign key that points to a specific referenced table. Is there a query that I can run to do this?
Not sure if the question is confusing. Let me know if it is and I can try to explain it in more detail.
...
Hello,
I want to add custom columns to some tables created by ASP.NET.
For example; I need to add two fields such as FirstName and LastName to the aspnet_Membership table.
I can add this directly by editing the table but;
Is this the right thing to do (I mean; extending the table directly) OR should I create a separate table and ho...
Is there a way to include a blank row at the top of a sql query, eg if it is meant for a dropdown list? (MS Sql Server 2005 or 2008)
Select *
FROM datStatus
ORDER BY statusName
Where I want something like
-1 (please choose one)
1 Beginning
2 Middle
3 Ending
4 Canceled
From a table that is ordinarily just the...
I made a custom view for a group of three tables. How would I configure the view so that it can be edited by an application using it like a table? I am using SQL Server Studio Express.
...
i have a table in which there are ids and resigning dates.
a singlle id have more than one resigning date.
how can i display the table in which one id have only one resigning date which is the latest ie the maximum date.
can somebody help me plzz....thanx a ton
...
In my Program I'm calling a Stored Procedure through asynchronous call
connection.Open();
IAsyncResult ar = cmd.BeginExecuteReader();
While executing the Page, If I click back button Page will be redirected to other page but the front-end objects cannot handle the back-end processing.
How can I stop running the Stored procedure?
...
Hello All:
Can any body help me in understanding if the execution plan for functions cached in SQL server?
Any online resource for this?
Thanks
Ashwani
...
I'm trying to clean up a database table and I'd really like to drop two columns as they should no longer be being used.
'Property' table
- Unable to modify table.
The index '_dta_index_Property_7_669245439__K1_K9_K8_K24_K4_2_5_6_13_22_25_26_29' is dependent on column 'AveragePriceMta'.
The index '_dta_index_Property_7_669245439__K1_K9...
I want to realize an offline scenario where client and server are SQL Server databases.
Preferably with SQL Server Change Tracking.
Is that possible and a reasonable option at all?
From trying out it seems to me the only sql server to sql server sync is in collaboration mode and doesn't leverage sql server change tracking. (SqlSyncProv...
Hello,
I've a SP using a LIKE. Let's simplify it to: SELECT * FROM customers WHERE name LIKE '%' + @query + '%'.
I'd like to use it for an (optional) exact match search without altering the SP but with a tricky parameter ;)
Is there a way to "cancel" the 2 '%' with a clever @query?
Thanks.
...
If I try to execute below query:
EXEC sp_rename 'ENG_TEst.[ENG_Test_A/C_TYPE]', 'ENG_Test_AC_TYPE', 'COLUMN'
I get an error:
Either the parameter@objname is
ambiguous or the claimed @objtype
(COLUMN) is wrong.
How can I solve it?
...
I've got a scenario when sometimes a user selects the right parameters and makes a query which takes several minutes or more to execute. I cannot prevent him to select such a combination of parameters (it's quite legal), so I'd like to set a timeout on the query.
Note that I really want to stop the query execution itself and rollback an...
I have a table that has over 148,000 rows, I have managed to display this by doing:
<%response.Buffer=false%>
However, this is far from ideal as it needs to be done on the server and it takes so long. Is there a better way of doing this?
Many Thanks,
Joel
...