Creating Multiple Tab Deliminted Exports

Mar 28, 2007

Is there a way to read from a table to get values that will be contained within a "where" clause of another SQL statement that can be ready one by one(meaning the same sql statement will be executed mutliple times) that will export a tab delimted file?

View 3 Replies


ADVERTISEMENT

MSSQL Exports To RSS.XML

Feb 21, 2008

Hi,
Is it possible to have sql write a file out as an RSS.XML file?
Basically I have one table with one group by.  The resulting displays:
-----
New Items
  Item 1: Feb 2008 - Widget added to database
  Item 2: Jan 2008 - Cog added to database
New Releases
  Item 1: Feb 2008 - Widget released for sale
  Item 2: Jan 2008 - Cog released for sale
-----
I would like to know if it is possible for MSSQL to export this file as an RSS file so I will be able to have users subscribe to it.   Thanks.

View 2 Replies View Related

Problem With PDF Exports In RS 2000 SP2....

Feb 14, 2006

Hello All,

when we export to pdf, keeptogether functionality is not working properly  in Table.Is this fixed in RS2005?

Does anyone know when rs2005 will be released?.

Thanks in Advance.

 

 

View 4 Replies View Related

Creating A Database From Multiple Databases Accross Multiple Servers

Sep 13, 2007

Hi,

I'm trying to create a database that takes specific information from a number of databases on different servers to make some reporting that we have much easier.

I'm pretty new to SQL so I'm not sure of the best way to proceed. I read an article that suggested I use the OPENROWSET command. The problem is, the version of SQL that came with one of the programmes we use is limited and will not allow you to turn on the allow "Ad Hoc distributed Queries" so the SLQ statement will not execute.

I'm confused why it won't let me to connect through ODBC as I've created a web page that selects data from this database with no problems!

Here is the SQL statement that I've written to make sure it is the correct one (on the msdn library page it said that this was the ODBC connection):

SELECT a.*
FROM OPENROWSET('MSDASQL','DRIVER=(SQL Server);SERVER=APPOLOACT7;UID=sa;PWD=***************',
'SELECT * FROM MDCTestAndDev.dbo.TBL_CONTACT') AS a



I've also created the ODBC connection using the tool on Administration Tools>Data Sources ODBC

Any help would be greatly appreciated (also any ways of selecting from one database and inserting it into another will be helpfull)

Thanks

View 8 Replies View Related

From SQL To Excel 12 Via A DataSet - Exports In Binary (xlsb)

Jan 29, 2008

Hi,
I am experimenting with taking a dataset from SQL and putting it directly into an excel via a DataSet. It works but the exported Excel is in "binary" format. Does anyone know of a way to get it directly into xlsx? I *may* end up doing it in a foreach anyway, but it would be too cool to be able to just transfer my dataset from one connection to another :-).
Thanks, here's my code:

DataSet dsXLData = new DataSet("XL");

string myQuery = "SELECT table1.Email,table2.FirstName FROM Contacts table1, Users table2 where table2.UserID = table1._UserID";

SqlConnection sqlcon = new SqlConnection(DataAcquire.ConnectionString);

SqlCommand comStatus = new SqlCommand(myQuery, sqlcon);
SqlDataAdapter dasql = new SqlDataAdapter();

DataSet ds = new DataSet();

dasql.AcceptChangesDuringFill = false;

dasql.SelectCommand = comStatus;
dasql.Fill(ds, "Export");

string connectionString = @"Provider=Microsoft Office 12.0 Access Database Engine OLE DB Provider;
Data Source=D:xlsBook6.xlsb;Extended Properties=
""Excel 12.0;HDR=YES;""";

OleDbConnection maconn = new OleDbConnection(connectionString);
maconn.Open();

OleDbDataAdapter da = new OleDbDataAdapter();

OleDbCommand comOleDBCommand = new OleDbCommand("CREATE TABLE [Export] (Email char(255), FirstName char(255));", maconn);
comOleDBCommand.ExecuteNonQuery();

OleDbCommand comExport = new OleDbCommand(
"INSERT INTO Export (Email, FirstName) VALUES (@Email, @FirstName)", maconn);


comExport.Parameters.Add("@Email", OleDbType.Char, 255, "Email");
comExport.Parameters.Add("@FirstName", OleDbType.Char, 255, "FirstName");
comExport.UpdatedRowSource = UpdateRowSource.None;

da.InsertCommand = comExport;
da.Update(ds, "Export");
da.Dispose();
comExport.Dispose();
maconn.Dispose();

dasql.Dispose();

sqlcon.Dispose();

View 3 Replies View Related

Exports To Excel The Details Of The Report But I Need Summary

Sep 25, 2007

The trouble I am having is that I have a drilldown report that exports the detail to Excel, but I want the summary exported to Excel.

I perform the following steps but get wrong results. Please help me identify the correct steps for the correct results. Thanks you.

1) Select Matrix.
2) Right click, select Properties.
3) Select tab Groups.
4) Select item in Columns list, click Edit.
5) Select tab Visibility.
6) Select Initial visibility: Hidden, and click okay to the Grouping and Sorting dialog box.

Now I can export summary to Excel okay, but now I can not expand the summary in the report itself, so I do the following:

7) Do one through six above (but do not close dialog box), then click visibility can be toggled by another report item.
8) Select the report item in the Report Item drop down list.


Now the report functions normally in the Reporting Services report web page, but when I export on the summary level, again it exports the detail to Excel, but what I want it to export is the summary.

Ideas?

View 8 Replies View Related

Light Green Exports To Excel As Grey

Jun 23, 2007

Hi All,

I am building reports with red, amber, green highlighting........I am using 'Tomato', PaleGoldenrod' and 'LightGreen'....but the lightgreen turns to grey when exported to excel...



The only green I have found so far that exports ok is YellowGreen but it looks terrible inside a browser....



Is there some way I can get something like LightGreen to export to excel ok? Is there something that I might be able to do or is this a limitation in the rendering to excel?



Thanks



Peter



View 4 Replies View Related

Creating Multiple Instances

Feb 18, 2004

Currently, I am running SQL Server 2000 with the default instance. I know SQL2K can run up to 16 instances simultaneously. I would like to add another instance but am unable to find documentation on how to add it. Books online tells me "about" multiple instances, but not how to set it up. I've obviously missed something somewhere. Can someone please direct me to a document that will help explain "how" to add another instance?

Thanks for your time and your help.

View 3 Replies View Related

Creating 1 Backup For Multiple DB

Oct 23, 2006

is there a way to create one backup from multiple databases ?

View 3 Replies View Related

Creating Multiple Charts

Aug 13, 2007



Hi,

With Report Builder, I created a basic chart using the chart Wizard..

I am wondering If I can create some 5 charts on a Single Page(Webpage), like a Mini Dashboard.

Can someone please guide me in this regard ?

Thanks in Advance for your help.
Regards,
Sundar

View 6 Replies View Related

Creating Multiple Tables?

Jul 31, 2006

Hello,I need to create around 1500 similar tables.Does anyone know how to create them all at once instead of one-by-one?thanks

View 8 Replies View Related

Creating A VIEW With Multiple DATATABLES

Oct 24, 2007

I am still confounded with how to create a VIEW involving multiple DATATABLES in a DATASET.  Could someone point out a MSDN page where I can see this working and how I go about doing this?  Let me re-iterate - I want to create a VIEW that uses JOIN type statements that involves multiple DATATABLES in my loaded DATASET.

View 1 Replies View Related

Creating Multiple Database With T-SQL Script

May 2, 2002

Hi everyone:

I have a question about T-SQL scripting:

I want to create several databases with identical properties: size, name (database1, database2, database5, databaseN), path, etc, and I would want to automate the process

So, I downloaded a good T-SQL script from the Internet, which automates the process of creation of ONE database

The problem is I would like to "put" this script within a bucle sentence; I mean, within a FOR or WHILE sentence, so I could create, for example, thirty identicales DBs without prompting me for the database name (without desktop interaction, I mean)

Here you have the generical T-SQL script:


USE master
GO
CREATE DATABASE emc
ON
( NAME = 'emc',
FILENAME = D:MSSQL7DATAemc.mdf',
SIZE = 5 )
LOG ON
( NAME = 'emc',
FILENAME = 'DMSSQL7DATAemc.ldf',
SIZE = 1 )
GO


If any oy yoy have some similar script for doing this, I would highly appreciate.

Many thx.

View 1 Replies View Related

Creating Multiple Triggers Is Same Sql Script

Jun 14, 2004

I'm trying to use Query Analyzer to create several triggers on different files in the same sql script file. It appears to only allow me to create one trigger at a time in Query Analyzer. How do you separate multiple create trigger statements? Here what I'm trying to do:

CREATE TRIGGER PO_BOL_DELETE ON dbo.PO_BOL
FOR DELETE
AS

INSERT into PO_Back
SELECT *, host_name(), suser_name(), getdate()
FROM deleted
GO

CREATE TRIGGER RECEIPT_DELETE ON dbo.receipt
FOR DELETE
AS

INSERT into receipt_Back
SELECT *, host_name(), suser_name(), getdate()
FROM deleted
GO

View 6 Replies View Related

Creating Multiple Stored Procedures At Once

May 1, 2008

Hey

I am creating a database application that is accessed through a .NET front end.
What I want to do is run a SQL script that will create my DB, create my indexes and enforce my constraints (all of which I have done) but I also want to create my stored procedures in the same script also.

When I merge all my stored procedures (about 16) into one file and run it in SQL Query Analyzer I get multiple errors but the one that is coursing me the most bother is

‘Server: Msg 156, Level 15, State 1, Procedure procedureName, Line 134
Incorrect syntax near the keyword 'procedure'.’

What does this mean and why can’t I run more than once Stored Procedure at once?


Many thanks

Quish

View 2 Replies View Related

Creating Multiple Foreign Key Constraints On A Key?

Feb 21, 2015

CREATE TABLE IssueLog (
ItemNo int NOT NULL IDENTITY PRIMARY KEY
REFERENCES IssueProgress (ItemNo)
ON UPDATE CASCADE
ON DELETE CASCADE,
REFERENCES Approvals(ItemNo)
ON UPDATE CASCADE
ON DELETE SET NULL,

Msg 142, Level 15, State 2, Line 0

Incorrect syntax for definition of the 'TABLE' constraint.

I'd like to update or delete the IssueProgress plus update and setting null to the Approvals tables at the same time whenever the ItemNo of the parent table namely IssueLog is updated or deleted.

How can I achieve this?

View 1 Replies View Related

Creating Multiple Stored Procedures In One Go.

Feb 25, 2008



I have 50-60 stored procedures in my application and these are stored in different files as per file one stored procedudre.

I want to deploy my applicaiton. I want to create a batch or Single SQL file to create all stored precodures in on go.

My objective is to ensure that No stored procedure has left while deploying the applicaiton.

thanks.

View 3 Replies View Related

Creating Multiple Stored Procedures At Once

May 1, 2008

Hey

I am creating a database application that is accessed through a .NET front end.
What I want to do is run a SQL script that will create my DB, create my indexes and enforce my constraints (all of which I have done) but I also want to create my stored procedures in the same script also.

When I merge all my stored procedures (about 16) into one file and run it in SQL Query Analyser I get multiple errors but the one that is coursing me the most bother is

€˜Server: Msg 156, Level 15, State 1, Procedure procedureName, Line 134
Incorrect syntax near the keyword 'procedure'.€™

What does this mean and why can€™t I run more than once Stored Procedure at once?


Many thanks

Quish

View 9 Replies View Related

Creating Expressions For Multiple Choices

Mar 14, 2008



Hi,

I have to create an expression that makes bold the text for some possibilities, otherwise the font will keep same, is there any staff for creating an expression like "IF ID_Name IN (x,y,z...) THEN bla-bla" like querying in SQL? Cuz I have to use multiple possibilites for same condition

View 3 Replies View Related

Creating Triggers Among Multiple Database Servers

Nov 14, 2000

Hello,

I am trying to create a trigger to update a table on a different database server. (Both databases are SQL server 7.0) Does anyone know the syntax of how to implement this?

Any help is appreciated!!
Thanks,
Lisa

View 1 Replies View Related

Need Help Creating Outer Join On Multiple Tables

Nov 2, 2005

I'm trying to join 3 tables in an outer join since I am loosing records that need to be included if I only use an inner join. I am pulling data from an MSDE database using the microsoft query tool.

The problem is that I get the message that I can't use an outer join on a query with more than 2 tables, but that can't be right can it?

I'm a SQL code novice so any help would be greatly appreciated!

SELECT
Article.articleId
, Article.articleName
, Article.articleStatus
, Articlegroup_2.ArticlegroupId
, Articlegroup_2.g2_key
, Articlegroup_2.g2_name
, articleGroup.articleGroupId
FROM
HIP.dbo.Article Article, HIP.dbo.articleGroup articleGroup, HIP.dbo.Articlegroup_2 Articlegroup_2
WHERE
articleGroup.articleGroupId = Article.articleGroupId AND
Article.articleGroupId2 = Articlegroup_2.Articlegroup_2_Id

View 5 Replies View Related

Need Help Creating Outer Join On Multiple Tables

Dec 14, 2007

I'm trying to join 2 tables in an outer join, but MS Query won't let me do this because I have another 2 tables included in an inner join ("only two tables are allowed in an outer join"). I am pulling data from an MSDE database using the microsoft query tool.

I'm a SQL code novice so any help would be greatly appreciated!

Here is my existing SQL query (without the new outer join table):

SELECT
Lead_.Country, Lead_.Company_Name, Employee.Full_Name, Lead_.Rn_Create_Date, Lead_.Marketing_Project_Name, Employee_1.Full_Name, Lead_.Comments

FROM
ProductionED.dbo.Employee Employee, ProductionED.dbo.Employee Employee_1, ProductionED.dbo.Lead_ Lead_

WHERE
Employee.Employee_Id = Lead_.Account_Manager_Id AND Employee_1.Employee_Id = Lead_.Created_By_Employee_Id AND ((Lead_.Market_Segment='new'))

View 5 Replies View Related

Creating Multiple Databases From A Single Backup F

Nov 9, 2006

Hi,
I want to create two databases by restoring from a
single backup file in sql server. I am using 2005-sqlexpress .Is it possible?

Thanx in advance..

View 3 Replies View Related

Creating Report Based On Multiple Databases?

May 6, 2008

My application uses 2 databases from 2 different server. When i create a report model in business intellegence development studio I can only create 1 datasource for each database, and 1 datasource view for each datasource. Then when I create a new report, I can only use one datasource.

Is it possible that my report can be built on more than one databases?

thanks in advance

View 4 Replies View Related

Creating Multiple Databases Running Off The Same Data Engine

Aug 23, 2005

Hi, I have looked and loked for the answer to this question and made no progress.  I want to install MSDE on one of our servers, however, when I went to install it, I found that there was another MSDE already installed and running (it was an agent running with our backup software Veritas).  Is it alright to create another database and have 2 running simultaneous on the same data engine?  Is there any type of limitations that I sould know about - such as number of allowed accesses at one time?  Any help is greatly appreicated.

View 1 Replies View Related

Script For Creating Table With Multiple Primary Keys

Feb 1, 2007

Hi,

I am trying to execute following sql script in sql-server 2000 query analyzer

CREATE TABLE user_courses (user_id varchar(30) NOT NULL PRIMARY KEY,
course_id varchar(10) NOT NULL PRIMARY KEY)

Its give's me following error :-
Cannot specify multiple primary key constraint

Hence I am not able to ceate table with multiple primary keys. So can any one tell me how to get this done?.

Secondly, Primary key must be unique i.e duplicate values are not allowed in P.K field. But in this case since I am declaring two fileds as primary keys.
Will it allow me to have following records in the user_courses table?
user_id(P.K) course_id(P.K)
bob CRS235
alice CRS235
Tim CRS235
tom CRS635

So, if we consider both the fields as primary keys together than I am not voilating Uniqueness constraint. But, if I look at course_id alone then I am voilating uniqeness property?

Thanks,

View 4 Replies View Related

SQL Server 2008 :: Creating Multiple Copies Of A Database

Mar 21, 2015

I am creating a program that will take a master database and create separate databases for class room training.creating my own app to do this since it will have other stuff to do.i will have a master database that i will need to create multiple copies of. 2-20 copies, it is about 7GB large. it is used in a classroom training course for our company software. it will also copy a folder on the server onto multiple subfolders.each computer in the classroom will access its own copy of the database/windows folders.

What i am looking for is a fast/reliable way to create the multiple database copies. then when the training class is over and a new one is getting started, we will run my program to reset everything back to start.Should i detach/copy/attach or create a master backup and restore it 20 times. What kind of user access pitfalls will i need to look out for.

View 5 Replies View Related

SQL 2012 :: Creating Index On Multiple Columns Separately

Jul 28, 2015

I used following query to identify missing indexes:

SELECT mid.statement , mid.included_columns, mid.equality_columns, mid.inequality_columns,
migs.avg_total_user_cost * (migs.avg_user_impact / 100.0) * (migs.user_seeks + migs.user_scans) AS improvement_measure,
'CREATE INDEX [NCIX_' + CONVERT (varchar, mig.index_group_handle) + '_' + CONVERT (varchar, mid.index_handle)
+ '_' + LEFT (PARSENAME(mid.statement, 1), 32) + ']'
+ ' ON ' + mid.statement

[Code] ....

I think I need to only create few if an index is covering all columns then I do not need to create more indexes for separate columns or should I create separate index as suggested?

Similarly:

CREATE INDEX [NCIX_20187_20186_TL_SRV_Stationary_Stock_Transact] ON [TL_SRV_Stationary_Stock_Transaction] ([SerialNo],[StationaryStatus]) GO
CREATE INDEX [NCIX_20189_20188_TL_SRV_Stationary_Stock_Transact] ON [TL_SRV_Stationary_Stock_Transaction] ([StationaryStatus]) INCLUDE ([SerialNo]) GO

[Code] ....

Should I create all indexes above or use minimum number of indexes which covers all columns as mentioned in above create index statements?

View 2 Replies View Related

Creating Query To Update A Field For Multiple Items

May 5, 2015

Looking to write an query that will update a field for multiple items, like 1,500.

something like:

UPDATE INMAST
SET FPRICE = 111.11

WHERE
INMAST.FPARTNO = 'xxx'

only issue I'm having is a need to do a JOIN because there's one more condition that must be met from another table, i've tried this:

SET FPRICE = 111.11
JOIN INVCUR
ON
(inmast.fpartno + inmast.frev)= (invcur.fcpartno + invcur.fcpartrev)

WHERE
INMAST.FPARTNO = 'NRE'
AND
invcur.flanycur = 'TRUE'

but that is giving me an error around the JOIN

View 11 Replies View Related

Creating A Unique Constarint On A Multiple Null Column

Aug 3, 2007



HI,

To create a unique constraint on a multiple nullable column, we need to create a view with not null column and and then create a unique index on that view.

Is this is the only way of doing ?

Thank you.

View 1 Replies View Related

Creating A Stored Procedure With Parameters And Multiple Sql-server Queries

Jan 23, 2008

I need to create a stored procedure that will have about 10-15 queries and take 3 parameters.
 the variables will be: @lastmonth, @curryear and @id
@lastmonth should inherit Session variable intlastmonth
@curryear should inherit Session variable intCurrYear
@id should inherit Session id
 One example query is SELECT hours FROM table WHERE MONTH ='" + Session("intLastmonth") + "'  AND YEAR ='" + Session("intCurrYear") + "' AND [NUMBER] = '" + Session("id")
The rest of the queries will be similar and use all 3 variables as well.
How can I go about this and how will queries be seperated.
 

View 2 Replies View Related

Creating Stored Procedure To Send Email To Multiple Users

Sep 20, 2007

Hi Everybody,

I am trying to setup a stored procedure that runs through a Reminders table and sends an email to users based on DateSent field being smaller than todays date. I have already setup the stored procedure to send the email, just having trouble looping through the recordset.




Code Snippet


CREATE PROCEDURE [dbo].[hrDB_SendEmail]

AS

BEGIN


DECLARE @FirstName nvarchar(256),

@LastName nvarchar(256),

@To nvarchar(256),

@ToMgr nvarchar(256),

@Subject nvarchar(256),

@Msg nvarchar(256),

@DateToSend datetime,

@Sent nvarchar(256),

@ReminderID int,

@RowCount int,

@Today datetime,

@Result nvarchar(256)

-- Get the reminders to send


SELECT

@ReminderID = r.intReminderID,

@DateToSend = r.datDateToSend,

@FirstName = e.txtFirstName,

@LastName = e.txtLastName,

@To = e.txtEmail,

@Subject = t.txtReminderSubject,

@Sent = r.txtSent

FROM


(auto_reminders r INNER JOIN employee e ON r.intEmployeeID = e.intEmployeeID) INNER JOIN ref_reminders t ON r.intReminderType = t.intReminderTempID

WHERE


(((r.datDateToSend)<20/12/09) AND

((r.txtSent)='False'))

-- Send the Emails


WHILE(LEN(@To) > 0)

BEGIN


EXEC @Result = sp_send_cdosysmail @To, @ToMgr, @Subject, @Msg

END

-- Mark the records as sent

IF @Result = 'sp_OAGetErrorInfo'


BEGIN


SELECT @Sent = 'Error'

END
ELSE


BEGIN


SELECT @Sent = 'True'

END
UPDATE auto_reminders

SET


auto_reminders.txtSent = @Sent, auto_reminders.datDateSent = @Today

WHERE


intReminderID = @ReminderID

END

GO







From the code you can probably tell I am new to writing stored procedures, so I apologise for any obvious errors. My major problems are :-


how to loop through each record

how to get todays date

whether the struture of the procedure is correct
Also, if you think there is an easier way or a better method, please suggest it. I am open to any suggestions you may have,

Thanks in advance
Ben

View 1 Replies View Related

Creating Multiple Report Folders In Business Intelligence Studio

Jan 29, 2008

Hi,
Is there a possible way to create multiple folders in a report project so that different reports can be categorized and arranged in separate folders. Apparently, it seems not. Is there a workaround?

Thanks.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved