Easiest Way As I Intended
Jul 4, 2007
Hi guys how are you doing? I was wondering how should I set the values in these two variables without making the select, I mean just set, I think that if I select two times it takes much longer is that true?
declare @user_id int, @creation datetime
select @user_id = user_id, @creation = creation from solarUsers
Select @user_id, @creation
Thank you very much =D.
View 12 Replies
ADVERTISEMENT
Dec 13, 2007
Hello everyone, I have created my web application in VS 2005 using asp.net 2.0 and the built in sql .mdf database creater that comes with visual studio. After I developed my website, I then wanted to move it to one of our servers on the network, which I did without a problem. The website works fine but here is my challange. I need users to be able to connect to the database via login script and the script inserts computer data into the database. So I figured I need to attach the Database to SQL Server 2005. When I try to do this it gives me this database is in use. So I stop the website in IIS, and it allows me to add the database into the SQL Server. Once I do this, and start the website again, the website no longer works and I get a bunch of database errors, that do not get fixed untill I re-copy the website to the server.
Is there a way to just connect to a .mdf file on the network that is not attached to a sql server, through a connection string in a login script? Maybe there is something else I need to do to the database before copying to the server? Or should I re-programm the website with a newly created database in SQL Server, and use that as the datasource?
View 3 Replies
View Related
Apr 24, 2006
Hi Friends,
me again. I am trying to find out if all of my intended foreign keys are actually set as foreign keys programmatically.
Ive stuffed something up, please find my error
USE RIQDB1
SELECT DISTINCT 'Alter table '+ table_name +
' ADD CONSTRAINT DF_'+ table_name + '_' + column_name +
' DEFAULT ' + ''''' FOR '+ column_name FROM Information_schema.columns
WHERE ((column_name Like '%fk%') AND (FROM Information_schema.type = F))
go
thanks
Cm
View 9 Replies
View Related
Dec 7, 2007
I see that a .rds file was created as a result of me defining a shared data source. So are they meant to be shared across projects only within the same solution, across solutions perhaps with references, system wide etc?
View 1 Replies
View Related
Feb 13, 2007
...anywhere in the folder structure a person must be set up as a Content Manager at the Reporting Services ROOT (and at every level of the folder hierarchy down to the level that they are moving/renaming)?
Sure, you can remove them from the role in other folders where they should not be moving or renaming objects, but it seems you still have to have them at the root (and down the chain), which gives them far more capabilities than you might intend.
Jeff
View 1 Replies
View Related
Oct 13, 2015
At one of my accounts I'm using SQL 2008r2 and SSIS in an DWH solution. Today I wanted to created a dynamic sql statement in one of the packages. The dynamic part is in the where-clause a sql query I use. I want to set the values for this clause dynamically. Therefor I created a user variable (named 'Filter') which should get it´s value at run-time.
/DTS "MSDBProdMy Package" /SERVER "My-Server" /CHECKPOINTING OFF /REPORTING EW /SET "Package.Variables[User::Filter].Properties[Expression]";" where [Starting Date] < '2008-09-01 00:00:00.000' "
However when I execute this package with dtexecui it doesn not use the value specified after the /SET parameter, but instead uses the value specifiied at design time. I get the same when I add the execution of ths pacakage as a sql server job step (type SSIS). I would expect that value specified after the /SET parameter would overwrite the valus specified at design time, but I don't see that happening.
View 5 Replies
View Related
Apr 4, 2008
I am hoping to pass an auto incrementing number the the database. From the aspx page, I have the following code, but the insert statement does not work as it should right now. Everything worked fine until I added "rank_order" in and the SQL parameters. What am I doing wrong? Thanks so much :) <asp:SqlDataSource ID="dsConcepts" runat="server"
SelectCommand="SELECT ID, Name FROM Concepts WHERE ID=@ID"
UpdateCommand="UPDATE Concepts SET Name=@Name WHERE ID=@ID"
InsertCommand="INSERT INTO Concepts (Name, courseID, rank_order) VALUES (@Name,@CID, @rank )"> <InsertParameters> <asp:QueryStringParameter Name="CID" DefaultValue="-1" QueryStringField="CID" /> </InsertParameters> <InsertParameters> <asp:QueryStringParameter Name="rank" DefaultValue="Select Max([rank_order]) + 1 From Concepts WHERE courseID=@CID" QueryStringField="rank" /> </InsertParameters> <SelectParameters> <asp:QueryStringParameter Name="ID" DefaultValue="-1" QueryStringField="ID" /> </SelectParameters> </asp:SqlDataSource>
View 5 Replies
View Related
Jun 17, 2008
Hi I have a situation where i have a drop down list. The user selects a value from it and then a query behind the scenes is generated based on the value from the list. I want the result of the query to be diplayed in the textbox.I've checked a few examples but i don't really have a good understanding of how to generate this query and get the results to the textbox. I think you use the SQLDATASOURCE but still need some help...Can anyone help? Thanks.
View 4 Replies
View Related
Jan 25, 2006
I get a file with some key information delivered to an ftp destination each day along with some files containing rawdata.
The file is a csv file containing some short description of what is being delivered.
Numrows;pulltime;sourceinfo
25302524;25-01-2006;dssrv34
So the file has columndescription and 1 row with some information.
My question is, what is the easiest way to get those 3 informations into 3 variables ?
View 3 Replies
View Related
Apr 26, 2007
I have a database where several thousand records have NULL in a binary field. I want to change all the NULLs to false. I have Visual Studio 5, and the database is a SQL Server 5 database on a remote server. What is the easiest way to do this? Is there a query I can run that will set all ReNew to false where ReNew is Null? This is a live database so I want to get it right. I can't afford to mess it up.Diane
View 2 Replies
View Related
Jul 24, 2007
With classic asp I would do something like this:
set conn = server.createobject("ADODB.Connection")
conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=sqlservername;UID=username;PWD=password;DATABASE=databasename "set rs = conn.execute("select count(*) from myTable")response.write rs(0)How can I do this with asp.net in the fewest number of lines?
View 3 Replies
View Related
Mar 17, 2008
What is the easiest way to insert a new row in a existing sql table through web developer.net (visual basic)?
E.g. a database called Names and the columns Firstname and Surname and you want to insert "anna","johnsson"?
thank you very much.
View 3 Replies
View Related
Aug 27, 1999
Hi!
What is the easiest way to recreate jobs running on one server on another server?
Thank you
Praveena
View 2 Replies
View Related
Apr 30, 2006
Hi, I'm new to SQL Server, and would appreciate some advice on the quickest way to import data from a CSV file.
I've created a database using Visual Web Developer Express, and added a couple of tables. The Help file in SQL Server Express (which is installed on the same PC) indicates that I should use BULK INSERT to populate the table. Only snag is, I could find anywhere to enter the commands! Eventually, I found out about the SQLCMD command which I entered in a Windows Command Window. I successfully connected to the default (SQLEXPRESS) server instance this way, but when I typed USE <my database name> I got an error back saying it couldn't find the database. I know that Visual Web Developer Express by default creates user-specific instances of the database, but I've turned that off (I think!) via the connection string. So, please could someone tell me how I can connect to my database via the SQLCMD command, or alternativley please let me know how else I can bulk inmport data from a CSV file. Many thanks in advance.
View 4 Replies
View Related
Aug 9, 2004
im pretty new to SQL and i'm just reading up on full-text searches... i need to do a a full-text search on one table i have in the database.. however I'm reading about full-text indexing/searching and a lot of pages are saying that it uses a lot of resources when searching.. i was wondering how bad is it really? we have about ~100 users who would access the database, probably the peak would be 75 at a time.. would people using a full-text searching slow it down a lot? the servr is a dell poweredge 1750 server, dual 2.8ghz xeon, 1 gig ram.. and also, about the incermental population, if i read right, it populates the catalog each time a item in the table is deleted/inserted/modified.. so would that use a lot of resources as well?
i'm just trying to see if it's worth it to enable full-text indexing for searches on the database if it doesn't slow down the server too much... or are there any better/easier ways to perform searches?
thanks
View 5 Replies
View Related
Jul 23, 2005
Can anyone recommend the easiest way to get a full copy of a database fromone server to another. The servers are not part of the same organization ornetwork.I have received a backup of the database created with enterprise manager butam unable to restore it into a database of the same name on my server.Thanks,Kevin
View 5 Replies
View Related
Jan 14, 2005
Hi,
I'm found this sample for BACKUP DATABASE statement in SQL Server 2000 Book
Online, but is seemed that only save file to server. How can I save backup
file to local computer? or there is other way as easy as this statement for
backup/restore database?
-- Create a logical backup device for the full MyNwind backup.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwind_1',
DISK ='c:Program FilesMicrosoft SQL ServerMSSQLBACKUPMyNwind_1.dat'
-- Back up the full MyNwind database.
BACKUP DATABASE MyNwind TO MyNwind_1
Thanks,
Tien,
View 5 Replies
View Related
Jan 14, 2005
Hi,
I'm found this sample for BACKUP DATABASE statement in SQL Server 2000 Book
Online, but is seemed that only save file to server. How can I save backup
file to local computer? or there is other way as easy as this statement for
backup/restore database?
-- Create a logical backup device for the full MyNwind backup.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwind_1',
DISK ='c:Program FilesMicrosoft SQL ServerMSSQLBACKUPMyNwind_1.dat'
-- Back up the full MyNwind database.
BACKUP DATABASE MyNwind TO MyNwind_1
Thanks,
Tien,
View 4 Replies
View Related
Mar 22, 2007
I am trying to sort out the member "Adams" from the committee members, and sum up the total amounts that were donated while he was the committee member.
The Table:
CREATE TABLE contribution_list
(contrib_date DATE NOT NULL,
donor_name VARCHAR(30) NOT NULL,
amount NUMBER(8,2),
program VARCHAR2(30),
committee_member VARCHAR2(20) NOT NULL,
PRIMARY KEY (contrib_date,donor_name,committee_member));
The Code that is giving me errors:(not a group by expression):
CREATE or REPLACE VIEW adams_conrtibution_total as
select program, committee_member, sum(amount)
from contribution_list
where committee_member = 'Adams'
group by program;
View 1 Replies
View Related
Dec 1, 2007
SQL Server RS 2000 SP4
I'm trying to find the easiest way to get a list of every data source on a RS instance, including the name of the SQL Server that the data source points to. We want to make sure none of the data sources point at our primary OLTP server.
I looked at the DataSource table in the ReportServer DB, but of course the connection string info is encrypted. I'm hoping that I don't need to resort to writing .net code to hit the web service.
TIA,
-Peter
View 3 Replies
View Related
Nov 21, 2007
I need copy one database from one server into another server.
Both servers have SQLSERVER 2000.
One way is copy the LDF files directly but I need to stop the engine to do that, I€™m sure there are many other ways more efficiently.
I do need an advice.
Thanks in advance
View 10 Replies
View Related
Jun 1, 2006
Hi there!
Often discussed, but not really solved in my opinion - the connection between the partners and the witness causes problems.
My case: Three Servers in the same domain, three endpoints on 5022 with windows negotiation, all endpoints can be reached by telnet from each server. Mirrorring works. So far so good.
But one of these partners is not able to connect to the witness. The witness' error log is full with that:
"2006-06-01 13:45:20.32 Logon Database Mirroring login attempt failed with error: 'Connection handshake failed. An OS call failed: (8009030c) 0x8009030c(Der Anmeldeversuch ist fehlgeschlagen.). State 67.'. [CLIENT: 130.143.205.54]"
My Endpoints are created like
CREATE ENDPOINT [EASYRIS_Mirroring]
AUTHORIZATION [code1dephbrsaa1-sys108]
STATE=STARTED
AS TCP (LISTENER_PORT = 5022, LISTENER_IP = ALL)
FOR DATA_MIRRORING (ROLE = PARTNER, AUTHENTICATION = WINDOWS NEGOTIATE
, ENCRYPTION = SUPPORTED ALGORITHM RC4);
What catches my eyes is that
GRANT CONNECT ON ENDPOINT::EASYRIS_Mirroring TO [code1dephbrsaa1-sys108];
doesn't cause these user to appear in the result set of
SELECT EP.name, SP.STATE,
CONVERT(nvarchar(38), suser_name(SP.grantor_principal_id))
AS GRANTOR,
SP.TYPE AS PERMISSION,
CONVERT(nvarchar(46),suser_name(SP.grantee_principal_id))
AS GRANTEE
FROM sys.server_permissions SP , sys.endpoints EP
WHERE SP.major_id = EP.endpoint_id
ORDER BY Permission,grantor, grantee;
By the way, these mentioned user is sysadmin and grantor.
Has anyone an idea?
Torsten
View 4 Replies
View Related
Jul 20, 2015
I want to run a SQL Agent step as a different user than the one used by the Agent service.  I thought that I would create a new credential and then have a proxy use it, however there are none for just plain old SQL.  This is a SQL 2014 Enterprise instance. The reason for this is that I the Windows login that is used by the Agent service is not defined as a login in the database, I don;t want to therefore add it in as a user with restrictive rights it case it impacts on other jobs.  What is the easiest way of have a single job step run under a different Login?Â
View 7 Replies
View Related
Jul 20, 2005
I have a table;CREATE TABLE theLiterals (theKey varchar (255) NOT NULL ,theValue varchar (255) NULL)INSERT INTO theLiterals VALUES('defaultServer','\MyServer')INSERT INTO theLiterals VALUES('defaultShare','MyShare')INSERT INTO theLiterals VALUES('defaultFolder','MyFolder')INSERT INTO theLiterals VALUES('defaultFile','MyFile.dat')I then try;SELECTdefaultServer = CASE WHEN theKey = 'defaultServer' THEN theValue END,defaultShare = CASE WHEN theKey = 'defaultShare' THEN theValue END,defaultFolder = CASE WHEN theKey = 'defaultFolder' THEN theValue END,defaultFile = CASE WHEN theKey = 'defaultFile' THEN theValue ENDFROM theLiteralsand I get;defaultServer defaultShare defaultFolder defaultFile\MyServer NULL NULL NULLNULL MyShare NULL NULLNULL NULL MyFolder NULLNULL NULL NULL MyFile.datbut I want it COALESCEd like this;defaultServer defaultShare defaultFolder defaultFile\MyServer MyShare MyFolder MyFile.dat....but my syntax is incorrect. Is there an efficient way of doing this.I want to have a script/UDF where I can say...GetLiteralsFor('defaultServer','defaultShare','def aultFolder','defaultFile')and then my one-row recordset will be...RS(0) will = '\MyServer'RS(1) will = 'MyShare'RS(2) will = 'MyFolder'RS(3) will = 'MyFile.dat'Thanks for any help!
View 5 Replies
View Related
Jun 19, 2006
I'm trying to gather information from within a SSIS package for benchmarking, reconciliation, and reporting purposes in regards to cube processing, which I'm initiating using the AS processing task.
What is the easiest way to capture this information?
The only way I've been able to come up with is to use a profiler trace. If this is really the only way, what is the easiest way to execute and read the trace from within SSIS?
Also, if a script task has to be used, does anyone have a code sample?
Thanks in advance!
View 3 Replies
View Related
Feb 8, 2007
Hi,
My package dumps the errors into a table. The problem is, it couldnt dump Error Output column to a varchar field. I have added an script component in between to transform to string but no success.
I tried ErrorOutput.GetBlobData(0, ErrorOutput.Length)
but when I query the database, it says "System.Byte[]'
I will appreciate the responses to this post.
Thankyou,
Fahad
View 12 Replies
View Related
Mar 15, 2006
I've tried creating a simple SSIS package but I get the error:
[Transfer SQL Server Objects Task] Error: Execution failed with the following error: "Cannot apply value null to property Login: Value cannot be null..".
THis is a known bug and while we wait for SP1 to fix this error, is there another way to simply copy tables (with indexes and without having the identity column renumbered) ?
Any help is appreciated!
View 5 Replies
View Related