I am using 2008 R2 and trying to build an Excel file from data within SQL
I am using the following code
SET @SQL=N'INSERT INTO OPENROWSET(''Microsoft.ACE.OLEDB.12.0'',''Excel 8.0;HDR=YES;DATABASE='+@FILENAME+''',''Select * from [Whitelist$]'')SELECT PHRASE FROM dbo.TBL_PHRASE WHERE TID =...
Sorry i know this is basic but i am trying to connect to MSSQL - usually use ASP but trying PHP - and getting errors with my connection string.
<?php
$serverName = "IPAddress\server,port";
$connectionInfo = array( "Database"=>"dbName", "UID"=>"****", "PWD"=>"********");
$conn = sqlsrv_connect(...
I am looking to export data from a query to existing form fields in a word or PDF document - essentially pass client name, address details to a document for them to sign. I know doing this via PDF is probably more difficult - has anyone managed this before? Any ideas that could help me
tnanks
We have a VPN connection between two offices using Draytek Vigor 2830n boxes. Over the last few days the connection has been really slow for users accessing shared folders/files and using remote desktop. We have checked the connections with pings etc and spoken to the line providers and...
i am trying to pass a variable into an Openrowset - i have seen its not possible this way but not sure what the solution will be.
I need to do it as i have multiple files in need to pull data in from, my incorrect code is below:
DECLARE @XFILENAME AS VARCHAR(50)
DECLARE CUR_UPDATE SCROLL...
i am looking to split a string into its individual words and then store these words in a table via a stored proc
my table is tbl_words with a column called words
if the string is 'i am stuck with sql' then i want the rows in the table to be each word in that sentence.
thanks for any help
Please bear with me as i am trying PHP for the first time
i have the following code and it gives me no errors but no records - am i missing something?
<?php
// Connects to your Database
$dsn="DBNAME";
$username="sa";
$password="xxxxxxx";
$sqlsrv_connect=odbc_connect($dsn, $username...
tried creating and editing CSV files with data from SQL
on another thread i have tried BCP but it has had problems so tried another method.
I am copying a template CSV file, using Openrowset and then running a Batch file to remove the headers for import into another program
EXEC sp_configure...
trying to create a BCP that will export data from a table to a CSV file.
I have the following code:
DECLARE @bcpCmd VARCHAR(8000)
SET @bcpCmd = 'bcp "SELECT company, address, postcode FROM tbl_ifa" queryout D:\folder\test.csv -c -t, -r -T -S SERVERNAME'
EXEC master..xp_cmdshell @bcpCmd
but...
I have found a lot of info on inserting data from word and inserting whole documents into sql but not the other way around.
I have a template word document that is an invoice and i want SQL to be able to run a SP that will insert data into this document on an automated basis. I have seen...
I am using the following script for a form
<script type="text/javascript">
$(document).ready(function(){
$('input[type="radio"]').click(function(){
if($(this).attr("value")=="Q1YES"){
$(".box").hide();
$(".yes").show();
}...
I have an SQL Server on a remote server to which i log in with a specific username and password. I want to allow other users access to three tables only on one specific database for them to view and download data. How can i give them access without giving them the admin username and password...
I am posting data from a table to excel using openrowset however i keep getting 'String or binary data would be truncated.' errors which i assume means the data i am passing is too big. My code is below:
DECLARE @SQL3 as varchar(max)
SET @SQL3=N'INSERT INTO...
after years of doing classic ASP i am giving PHP a go so bear with me.
i am trying to test a simple build a table from data in my SQL database and i keep getting errors, can someone check my code
<?php
// connect to the database
$connect = odbc_connect("ODBCNAME", "USERNAME"...
Have been asked to create a short cut key in word so a user can tab through a document straight to where he has inserted square brackets (he uses them to identify where he needs to add text later to a template letter). I have tried to assign short cut keys etc in word but i think this has to be...
I want to export my query data to excel which is easy enough using OpenRowset, however i want to be able to target the data to specif cells eg
Query returns a value of money that i want to put in cell B5 in excel - can i target this cell with the result?
My code to post the results at the...
Is there a script i can use to do the following
I have 4 text fields each with different dates in and a drop down select menu with numbers from 1 to 28.
If the user selects 10 from the drop down (months) it automatically changes the dates in the four text fields (date1,date2 etc) to add 10...
I have a stored procedure running on our data server that uses database mail to send out emails with attachments. The problem i have is that the file to be attached is on our webserver.
if i map drives between boxes and use this new path or if i use the IP of the webserver the proc always...
probably really easy but its foxed me
i have a date field in which a number of records have the date as DateTime and it shows todays date as 4/10/2010 00:00:00
but if i create a query with Getdate() it does not find the above records as getdate() has the time as well i assume
how can i do the...
I have a PDF document which has a few monetary values in it, i want to be able to update the document from a query in SQL and then save the updated PDF as a unique file name. I assume i will need text fields in the PDF - its just how to get the data to these fields from SQL?
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.