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 have seen this done but cannot see how to fit it into my code - most of the exapmles i have found on google are delete etc rather than the insert into i have
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
I have found the following code online which i can get an error from
<?php
//connect to a DSN "myDSN"
$conn = odbc_connect('PPORTAL','PHP','PHP1');
if ($conn)
echo "odbc connected";
else echo "odbc not connected";
?>
It comes back withh the ODBC not connected line but if i test the...
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...
thanks for the help
tried this - i changed to :
DECLARE @bcpCmd VARCHAR(8000)
SET @bcpCmd = 'bcp "SELECT company, address, postcode
FROM mytestdatabase.dbo.tbl_ifa"
queryout D:\folder\test.csv -c -t, -r -T -S SERVERNAME'
EXEC master..xp_cmdshell @bcpCmd...
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...
cheers jpadie - works great -so grateful for the help.
so i understand the script is saying if i tick more than 0 'YES' boxes show the Yes div but if the No's equal the total number of radio/2 then show the No - sound about right?
thanks for the response but it did not seem to work
i have created a basic page with a sample form on - the full code is can be seen 'view source'
Link
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...
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.