Skip to content

Database

Discussions on database access, SQL, and ADO

This category can be followed from the open social web via the handle database@forum.codeproject.com

17.1k Topics 61.8k Posts
  • zip file

    database sql-server sysadmin tutorial
    4
    0 Votes
    4 Posts
    0 Views
    J
    tan873 wrote: how to zip file with xp_cmdshell in sql server 2005 I suppose that depends on exactly what you mean. First step how would you do it in a command shell? Windows has the 'compact' command built in. Comand line options are documented in the help for that as well as at the following. http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/compact.mspx?mfr=true[^] If you want to use something besides 'compact' then you must explore the command line options for that tool. Once you know how to do it from a regular shell then you explore the options with the shell in sql server.
  • 0 Votes
    6 Posts
    1 Views
    P
    So we found this thread with Google's search engine, Problem is that we do not know what "BOL" is, so please answer the question if you know the solution, or post a link where we can find it. Thanks - we all appreciate it.
  • Oracle to SQL porting [modified]

    database sql-server oracle sysadmin help
    2
    0 Votes
    2 Posts
    0 Views
    C
    The value returned for USER will be the userid that was supplied to establish the connection. If SQL*Plus is available, login to an oracle database and try the command select user from dual. It should return the same value as you supplied as the userid when you logged in. As for the equivalent in SQL Server, I'd suggest try googling for an equivalent. :) Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
  • Official PostgreSQL forum

    postgresql sysadmin
    4
    0 Votes
    4 Posts
    0 Views
    M
    djj55 wrote: I could not fathom why the question got down voted Some twat who probably has not heard of Postgre. I nearly got involved in it in the 90s but chose Access spit instead and from there went naturally into SQL Server. I had just spent some years working with SuperBase only to have it sold 5 times in as many years and it got totally marginalised. I'll stick to mainstream! Never underestimate the power of human stupidity RAH
  • Inserting in Multi table With one Store Procedure

    question sharepoint
    3
    0 Votes
    3 Posts
    0 Views
    M
    future3839 wrote: is there any approach to insert data with writing just one SP This is a basic aspect of an SP Receive values via variables in the procedure declaration CREATE PROC StoreDumy -- Declare @Var1 VARCHAR(100),@Var2 VARCHAR(100),@Var3 VARCHAR(100),@Var4 VARCHAR(100), @Var5 VARCHAR(100),@Var6 VARCHAR(100),@Var7 VARCHAR(100) Insert the variables in the tables required. You may want to wrap the inserts in a transaction so that if 1 insert fails all inserts are rolled back and you are not left with orphaned data As DECLARE @ID int begin TRAN INSERT dbo.Country (Fld1, Fld2) VALUES(@Var1, @Var2) SET @ID = SCOPE\_IDENTITY() INSERT dbo.State (CtryID, Fld1, Fld2) VALUES(@ID, @Var3, @Var4) SET @ID = SCOPE\_IDENTITY() INSERT dbo.Town (StateID, Fld1, Fld2) VALUES(@ID, @Var5, @Var6) COMMIT TRAN Never underestimate the power of human stupidity RAH
  • 0 Votes
    8 Posts
    0 Views
    P
    NeverHeardOfMe wrote: web-apps Oh, that's your problem -- they're rubbish.
  • create script for entire database in PostgreSQL

    question database postgresql tools
    2
    0 Votes
    2 Posts
    0 Views
    J
    You could use PgAdminIII and it's database backup function. This allows you to select which objects you would like to re-create. This could then be run using restore from either PgAdmin or the command line, depending on your requirements
  • deploy PostgreSQL database

    question database postgresql sysadmin
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Field ordering in a table

    tutorial question
    5
    0 Votes
    5 Posts
    0 Views
    G
    Even though it may look nicer to have columns sorted in a particular order, sooner or later you will have no influence on the order any more. For as far as I know it is not possible to insert a column inbetween to existing columns without dropping the entire table and recreating it, which in most large live systems is a big no no as it cost way to much time to do.
  • 0 Votes
    2 Posts
    1 Views
    L
    In case anyone else needs the answer, I had to use the MS_ADOX::_Catalog COM interface which is imported from msadox.dll. For example: MS_ADOX::_CatalogPtr catalogPtr; catalogPtr.CreateInstance(__uuidof(MS_ADOX::Catalog)); catalogPtr->Create("Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=C:\\Temp\\sqlcedemo.sdf;"); The above crap non error checking code creates the C:\\Temp\\sqlcedemo.sdf database, which can then be opened and populated using ADO in the normal fashion.
  • SQL Server Trigger [modified]

    database question sql-server wcf sysadmin
    4
    0 Votes
    4 Posts
    0 Views
    C
    Yes that is correct. I'm not familiar with the SQL Server flavour of doing things, but when defining a trigger you can specify a list of columns as opposed to the entire table, that the trigger is fired on. Glad that has helped you out. :) Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
  • Modifiable field in sql server 2005

    database csharp sql-server sysadmin help
    6
    0 Votes
    6 Posts
    0 Views
    M
    Sorry I had not heard of pervasive. If they supply the functionality you need then use that database, expecting another vendor to match esoteric (and wrong) requirements is not reasonable. Never underestimate the power of human stupidity RAH
  • 0 Votes
    2 Posts
    0 Views
    B
    Try a parameterized query. I do not know how it works with C++, it should be something like: OleDbCommand cmd = new OleDbCommand("Insert ....."); cmd.Parameters.AddwithValue("ParameterName1", timeStampValue); Note: you use here the timestamp value as such, you *must not* convert it to a string!
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • retrieving column's data

    database csharp sql-server sysadmin
    13
    0 Votes
    13 Posts
    0 Views
    R
    Hi, I suggest you create a split function CREATE FUNCTION [dbo].[Split] ( @delimited nvarchar(max), @delimiter nvarchar(100)) RETURNS @t TABLE ( id int identity(1,1), val nvarchar(max))AS BEGIN declare @xml xml set @xml = N'<root><r>' + replace(@delimited,@delimiter,'</r><r>') + '</r></root>' insert into @t(val) select r.value('.','varchar(15)') as item from @xml.nodes('//root/r') as records(r) RETURN END Then cross apply to return your desired column. eg. declare @tmp table (value varchar(100)) insert into @tmp values ('ASD654-100-CCCEEE4444-200-') insert into @tmp values ('QWEQWEQ-2000-JJJLLL-20-PPPBBMMNN-600-') select val from @tmp cross apply dbo.split(value,'-') where id = 3 Ryan
  • Detach the Database

    database sql-server help com sysadmin
    2
    0 Votes
    2 Posts
    0 Views
    F
    I sort out y problem.Righr click and then run as Administrator
  • Stored Procedure

    sharepoint database
    5
    0 Votes
    5 Posts
    0 Views
    M
    J4amieC wrote: ll the parameters were varchar Did not even look at that :-O I assumed anything with an ID is numeric and this structure is almost rote for me. Never underestimate the power of human stupidity RAH
  • SQL Server 2008 - Number Manipulation

    database sql-server sysadmin help
    4
    0 Votes
    4 Posts
    0 Views
    A
    Thanks very much
  • Update query does not affects matched

    database csharp php mysql help
    2
    0 Votes
    2 Posts
    0 Views
    L
    Could you try the statement below? select replace(option_value, 'wordpress', 'Hello World') from wp_postmeta; I are Troll :suss:
  • Xml datatype vs cdc

    database visual-studio xml
    3
    0 Votes
    3 Posts
    0 Views
    E
    but dont you think i will change the column any time the xml schema change. that mean flexibility challange