i see there is "arrange tables" that organizes your table relationships to be clear. is there anyway to autosize the tables so it shows:
the full name of the table
the full height to show all fields.
i find myself tweaking tables over and over manually and its a pain. I would hope there would be some way to auto correct the sizing ...
Hi every one .
I'm work on project in c# ,and I want to generate data from my db and pass it to the server just when I need to do that, so I can then run this file on server , Can I generate this file from c#?
and how can I generate file like this from sql:
SET NOCOUNT ON
GO
USE master
GO
IF EXISTS ( SELECT *
FROM sys...
How can we handle ascii characters using sql server 2005? Which data type can I use to store ascii characters, mainly control characters?
For example: I have a file with strings delimited by some control characters like backspace. I need to read this file into my sql server tables. I want to know what data type (char,nchar,varchar, .....
Is there a way to check a CASE when it's in an array:
SELECT CASE [Option] WHEN IN (1, 3, 99) THEN 'Wrong option' ELSE 'You go!' END
...
Hi Guys,
The database I'm currently working on is for a scientific instrument that records data at certain points in time. My instrument records per second, but with a resolution of 5 seconds.
ID Total Particles DateandTime
38313 602 2009-01-27 16:25:48.000
38314 602 2009-01-27 16:25:49.000
38315 ...
I want to filter records on 'Email' my query is like this.
SELECT * FROM #temp WHERE email NOT IN (SELECT email FROM Customer)
It gives me following error
Cannot resolve the collation conflict
between "SQL_Latin1_General_CP1_CI_AS"
and "Latin1_General_CI_AS" in the
equal to operation.
I can use collate if there is equal op...
I am transferring a database from one hosting provider to another. The current provider uses the domain name as part of the user name. The domain name is a .co.nz domain. So some objects in the database have a fully qualified name of [email protected].
Im trying to alter the schema of these objects to put them into a dbo sche...
I have tables like lg-010-a..., lg-010-ac..., and so on, I have abc database,
I have a command window:
drop table from abc where Table_Name like 'lg-010-%'
Will this drop all the tables starting with lg-010-?
...
In SQL Server 2008 Management Studio, when I right click on a database table and choose "Select Top 100 Rows", I can then e.g. easily add a "ORDER BY " statement to the SQL. That works fine.
But when I do choose "Edit Top 200 Rows", I don't have the ability to alter the SQL (which makes it hard to find and edit a record just added in th...
Sorry for my english :).
I have a windows service. Service report some excel files weekly. But ı got a"OLE DB provider 'SQLOLEDB' reported an error. The provider ran out of memory" Ole Db error. Service use SQl Server 8.00.194 and it link another SQL Server. I do not know why ı receive this error. Thanks for help.
...
I'm trying to do this query
INSERT INTO dbo.tbl_A_archive
SELECT *
FROM SERVER0031.DB.dbo.tbl_A
but am getting the following error message even after i do
set identity_insert dbo.tbl_A_archive on
An explicit value for the identity column in table 'dbo.tbl_A_archive' can only be specified when a column list is used and I...
i want to create table to keep histroy of the ammendments & history of the object.
for That i have created two column Primary Key ( Id & update date)
I have 3 more date columns to maintain history & Status Column for Actual object history.
Status , StatusFrom , Statusto, UpdateDate & NextUpdateDate
UpdateDate & NextUpdateDate is for ma...
I get a bizarre execution plan behavior from SQL Server (2005).
Table:
TableName: LOG
ID int,
Name varchar(50)
(Table contains around 1000 rows)
Query:
Select * FROM
(
SELECT ROW_NUMBER() OVER (ORDER BY ID DESC) as Row,
ID, Name
FROM Log
)
as LogWithRowNumbers
WHERE Row>=1 and Row<=2
It estimates the number of rows returned a...
I think it's a basic SQL question...sorry..new to it... :-)
I want to execute a SP inside which
{
I want to execute a SP (using EXEC) and depending on it's result I want to execute another query (INSERT) which if fails for any reason should revert back what the SP has done?
}
How can I do this?
Transactions? If yes, how?
PLEASE...
I got a little problem.
I'm using Full outer Join in Sql server - so far it works
but now I add a table and it doesn't work as it should.
Here is my code:
SELECT *
FROM Table1 h , (db1..Table2 s FULL OUTER JOIN db1..Table3 k
on k.attributT3_1 = s.attributT2_1
and left(k.attributT3_2,4) = year(s.attributT2_2)
and substring(k....
I'm storing some data using NHibernate, and I need to insert huge amount of data as a part of this action - i.e. in the same transaction. Code looks like this:
using (ISession session = NHibernateHelper.OpenSession())
using (ITransaction transaction = session.BeginTransaction())
{
session.SaveOrUpdate(something);
// ...
Sq...
Hi
I have a field with the following content in a record in my SQL Server database:
salsaaften
It means "salsa evening" in danish for those interested :)
When I do like this I am not able to find the record:
SELECT * FROM table_name WHERE field_name LIKE '%salsa%'
However, when I do this, I find the record perfectly fi...
I'm having a hard time getting my head around a query im trying to build with SQL Server 2005.
I have a table, lets call its sales:
SaleId (int) (pk) EmployeeId (int) SaleDate(datetime)
I want to produce a report listing the total number of sales by an employee for each day in a given data range.
So, for example I want the see all sa...
Right now the query below is retrieving more then one product record. How can I limit the results set to only retrieving the one record per product_ID? Multiple records will be returned from different products, but I only need one product line per product_id. This is MS SQL 2005
SELECT DISTINCT dbo.Products.Product_ID AS Expr1,
...
FYI: SQL Server 2005
I have a database user account (user_web) that has the ability to connect to and run queries and stored procedures in my database. Specifically, I have given the user the db_datareader and db_datawriter roles as well as granted them execute permission on the specific stored procedures it needs to be able to run.
In...